Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Optimierungsanfrage für Timer-Skript (Blockly)

    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

    Optimierungsanfrage für Timer-Skript (Blockly)

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

      Hallo zusammen,

      ich habe mir ein Skript gebastelt, welches nach einer bestimmten Zeit bei Unterschreitung von Wert X den Aktor ausschaltet. Das Skript an sich läuft soweit auch gut, allerdings gibts noch ein Problem, welches vielleicht mit einer kleineren Optimierung am Skript auch behoben werden kann.
      Schaltet der Aktor bei Unterschreitung von Wert X ab, wird nach der Abschaltung das Skript noch einmal ausgeführt, weil sich der Wert nochmal auf 0 ändert. Vielleicht hat noch jemand eine Idee um das auch noch abzustellen?!

      code_text
      <xml xmlns="http://www.w3.org/1999/xhtml">
        <variables>
          <variable type="undefined" id="timeout">timeout</variable>
        </variables>
        <block type="on_ext" id="yda9ZPzvLr@8v$KoYpSC" x="163" y="113">
          <mutation items="1"></mutation>
          <field name="CONDITION">ne</field>
          <field name="ACK_CONDITION"></field>
          <value name="OID0">
            <shadow type="field_oid" id="#/Ff33;-k4L`2Gw8$@@1">
              <field name="oid">hm-rpc.1.000858A994DBC5.7.POWER</field>
            </shadow>
          </value>
          <statement name="STATEMENT">
            <block type="controls_if" id="}jyQ--#8Qext%.U.a^MA">
              <mutation elseif="1"></mutation>
              <value name="IF0">
                <block type="logic_compare" id="q=e#[NDbCDX?rkWh/gQb">
                  <field name="OP">LTE</field>
                  <value name="A">
                    <block type="get_value" id="r.a-qapyxREKEx_h:Um?">
                      <field name="ATTR">val</field>
                      <field name="OID">hm-rpc.1.000858A994DBC5.7.POWER</field>
                    </block>
                  </value>
                  <value name="B">
                    <block type="math_number" id="(;$r$)r1(gfK+(%QOIn3">
                      <field name="NUM">9</field>
                    </block>
                  </value>
                </block>
              </value>
              <statement name="DO0">
                <block type="timeouts_settimeout" id="K*kOLM#;7WARS[El8RAB">
                  <field name="NAME">timeout</field>
                  <field name="DELAY">20</field>
                  <field name="UNIT">sec</field>
                  <statement name="STATEMENT">
                    <block type="control" id="BOY4U=CinfrBe^kq3l;J">
                      <mutation delay_input="false"></mutation>
                      <field name="OID">hm-rpc.1.000858A994DBC5.4.STATE</field>
                      <field name="WITH_DELAY">FALSE</field>
                      <value name="VALUE">
                        <block type="logic_boolean" id="F*6Uh!Dos,l%}Hgh9(G.">
                          <field name="BOOL">FALSE</field>
                        </block>
                      </value>
                      <next>
                        <block type="debug" id="YIBbFir`%EhT`J0P2L.6">
                          <field name="Severity">error</field>
                          <value name="TEXT">
                            <shadow type="text" id="_LJsub0`3ruvdnnU^OA?">
                              <field name="TEXT">Strom ausgeschaltet</field>
                            </shadow>
                          </value>
                        </block>
                      </next>
                    </block>
                  </statement>
                </block>
              </statement>
              <value name="IF1">
                <block type="logic_compare" id="lRzfn=!-Ifx0WNyc0+*Z">
                  <field name="OP">GTE</field>
                  <value name="A">
                    <block type="get_value" id="fz_TURmFVl}/ZybN,uPc">
                      <field name="ATTR">val</field>
                      <field name="OID">hm-rpc.1.000858A994DBC5.7.POWER</field>
                    </block>
                  </value>
                  <value name="B">
                    <block type="math_number" id="Uu%.?#plT;0]VUz|M!?G">
                      <field name="NUM">9</field>
                    </block>
                  </value>
                </block>
              </value>
              <statement name="DO1">
                <block type="debug" id="Wvfk5s#mhKNvs8Km*P(+">
                  <field name="Severity">error</field>
                  <value name="TEXT">
                    <shadow type="text" id="D=3i/@2GR2s-y)!wsXx?">
                      <field name="TEXT">Strom eingeschaltet lassen</field>
                    </shadow>
                  </value>
                </block>
              </statement>
            </block>
          </statement>
        </block>
      </xml>!
      
      

      Skript.jpg

      Danke!

      Gruß surfer 😉

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

        @surfer09
        Wert und vorheriger Wert findet man unter Trigger.

        Blockly_temp.JPG

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

          @paul53 : Danke Paul!! 🙂

          1 Reply Last reply Reply Quote 0
          • K
            kg36304 last edited by

            Hallo,

            ist zwar schon ne weile her aber wo bekomme ich dieses vermaledeite "und" Modul her?

            Finde es nirgends in den Vorlagen bei Blockly.

            Danke.

            1 Reply Last reply Reply Quote 0
            • O
              oFbEQnpoLKKl6mbY5e13 last edited by

              Das dürfe das "und" aus Logik sein. Die Darstellung kenne ich auch nicht.

              paul53 1 Reply Last reply Reply Quote 0
              • K
                kg36304 last edited by

                dachte ich auch, aber das ist komplett anders mit der Fläche davor und dem doppelten Ausgang. 😞

                1 Reply Last reply Reply Quote 0
                • O
                  oFbEQnpoLKKl6mbY5e13 last edited by oFbEQnpoLKKl6mbY5e13

                  Das ist nur die Darstellung. In dem Fall zwei "und" zusammengesteckt.

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

                    @oFbEQnpoLKKl6mbY5e13 sagte:

                    Das dürfe das "und" aus Logik sein.

                    Ja, und rechte Maustaste über dem Block und "externe Eingänge" auswählen.

                    1 Reply Last reply Reply Quote 0
                    • O
                      oFbEQnpoLKKl6mbY5e13 last edited by

                      Danke, das ist eine sehr viel bessere Darstellung!

                      1 Reply Last reply Reply Quote 0
                      • K
                        kg36304 last edited by

                        Hi, wollte nur kurz Danke sagen. Das war der richtige Tipp.
                        Und wieder was gelernt, merci.

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

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        542
                        Online

                        31.8k
                        Users

                        80.0k
                        Topics

                        1.3m
                        Posts

                        blockly
                        4
                        10
                        802
                        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