Hallo,
Seit einiger Zeit schlage ich mich mit Blockly rum, komme aber irgendwie mit den Zeitfunktionen/verzögerungen nicht klar. Hier mal mein letzter kläglicher Versuch das umzusetzen:
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable type="timeout" id="timeout">timeout</variable>
</variables>
<block type="on_ext" id="A=X:{0d[$G+Gmf7AlgyQ" x="-563" y="-637">
<mutation xmlns="http://www.w3.org/1999/xhtml" items="3"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="8DWGNY^7/~$(C0CYb%pF">
<field name="oid">hue.0.Hauptschalter.lastupdated</field>
</shadow>
</value>
<value name="OID1">
<shadow type="field_oid" id="`ofvx2GAj@ebBgf/Swg`">
<field name="oid">fb-checkpresence.0.20X.presence</field>
</shadow>
</value>
<value name="OID2">
<shadow type="field_oid" id="[,RdpN|WeLI6Ui5+IGeR">
<field name="oid">fb-checkpresence.0.M5.presence</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="debug" id=":#EqZ6*yp2pRg7$Dh{)!">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="+|2O@J]G?h~+j`%t-Zj$">
<field name="TEXT">getriggert</field>
</shadow>
</value>
<next>
<block type="controls_if" id="9Zk%=YXP(6RZhvV*M1Z_">
<mutation elseif="2"></mutation>
<value name="IF0">
<block type="logic_operation" id="QZW;#86T)8o*,X`Wz#z(" inline="false">
<field name="OP">OR</field>
<value name="A">
<block type="logic_compare" id="zw6OEM,w8^9WtpQKA09n">
<field name="OP">EQ</field>
<comment pinned="false" h="45" w="156">Hier nog den wert Bewegung rein</comment>
<value name="A">
<block type="get_value" id="Z*Vf(dG;r6`Urf+cfuxA">
<field name="ATTR">val</field>
<field name="OID">fb-checkpresence.0.20X.presence</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="|jLQ*tQbZ*~l@KrxX=vA">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="x_Z#qb|,`3@EQ]CUX;y{">
<field name="OP">EQ</field>
<comment pinned="false" h="45" w="156">Hier nog den wert Bewegung rein</comment>
<value name="A">
<block type="get_value" id="h2X87=Z2e~-|Z0,Q{.8F">
<field name="ATTR">val</field>
<field name="OID">fb-checkpresence.0.M5.presence</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="}()m9QL2%s=aW6w!1{RZ">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="timeouts_settimeout" id="e4z(]RSu-d6rE+vH%L?H">
<field name="NAME">timeout</field>
<field name="DELAY">10</field>
<field name="UNIT">sec</field>
<statement name="STATEMENT">
<block type="debug" id="pRVGpU{)FHz}R#,qV9Sw">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="pP[?27NHvdrS?SH.JI~s">
<field name="TEXT">Alles verzögert ausschalten</field>
</shadow>
</value>
<next>
<block type="comment" id="l@q9:1ju8Aot^?Pa8rvn">
<field name="COMMENT">Musik Bad aus</field>
<next>
<block type="control" id="+mvj}*j^5PL20h.enCT{">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">musiccast.0.WX-021_08F41523.main.power</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id=".^hwgeD3SS%yuIgq3HHh">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="comment" id="S!/F.R4NQ($!+?`{g@T]">
<field name="COMMENT">Musik Schlafen aus</field>
<next>
<block type="control" id="vQ@qgGlCe)=BTq@T9K:}">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">musiccast.0.WX-021_099AD703.main.power</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="6+Z,nCg5-)nn6gI{_@8g">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="comment" id="X/F|cQT7OyiZYpMv|]B5">
<field name="COMMENT">Musik Wohnen aus</field>
<next>
<block type="control" id="W|Rt7oo.3|oH^w0!k,s4">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">musiccast.0.RX-A1070_0DBCE863.main.power</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="*!ZR+#..TU2O:M(t;B0C">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
<value name="IF1">
<block type="logic_operation" id="9j9~v,f6!(,}q+Q*$I^Y" inline="false">
<field name="OP">OR</field>
<value name="A">
<block type="logic_compare" id="yQc]LA73DREAg:CUUgeF">
<field name="OP">EQ</field>
<comment pinned="false" h="45" w="156">Hier nog den wert Bewegung rein</comment>
<value name="A">
<block type="get_value" id="]9(]Mr5{wgk^3I{oD).W">
<field name="ATTR">val</field>
<field name="OID">fb-checkpresence.0.20X.presence</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="piG7SZk(j_`*quM(ymib">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="=z1Td#+.PHvptA$x#MXs">
<field name="OP">EQ</field>
<comment pinned="false" h="45" w="156">Hier nog den wert Bewegung rein</comment>
<value name="A">
<block type="get_value" id="C)H=2BO|7$hN_B+e0ugr">
<field name="ATTR">val</field>
<field name="OID">fb-checkpresence.0.M5.presence</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="J1=@.l`ymSn^g%@ikM[e">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO1">
<block type="timeouts_cleartimeout" id=")z?9E)5[hn+UK^pv+vSV">
<field name="NAME">timeout</field>
<next>
<block type="debug" id="6f,q7+JU^8=)`CSt8::D">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="Io/3fB99j[)f}a-$U0,:">
<field name="TEXT">stop timeout</field>
</shadow>
</value>
</block>
</next>
</block>
</statement>
<value name="IF2">
<block type="logic_compare" id="*Qz%1DHR/{E;Y(*yV?E]">
<field name="OP">EQ</field>
<comment pinned="false" h="45" w="156">Hier nog den wert Bewegung rein</comment>
<value name="A">
<block type="get_value" id="1WFT#RrLI)+qr`!4Z_c~">
<field name="ATTR">val</field>
<field name="OID">hue.0.Hauptschalter.buttonevent</field>
</block>
</value>
<value name="B">
<block type="math_number" id="mY.VoWP@nz|iLS48E^nh">
<field name="NUM">4002</field>
</block>
</value>
</block>
</value>
<statement name="DO2">
<block type="comment" id="UM-2M%vO%eN@t(m.6U$S">
<field name="COMMENT">Musik Bad aus</field>
<next>
<block type="control" id=",[XMJO8CWw-T`1{Ie56l">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">musiccast.0.WX-021_08F41523.main.power</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="z|Nvab]-u/}D?329=@tM">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="comment" id="$0B184mp5d;PKvXM?[nB">
<field name="COMMENT">Musik Schlafen aus</field>
<next>
<block type="control" id="2OiUZYXF4d1s_MkdZ/6s">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">musiccast.0.WX-021_099AD703.main.power</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="`7xz=JACuCY7#yP!)PIH">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="comment" id="^%vxK,e}6rDzVm*;O9KO">
<field name="COMMENT">Musik Wohnen aus</field>
<next>
<block type="control" id="hROs11nFkncFhjnv#.gB">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">musiccast.0.RX-A1070_0DBCE863.main.power</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="vScL7iHPDy^ApUmLqF*B">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</statement>
</block>
</xml>
Das Ziel sollte folgendes sein: Wenn P20.presence oder M5.presence false (also ausser Haus) sollen alle Multimediageräte abschalten. Damit die Multimediageräte nicht abgeschalten werden wenn nur kurz mal das WLAN von P20 oder M5 inaktiv ist und somit das auf false wechselt (bei Neustart von P20 oder M5 z.B.) soll das erst 2 Minuten verzögert passieren, aber nicht wenn innerhalb dieser 2 Minuten presence wieder auf true wechselt.
Der Hauptschalter soll, egal ob P20 und M5.presence true oder false sind, ohne Verzögerung abschalten.
Wo muss ich nun den Timeout und stop timeut setzen damit das so funktioniert?
Danke