Hallo, ich bin in sachen script schreiben vollkommen neu.
Mein Ziel:
Licht bei unterschreiten von 200 lux und erkannter Bewegung einschalten und falls keine Bewegung erkannt 5 min Später aus.
Kann da einer helfen? Hardware hab ich Schalter und Sensoren von Xiaomi und als Gateway einen ConBee II.
Mir fehlt sicher noch Übung.
Versucht hab ich mit folgendem:
<xml xmlns="https://developers.google.com/blockly/xml">
<block type="on_ext" id="J^V:?i(?I[76Y)f51U|I" x="-263" y="-362">
<mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="]$w0#p=ciU2rOBf2G]?a">
<field name="oid">default</field>
</shadow>
<block type="logic_compare" id="^_!,8bEk@r]*RH~#w`qr">
<field name="OP">LT</field>
<value name="A">
<block type="get_value" id="6,b;Ld,lC2ZZ~)WoP/2.">
<field name="ATTR">val</field>
<field name="OID">deconz.0.Sensors.27.lux</field>
</block>
</value>
<value name="B">
<block type="math_number" id="[KidI)n#+QBW_brL5p*f">
<field name="NUM">200</field>
</block>
</value>
</block>
</value>
<statement name="STATEMENT">
<block type="controls_if" id="1?0XbxLFe^.|ZA@WMWP7">
<mutation else="1"></mutation>
<value name="IF0">
<block type="logic_compare" id="q2[w$pyQY9Zc+nPS8T^d">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="nEpQZ;9Z)DVrl(6e-98/">
<field name="ATTR">val</field>
<field name="OID">deconz.0.Lights.11.on</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="*Q=:OGs_k5c(:X-p4#_a">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="control" id="*#Uh!TMj4SYlJw:^6|//">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">deconz.0.Lights.11.on</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="a]k.d=zbPyw49|1T@bN9">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</statement>
<statement name="ELSE">
<block type="control" id="`?FeP*D:dM,8m}XBd|7U">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
<field name="OID">deconz.0.Lights.11.on</field>
<field name="WITH_DELAY">TRUE</field>
<field name="DELAY_MS">20</field>
<field name="UNIT">sec</field>
<field name="CLEAR_RUNNING">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="qZ$IXjQ2NFg-xH!Dv[O+">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</statement>
</block>
</statement>
</block>
</xml>
MOD_Edit: Code in code-tags gesetzt!