NEWS
Optimierungsanfrage für Timer-Skript (Blockly)
-
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>!
Danke!
Gruß surfer ;-)
-
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>!
Danke!
Gruß surfer ;-)
-
Das dürfe das "und" aus Logik sein. Die Darstellung kenne ich auch nicht.
-
Das ist nur die Darstellung. In dem Fall zwei "und" zusammengesteckt.
-
Das dürfe das "und" aus Logik sein. Die Darstellung kenne ich auch nicht.
@oFbEQnpoLKKl6mbY5e13 sagte:
Das dürfe das "und" aus Logik sein.
Ja, und rechte Maustaste über dem Block und "externe Eingänge" auswählen.
-
Danke, das ist eine sehr viel bessere Darstellung!
