Moin Zs & frohe Weihnachten 🙂
tolles Skript & super Idee!
Da ichs grad nachgebaut habe, hier der komplette Code zum kopieren:
<xml xmlns="http://www.w3.org/1999/xhtml"><block type="on_ext" id="6pd/xciykWrf#,/RkX%W" x="-1688" y="-963"><mutation items="1"></mutation>
<field name="CONDITION">true</field>
<value name="OID0"><shadow type="field_oid" id="jpxnz})h~8%*H1Tfe!G|"><field name="oid">zigbee.0.00158d00023f34e1.occupancy</field></shadow>
<block type="logic_operation" id=",MsXJd2F67!F=dtje9aq"><field name="OP">AND</field>
<value name="A"><block type="logic_compare" id="m72*Le8d:a7pB}+#oaJ3"><field name="OP">EQ</field>
<value name="A"><block type="get_value" id="}%d-3jEZm:=UcMSKgCo."><field name="ATTR">val</field>
<field name="OID">zigbee.0.00158d00023f34e1.occupancy</field></block></value>
<value name="B"><block type="logic_boolean" id="oTD8^~ndr6:Mb(v6,5I6"><field name="BOOL">TRUE</field></block></value></block></value>
<value name="B"><block type="time_compare_ex" id="+{@VLL|:gi~#k/j0pWk?"><mutation end_time="true" actual_time="true"></mutation>
<field name="USE_ACTUAL_TIME">TRUE</field>
<field name="OPTION">not between</field>
<value name="START_TIME"><shadow type="text" id="1[(WPy+={:AiX{b?hvgd"><field name="TEXT">12:00</field></shadow>
<block type="time_astro" id="J!|CySOfjSiq5M,hi^%d"><field name="TYPE">sunrise</field>
<field name="OFFSET">0</field></block></value>
<value name="END_TIME"><shadow type="text" id="`QEn)Bq-kHk`*tVUG,Z5"><field name="TEXT">18:00</field></shadow>
<block type="time_astro" id="hZc00OWZ6qAf~16x;92@"><field name="TYPE">sunset</field>
<field name="OFFSET">0</field></block></value></block></value></block></value>
<statement name="STATEMENT"><block type="controls_if" id="}[l(7.}CP@g:G9x6aFEg"><value name="IF0"><block type="logic_compare" id="VPjAhD]`.0]1lK5lJvU+"><field name="OP">EQ</field>
<value name="A"><block type="variables_get" id="DrWHe%XUh9Nnk,`aaY{)"><field name="VAR">Kueche_Licht_manuell</field></block></value>
<value name="B"><block type="logic_boolean" id="x9cCshY.w:Ws/^-3T}FR"><field name="BOOL">FALSE</field></block></value></block></value>
<statement name="DO0"><block type="procedures_callnoreturn" id="Tb|#Q@!7T;z#n{0gefM="><mutation name="LeuchteSchalten"><arg name="x"></arg></mutation>
<value name="ARG0"><block type="logic_boolean" id="(F;{6ygml~3cw22**5rd"><field name="BOOL">TRUE</field></block></value>
<next><block type="timeouts_settimeout" id="II3lv;mVPw+j|5f9,Ts6"><field name="NAME">timeout</field>
<field name="DELAY">120000</field>
<field name="UNIT">ms</field>
<statement name="STATEMENT"><block type="controls_if" id="^Yh#3=Q:c|bL2yV6Y3,|"><value name="IF0"><block type="logic_compare" id="=|;WdiP;`t}~_NPS~ppj"><field name="OP">EQ</field>
<value name="A"><block type="variables_get" id="jK25Gn0s*5#}O,88ki`T"><field name="VAR">Kueche_Licht_manuell</field></block></value>
<value name="B"><block type="logic_boolean" id="{WLO|B20tt!=Kv{^v4d}"><field name="BOOL">FALSE</field></block></value></block></value>
<statement name="DO0"><block type="procedures_callnoreturn" id="C|gBFV;|H0G0kiX.sos%"><mutation name="LeuchteSchalten"><arg name="x"></arg></mutation>
<value name="ARG0"><block type="logic_boolean" id="Op97M]g;p!(?2qX{5Zmu"><field name="BOOL">FALSE</field></block></value></block></statement></block></statement></block></next></block></statement></block></statement></block>
<block type="variables_set" id="4`Ix7sE|REGj#F`.Iv|h" x="-1088" y="-888"><field name="VAR">Kueche_Licht_manuell</field>
<value name="VALUE"><block type="logic_boolean" id="o+p;z5wf,^W~ybsF)Jyt"><field name="BOOL">FALSE</field></block></value></block>
<block type="on_ext" id="y;21U{a(QUd~zbz7P4=n" x="-1062" y="-838"><mutation items="1"></mutation>
<field name="CONDITION">true</field>
<value name="OID0"><shadow type="field_oid" id="Ig[)B3B`(*w;p5_9,(K["><field name="oid">sonoff.0.Küchenlicht.POWER</field></shadow></value>
<statement name="STATEMENT"><block type="variables_set" id="[0vqh:][W%?un-`kB%3d"><field name="VAR">Kueche_Licht_manuell</field>
<value name="VALUE"><block type="logic_negate" id="z6r+!7{eC?2{e8Ak@Bax"><value name="BOOL"><block type="variables_get" id="ikrlXZk_+?(UvBLj}o}f"><field name="VAR">Kueche_Licht_manuell</field></block></value></block></value>
<next><block type="controls_if" id="oQ/8VZ_VR8W3=a*Cz1/a"><mutation else="1"></mutation>
<value name="IF0"><block type="logic_compare" id="l-Kq.C,:NZ})Mo7?88gx"><field name="OP">EQ</field>
<value name="A"><block type="variables_get" id="P_b9AhEv|DUNbUCnD~V9"><field name="VAR">Kueche_Licht_manuell</field></block></value>
<value name="B"><block type="logic_boolean" id="+q53(0dE^F4YZ(6,UFdG"><field name="BOOL">TRUE</field></block></value></block></value>
<statement name="DO0"><block type="procedures_callnoreturn" id="S_+q~E~?i8y*R1Ybo9bY"><mutation name="LeuchteSchalten"><arg name="x"></arg></mutation>
<value name="ARG0"><block type="logic_boolean" id="^6|UBhjwwQs0JEwBJx8]"><field name="BOOL">TRUE</field></block></value></block></statement>
<statement name="ELSE"><block type="procedures_callnoreturn" id="AV}Jzk[*c?bs@.y)_9Z^"><mutation name="LeuchteSchalten"><arg name="x"></arg></mutation>
<value name="ARG0"><block type="logic_boolean" id="_T5.%nC.;76l:NEc(m%x"><field name="BOOL">FALSE</field></block></value></block></statement></block></next></block></statement></block>
<block type="procedures_defnoreturn" id="-Ts^et}f~sjE_@F_b@Zr" x="-1738" y="-562"><mutation><arg name="x"></arg></mutation>
<field name="NAME">LeuchteSchalten</field>
<comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
<statement name="STACK"><block type="comment" id="*6FI2{TA*|L*sW+,L(}?"><field name="COMMENT">Funktion Leuchte ein- oder ausschalten</field>
<next><block type="controls_if" id="9?aGD0/BVm_Gr=?2ms+r"><value name="IF0"><block type="logic_compare" id="Yv]yu9}8NM]KwDy7Dkc5"><field name="OP">NEQ</field>
<value name="A"><block type="get_value" id="7DWzNGXN52r-5ejij|N%"><field name="ATTR">val</field>
<field name="OID">sonoff.0.Küchenlicht.POWER</field></block></value>
<value name="B"><block type="variables_get" id="WOJ,=X],[ZWF1cE5o.B#"><field name="VAR">x</field></block></value></block></value>
<statement name="DO0"><block type="control" id="*B4#g]93@QAUExJcA+k4"><mutation delay_input="false"></mutation>
<field name="OID">sonoff.0.Küchenlicht.POWER</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE"><block type="variables_get" id="L}Bsm|]1G@6~G)e^!?(i"><field name="VAR">x</field></block></value></block></statement></block></next></block></statement></block></xml>
Ich habe lediglich noch eine Funktion für Dunkelheit eingefügt da mein Bewegungsmelder (Occupancy) nur triggern soll wenn es Dämmert und bis es hell wird und die Zeit auf 2 Min. geändert.