Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Motorsteuerung

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Motorsteuerung

    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      Caveman2020 last edited by

      Hallo geehrte Gemeinde. Vermutlich stelle ich mich wieder zu doof an.
      Wollte eine Getriebemotor über trigger ansteuern, das script soll nur einmal ausgeführt werden, egal wie lange der trigger anliegt.
      Meine Lösung funktioniert nur leider nicht wie gewünscht, wird wiederholt ausgeführt.
      Wenn als jemand einen Denkanstoss für mich hat, wäre ich dankbar.

      <xml xmlns="https://developers.google.com/blockly/xml">
        <variables>
          <variable type="timeout" id="timeout">timeout</variable>
        </variables>
        <block type="on_ext" id="|9EAo{H4p*Pyrzo(WvHb" x="13" y="-612">
          <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
          <field name="CONDITION">false</field>
          <field name="ACK_CONDITION"></field>
          <value name="OID0">
            <shadow type="field_oid" id="F.(9T~tyofsH4ep6q;ru">
              <field name="oid">sonoff.0.Badezimmer.POWER</field>
            </shadow>
          </value>
          <statement name="STATEMENT">
            <block type="controls_repeat_ext" id="o3eE(3uJCz`8!USdR,f?">
              <value name="TIMES">
                <shadow type="math_number" id="v6BT]x[/.O~yjEdj$=Qc">
                  <field name="NUM">1</field>
                </shadow>
              </value>
              <statement name="DO">
                <block type="request" id=":o{v`w@S:}f2?(zgZdPI">
                  <mutation xmlns="http://www.w3.org/1999/xhtml" with_statement="true"></mutation>
                  <field name="WITH_STATEMENT">TRUE</field>
                  <field name="LOG">log</field>
                  <value name="URL">
                    <shadow type="text" id="|E;?QLtpK`?AV`ibxR|1">
                      <field name="TEXT">http://192.168.178.63/control?cmd=LolinMotorShieldCMD,0,backward,50 </field>
                    </shadow>
                  </value>
                  <next>
                    <block type="timeouts_settimeout" id="!uzm3TRrd+|E#v?Uyjcj">
                      <field name="NAME">timeout</field>
                      <field name="DELAY">10</field>
                      <field name="UNIT">sec</field>
                      <statement name="STATEMENT">
                        <block type="request" id=",dCw$lU)V6!=qCy)l.m}">
                          <mutation xmlns="http://www.w3.org/1999/xhtml" with_statement="true"></mutation>
                          <field name="WITH_STATEMENT">TRUE</field>
                          <field name="LOG">log</field>
                          <value name="URL">
                            <shadow type="text" id="q,LQ3;P$U@_M!bvKh}$y">
                              <field name="TEXT">http://192.168.178.63/control?cmd=LolinMotorShieldCMD,0,stop</field>
                            </shadow>
                          </value>
                        </block>
                      </statement>
                      <next>
                        <block type="controls_flow_statements" id="P?U]s11q/=o}u_PI7vHs">
                          <field name="FLOW">BREAK</field>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </statement>
            </block>
          </statement>
        </block>
      </xml>
      

      (ist ein Blockly-Script)

      sigi234 C paul53 3 Replies Last reply Reply Quote 0
      • sigi234
        sigi234 Forum Testing Most Active @Caveman2020 last edited by

        @caveman2020

        Screenshot vom Blockly wäre auch interessant.

        1 Reply Last reply Reply Quote 0
        • C
          Caveman2020 @Caveman2020 last edited by

          @caveman2020 Motorsteuerung.png

          1 Reply Last reply Reply Quote 0
          • paul53
            paul53 @Caveman2020 last edited by paul53

            @caveman2020 sagte: wird wiederholt ausgeführt.

            Ändere mal den Trigger auf "ist kleiner als letztes" und entferne die sinnlose Schleife.

            C 1 Reply Last reply Reply Quote 0
            • C
              Caveman2020 @paul53 last edited by

              @paul53 Habe die Änderung vorgenommen, funktioniert. Vielleicht ist mein Verständnis beschränkt, aber warum fünktioniert das auf diese Weise ?
              Danke für die Hilfe

              C 1 Reply Last reply Reply Quote 0
              • C
                Caveman2020 @Caveman2020 last edited by

                @caveman2020 Hallo geehrte Gemeinde,
                ich habe folgendes Script überarbeitet (vielen Dank nochmal für die Hilfe).
                Motorscript.jpg

                Die Angaben im URL Request sehen wie folgt aus

                http://192.168.178.63/control?cmd=LolinMotorShieldCMD,0,forward,50

                Wie könnte ich das Script um eine Variable erweitern, die eine Laufzeit aus einem Widget ( Zahlenwert zwischen 0-100) erzeugt.

                leider habe ich bisher keine wirkliche Lösung gesehen, den wert an den Timeout-Block zu übergeben.

                Vielen Dank für eure Tipps.

                paul53 1 Reply Last reply Reply Quote 0
                • paul53
                  paul53 @Caveman2020 last edited by

                  @caveman2020 sagte: Script um eine Variable erweitern, die eine Laufzeit aus einem Widget ( Zahlenwert zwischen 0-100) erzeugt.

                  Bild_2021-04-05_141831.png

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  Support us

                  ioBroker
                  Community Adapters
                  Donate

                  891
                  Online

                  31.9k
                  Users

                  80.2k
                  Topics

                  1.3m
                  Posts

                  3
                  7
                  235
                  Loading More Posts
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes
                  Reply
                  • Reply as topic
                  Log in to reply
                  Community
                  Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                  The ioBroker Community 2014-2023
                  logo