Skip to content
  • Home
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. Optimierungsanfrage für Timer-Skript (Blockly)

NEWS

  • Monatsrückblick Januar/Februar 2026 ist online!
    BluefoxB
    Bluefox
    16
    1
    320

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    17
    1
    4.8k

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    1.3k

Optimierungsanfrage für Timer-Skript (Blockly)

Scheduled Pinned Locked Moved Skripten / Logik
blockly
10 Posts 4 Posters 900 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • surfer09S Offline
    surfer09S Offline
    surfer09
    wrote on last edited by
    #1

    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 ;-)

    IO-Broker Master/Slave auf Windows 11 64bit, NPM 10.9.4, Node 22.21.1 js-controller 7.0.7

    paul53P 1 Reply Last reply
    0
    • surfer09S surfer09

      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 ;-)

      paul53P Offline
      paul53P Offline
      paul53
      wrote on last edited by paul53
      #2

      @surfer09
      Wert und vorheriger Wert findet man unter Trigger.

      Blockly_temp.JPG

      Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
      Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

      surfer09S 1 Reply Last reply
      0
      • paul53P paul53

        @surfer09
        Wert und vorheriger Wert findet man unter Trigger.

        Blockly_temp.JPG

        surfer09S Offline
        surfer09S Offline
        surfer09
        wrote on last edited by
        #3

        @paul53 : Danke Paul!! :-)

        IO-Broker Master/Slave auf Windows 11 64bit, NPM 10.9.4, Node 22.21.1 js-controller 7.0.7

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kg36304
          wrote on last edited by
          #4

          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
          0
          • O Offline
            O Offline
            oFbEQnpoLKKl6mbY5e13
            wrote on last edited by
            #5

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

            paul53P 1 Reply Last reply
            0
            • K Offline
              K Offline
              kg36304
              wrote on last edited by
              #6

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

              1 Reply Last reply
              0
              • O Offline
                O Offline
                oFbEQnpoLKKl6mbY5e13
                wrote on last edited by oFbEQnpoLKKl6mbY5e13
                #7

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

                1 Reply Last reply
                0
                • O oFbEQnpoLKKl6mbY5e13

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

                  paul53P Offline
                  paul53P Offline
                  paul53
                  wrote on last edited by
                  #8

                  @oFbEQnpoLKKl6mbY5e13 sagte:

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

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

                  Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                  Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                  1 Reply Last reply
                  0
                  • O Offline
                    O Offline
                    oFbEQnpoLKKl6mbY5e13
                    wrote on last edited by
                    #9

                    Danke, das ist eine sehr viel bessere Darstellung!

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      kg36304
                      wrote on last edited by
                      #10

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

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      Support us

                      ioBroker
                      Community Adapters
                      Donate

                      420

                      Online

                      32.7k

                      Users

                      82.5k

                      Topics

                      1.3m

                      Posts
                      Community
                      Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                      ioBroker Community 2014-2025
                      logo
                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Home
                      • Recent
                      • Tags
                      • Unread 0
                      • Categories
                      • Unreplied
                      • Popular
                      • GitHub
                      • Docu
                      • Hilfe