Sehr cool das endlich jemand einen Adapter dafür baut!! Ich hab ewig an meinem Bewegungsmelder Script getüftelt bis es halbwegs lief und ich freu mich darauf deinen Adapter zu testen.
Ich hänge dir mal meine Blockly Funktion dafür an. Vielleicht gibt das ja noch Inspirationen dafür.
Grundsätzlich habe ich folgendes drin:
- Globaler DP "AutoLight" falls "false" wird kein Licht mehr automatisch geschaltet
- Globaler DP "NightLightMode" falls "true" wird nicht geschaltet oder ein anderes Lichtszenario
- Globaler DP "AtHome" falls "false" Alle Lichter ausschalten
- Globaler DP LuxLimit Grenzwert für schalten von Licht
- Je Raum gibt es weitere weitere Einstellungen (Schaltzeit, IgnoreNightMode,KeepOn (if true), KeepOff (if true), ExtraOffSwitches (Geräte zusätzlich abgeschaltet werden aber keinen Trigger für ON haben), LuxLimit (individuell)
- Funktion für das Schalten verschiedener Lichter in dem Raum je nach Bedingung.
- Debug Ausgabe
Was mir bei Blockly am Anfang sehr viele Probleme gemacht hat war, dass die Verwendung von Timeouts in einer Funktion beim Aufruf von mehreren Räumen überschrieben werden. Das habe ich letztendlich mit einem Timer gelöst, der an den DP gehängt wird und beim neu schreiben gelöscht wird.
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="xjjCO3x]~#p7S0:#%i0_">switches</variable>
<variable id="N=.oocr,|f!EjH[T#m4W">TurnON</variable>
<variable id=".vDs7L59v=fy*rrUz[gY">OFFTime</variable>
<variable id="IX/gU^R_Zpb]{vD5A]Sn">RoomName</variable>
<variable id="@Bz823N{#FDtr?!utT_^">pir_01</variable>
<variable id="0I[}CDRB#1t;RiBC2c!N">pir_02</variable>
<variable id=",RO*rmH)Gb7=:?$7ny,.">pir_lux_01</variable>
<variable id="vS_F0r}]%+GePgY3vks8">pir_lux_02</variable>
<variable id="l;ilJ`6Z6%G5EJ2clI_)">pir_lux_limit</variable>
<variable id="v5r*F/J_D*#a2B^L/XDs">extraOFFswitches</variable>
<variable id="VpvRaw-o{?h#_.0;LXn;">KeepOn</variable>
<variable id="dt+.dW.Wy09/+7%X.I|+">KeepOff</variable>
<variable id="(5n|JY/|pl^WYG41i],:">IgnoreNightMode</variable>
<variable id="#DF~YDx#7HA~2_~c}$P?">switch</variable>
<variable id=":#q3xGH!O9R*~b!?qxmd">counter</variable>
<variable id="UFl:*B!P.|vFu=[uU3T/">return</variable>
<variable id="q-]g;q9Z=eMBOK-}p/L`">wz_select_return</variable>
<variable id="Z}*@ZQ],86inGv;ML!G/">GlobalLuxLimit</variable>
</variables>
<block type="procedures_defreturn" id="ME|_L*VJRiX!B)!0O7?j" x="13" y="13">
<field name="NAME">wz_select_device</field>
<comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
<statement name="STACK">
<block type="controls_if" id="l@l1b(]$~rI~T]PtFCck">
<mutation elseif="1" else="1"></mutation>
<value name="IF0">
<block type="logic_operation" id="cs-2Q(5s^2mYurlgJ%IE" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="logic_operation" id="b02ov67EMjyk~?LmK[TG" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="logic_operation" id="Acq#6xiNAjQ76BM%;-8%" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="ix3U/jZb=T(ku}juSZnR">
<field name="OP">GTE</field>
<value name="A">
<block type="time_get" id=".5N6%Z#/3hY=:$B|~NaO">
<mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
<field name="OPTION">wd</field>
</block>
</value>
<value name="B">
<block type="math_number" id="pDE#FhTH~mt`S[0zb_||">
<field name="NUM">6</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="w/-BADhf0d5cMO.$wH^q">
<field name="OP">LTE</field>
<value name="A">
<block type="time_get" id="~Jq=3I?Is=1)GJd17c+q">
<mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
<field name="OPTION">wd</field>
</block>
</value>
<value name="B">
<block type="math_number" id="#v}=gS`Y]=O%]cz#G#jc">
<field name="NUM">7</field>
</block>
</value>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_operation" id="ULgxMsVMe_]tA]Fsly[$" inline="false">
<field name="OP">OR</field>
<value name="A">
<block type="time_compare" id="0!GQRrVZYt:T:lTJyJgl">
<mutation xmlns="http://www.w3.org/1999/xhtml" end_time="true"></mutation>
<field name="OPTION">between</field>
<field name="START_TIME">12:00</field>
<field name="END_TIME">14:00</field>
</block>
</value>
<value name="B">
<block type="time_compare" id="aQEM|C(l^s7,5JV@`^B;">
<mutation xmlns="http://www.w3.org/1999/xhtml" end_time="true"></mutation>
<field name="OPTION">between</field>
<field name="START_TIME">18:00</field>
<field name="END_TIME">20:00</field>
</block>
</value>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_negate" id="[I6Mx+jpR[AKmmmXoxWv">
<value name="BOOL">
<block type="get_value_var" id="l@za~3?OhxT$Fo#=c)Wx">
<field name="ATTR">val</field>
<value name="OID">
<shadow type="text">
<field name="TEXT"></field>
</shadow>
<block type="field_oid" id="DqdZ(z^Eu3wpe1!CoGSA">
<field name="oid">0_userdata.0.GlobalVars.Wohnzimmer_TV</field>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="variables_set" id="|o-y%I+j~uij@H,-{AdA">
<field name="VAR" id="q-]g;q9Z=eMBOK-}p/L`">wz_select_return</field>
<value name="VALUE">
<block type="lists_create_with" id="r`WR05*_(l~!0%}P8dyO">
<mutation items="1"></mutation>
<value name="ADD0">
<block type="field_oid" id="p?t*.kHQgbbg-P1}L:],">
<field name="oid">scene.0.Szene_wohnzimmer-essen</field>
</block>
</value>
</block>
</value>
<next>
<block type="debug" id=":a:ZL|ZKs-wm8Q;T^M%?">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="M;/vC3q?i$VcB0{[N#_A">
<field name="TEXT">wz essen</field>
</shadow>
</value>
</block>
</next>
</block>
</statement>
<value name="IF1">
<block type="logic_operation" id="_k0k~kNq2Ce,UYgh;mqi" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="get_value_var" id="(pebLF9+cQ7,^ifb==,6">
<field name="ATTR">val</field>
<value name="OID">
<shadow type="text" id="U/S$)3xsk-3;8#~.*hJ2">
<field name="TEXT"></field>
</shadow>
<block type="field_oid" id="=a4%;97[zTAEkm+ujijj">
<field name="oid">0_userdata.0.GlobalVars.Wohnzimmer_TV</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="time_compare" id="Jp4c.~(5PKa:]iIs#QLk">
<mutation xmlns="http://www.w3.org/1999/xhtml" end_time="true"></mutation>
<field name="OPTION">between</field>
<field name="START_TIME">18:00</field>
<field name="END_TIME">00:30</field>
</block>
</value>
</block>
</value>
<statement name="DO1">
<block type="variables_set" id="L@}i_6o.rb2dA0Mh9zVP">
<field name="VAR" id="q-]g;q9Z=eMBOK-}p/L`">wz_select_return</field>
<value name="VALUE">
<block type="lists_create_with" id="qwZKDCG9dtX!Y[CfqU`x">
<mutation items="1"></mutation>
<value name="ADD0">
<block type="field_oid" id="Mk^tguqoO%!UdMC_uaO-">
<field name="oid">scene.0.Szene_wohnzimmer-gemuetlich</field>
</block>
</value>
</block>
</value>
<next>
<block type="debug" id="2Xc+Q8zQ*KyLt{LGbHM!">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="Doe2PlebWaPQx`@}YqiF">
<field name="TEXT">wz gemütlich</field>
</shadow>
</value>
</block>
</next>
</block>
</statement>
<statement name="ELSE">
<block type="variables_set" id="USp?u8vp6Mfq;65wHEz6">
<field name="VAR" id="q-]g;q9Z=eMBOK-}p/L`">wz_select_return</field>
<value name="VALUE">
<block type="lists_create_with" id="ke72Y:uae96cIQ6VA#$G">
<mutation items="1"></mutation>
<value name="ADD0">
<block type="field_oid" id="4+{(idsPPS`v${5x;K?O">
<field name="oid">scene.0.Szene_pir-wohnzimmer</field>
</block>
</value>
</block>
</value>
<next>
<block type="debug" id="M%)Ez?.pywI6}bbth`Vx">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="x((%Rv2R;44c_sv`g2nS">
<field name="TEXT">wz pir</field>
</shadow>
</value>
</block>
</next>
</block>
</statement>
</block>
</statement>
<value name="RETURN">
<block type="variables_get" id="WmE)4):S{xnzH$T+yOSQ">
<field name="VAR" id="q-]g;q9Z=eMBOK-}p/L`">wz_select_return</field>
</block>
</value>
</block>
<block type="procedures_defreturn" id="Uq+c:7kOmR1R|/)C-~iW" x="13" y="588">
<mutation>
<arg name="RoomName" varid="IX/gU^R_Zpb]{vD5A]Sn"></arg>
<arg name="pir_01" varid="@Bz823N{#FDtr?!utT_^"></arg>
<arg name="pir_02" varid="0I[}CDRB#1t;RiBC2c!N"></arg>
<arg name="pir_lux_01" varid=",RO*rmH)Gb7=:?$7ny,."></arg>
<arg name="pir_lux_02" varid="vS_F0r}]%+GePgY3vks8"></arg>
<arg name="pir_lux_limit" varid="l;ilJ`6Z6%G5EJ2clI_)"></arg>
<arg name="switches" varid="xjjCO3x]~#p7S0:#%i0_"></arg>
<arg name="extraOFFswitches" varid="v5r*F/J_D*#a2B^L/XDs"></arg>
<arg name="OFFTime" varid=".vDs7L59v=fy*rrUz[gY"></arg>
<arg name="KeepOn" varid="VpvRaw-o{?h#_.0;LXn;"></arg>
<arg name="KeepOff" varid="dt+.dW.Wy09/+7%X.I|+"></arg>
<arg name="IgnoreNightMode" varid="(5n|JY/|pl^WYG41i],:"></arg>
</mutation>
<field name="NAME">PIROnOff</field>
<comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
<statement name="STACK">
<block type="controls_if" id="[O7.(Z@={-u+:!D79Gz%">
<value name="IF0">
<block type="logic_compare" id="jlr_x$?NA^WZomQtcw#5">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="F=+u75K9%VDi8G/n|D8k">
<field name="VAR" id="0I[}CDRB#1t;RiBC2c!N">pir_02</field>
</block>
</value>
<value name="B">
<block type="logic_null" id="Sh,:KvsF[rusl~@}EMqY"></block>
</value>
</block>
</value>
<statement name="DO0">
<block type="variables_set" id="whX@Da6CE@|naMUw;N8~">
<field name="VAR" id="0I[}CDRB#1t;RiBC2c!N">pir_02</field>
<value name="VALUE">
<block type="variables_get" id="6rDG8,DskG60`#/v/8mv">
<field name="VAR" id="@Bz823N{#FDtr?!utT_^">pir_01</field>
</block>
</value>
</block>
</statement>
<next>
<block type="controls_if" id="I[hD8l1p/IA;zpe?h|UC">
<value name="IF0">
<block type="logic_compare" id="~)koIzn#%8#nG.hQ2r4w">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id=",|L(K7dZVR%t;!_rN$Lh">
<field name="VAR" id="vS_F0r}]%+GePgY3vks8">pir_lux_02</field>
</block>
</value>
<value name="B">
<block type="logic_null" id="W%bpS%eSC]264c{ywR]f"></block>
</value>
</block>
</value>
<statement name="DO0">
<block type="variables_set" id="U[5P1LV5cgm)K(sdn+T)">
<field name="VAR" id="vS_F0r}]%+GePgY3vks8">pir_lux_02</field>
<value name="VALUE">
<block type="variables_get" id="S=$NF3KdW#f|mCa_Is.$">
<field name="VAR" id=",RO*rmH)Gb7=:?$7ny,.">pir_lux_01</field>
</block>
</value>
</block>
</statement>
<next>
<block type="debug" id="13({Y~ad[1lz?(?.I:8s">
<field name="Severity">log</field>
<value name="TEXT">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="jJ`TpoG`qlcAh?|:PC!V">
<field name="TEXT">etwas erkannt</field>
</shadow>
<block type="text_join" id="zzz|U{L6aADQM6wC=`Dw">
<mutation items="8"></mutation>
<value name="ADD0">
<block type="text" id="FpG~%IV|WdP}+zffCI-w">
<field name="TEXT">PIR: </field>
</block>
</value>
<value name="ADD1">
<block type="variables_get" id="8~Do34ZHjM/ehND*@x}H">
<field name="VAR" id="@Bz823N{#FDtr?!utT_^">pir_01</field>
</block>
</value>
<value name="ADD2">
<block type="text" id="UQ6$1$e!x0vW2VMG$^%n">
<field name="TEXT"> hat Wert - </field>
</block>
</value>
<value name="ADD3">
<block type="get_value_var" id="aM`8)xK*ukDYKs(Q^iD[">
<field name="ATTR">val</field>
<value name="OID">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="{aui]%Z@m*m=!^M`#XS9">
<field name="TEXT"></field>
</shadow>
<block type="variables_get" id="ozTuQEY[4$%5^%RXh-@g">
<field name="VAR" id="@Bz823N{#FDtr?!utT_^">pir_01</field>
</block>
</value>
</block>
</value>
<value name="ADD4">
<block type="text" id="h^0tVD{s|6(nm~@3uSfO">
<field name="TEXT"> - </field>
</block>
</value>
<value name="ADD5">
<block type="variables_get" id="2k{1r:Z$*Jk{fQYZ0hvv">
<field name="VAR" id="0I[}CDRB#1t;RiBC2c!N">pir_02</field>
</block>
</value>
<value name="ADD6">
<block type="text" id=".8YO}6ABP*HDMGU^1$,P">
<field name="TEXT"> hat Wert - </field>
</block>
</value>
<value name="ADD7">
<block type="get_value_var" id="3IIJGJ3XEK8fV0.c_0Vl">
<field name="ATTR">val</field>
<value name="OID">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="{aui]%Z@m*m=!^M`#XS9">
<field name="TEXT"></field>
</shadow>
<block type="variables_get" id="PeBl3q,Yiuq6kwlkcJS`">
<field name="VAR" id="0I[}CDRB#1t;RiBC2c!N">pir_02</field>
</block>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="debug" id="m$k.v~~pRKsfF#2rGjXW">
<field name="Severity">log</field>
<value name="TEXT">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="jJ`TpoG`qlcAh?|:PC!V">
<field name="TEXT">etwas erkannt</field>
</shadow>
<block type="text_join" id="A.Yww;)O(D?h8Sr4CUO8">
<mutation items="8"></mutation>
<value name="ADD0">
<block type="text" id="6Js:%RU{%E1rE0ie3O=Y">
<field name="TEXT">PIR_LUX: </field>
</block>
</value>
<value name="ADD1">
<block type="variables_get" id="8pcxW~%+x5HIJ5:kQD_X">
<field name="VAR" id=",RO*rmH)Gb7=:?$7ny,.">pir_lux_01</field>
</block>
</value>
<value name="ADD2">
<block type="text" id="y:)7;uyP|i,=qBJ?/940">
<field name="TEXT"> hat Wert - </field>
</block>
</value>
<value name="ADD3">
<block type="get_value_var" id="?jc{.no|7@Ox}M*3Yiy=">
<field name="ATTR">val</field>
<value name="OID">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="{aui]%Z@m*m=!^M`#XS9">
<field name="TEXT"></field>
</shadow>
<block type="variables_get" id="AB#BN4sUMf1_zVuW(5AD">
<field name="VAR" id=",RO*rmH)Gb7=:?$7ny,.">pir_lux_01</field>
</block>
</value>
</block>
</value>
<value name="ADD4">
<block type="text" id="zLrVDg5V7`Jy|NUNf`89">
<field name="TEXT"> - </field>
</block>
</value>
<value name="ADD5">
<block type="variables_get" id="RYUXo|IpuVD31K6d}E)(">
<field name="VAR" id="vS_F0r}]%+GePgY3vks8">pir_lux_02</field>
</block>
</value>
<value name="ADD6">
<block type="text" id="E(roxUb_{AJQE1[!k~Or">
<field name="TEXT"> hat Wert - </field>
</block>
</value>
<value name="ADD7">
<block type="get_value_var" id="|{-zrh)6pw7)U2flh#WT">
<field name="ATTR">val</field>
<value name="OID">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="{aui]%Z@m*m=!^M`#XS9">
<field name="TEXT"></field>
</shadow>
<block type="variables_get" id="249q+VQJ1tc`_z|^QKw$">
<field name="VAR" id="vS_F0r}]%+GePgY3vks8">pir_lux_02</field>
</block>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="controls_if" id="Uv[/#yCo:db^kgX|;k#H">
<mutation else="1"></mutation>
<value name="IF0">
<block type="logic_compare" id="6FH^Rk2p_]%Y2(K/PyPd">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="?!x8nVCyZfBkPYEG~Az?">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.GlobalVars.AutoLight</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="mZ;i7U3C#%kFJmTC+jkZ">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="controls_if" id="09?,,2EP+_g3qIdzKQ9!">
<mutation elseif="1" else="1"></mutation>
<value name="IF0">
<block type="logic_operation" id="zuG2C2rk:;Za}.Lrj-pi" inline="false">
<field name="OP">OR</field>
<value name="A">
<block type="logic_compare" id=")O-7|;y09npok-y_s;xi">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value_var" id="[Kk:Cgtf21QQI591Ga/Z">
<field name="ATTR">val</field>
<value name="OID">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="l!pgo+GlmzwwC]_HI91`">
<field name="TEXT"></field>
</shadow>
<block type="variables_get" id="!|RO+tg}lwGLL-Pej?4p">
<field name="VAR" id="@Bz823N{#FDtr?!utT_^">pir_01</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="s=N^7s!QM8EZ!(mqVN|p">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="-!zo65PRFGd6$*tak9@2">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value_var" id="SN;`|g13#K`Jza}JAJ[D">
<field name="ATTR">val</field>
<value name="OID">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="l!pgo+GlmzwwC]_HI91`">
<field name="TEXT"></field>
</shadow>
<block type="variables_get" id="FD5QuQkT/qYQlMe*NKaZ">
<field name="VAR" id="0I[}CDRB#1t;RiBC2c!N">pir_02</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="A]D?RX],u~M!S5N%S:N{">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="controls_if" id=";UN%Cl)(@D=Y,KA}2Nmv">
<mutation else="1"></mutation>
<value name="IF0">
<block type="logic_operation" id="GjUv+]z0Msa=Pi4,I:oV" inline="false">
<field name="OP">OR</field>
<value name="A">
<block type="logic_compare" id="+yk,-(9trX?JsdI[AT|:">
<field name="OP">LTE</field>
<value name="A">
<block type="get_value_var" id="OXD;U1Q;-9Q7.!Djz`D;">
<field name="ATTR">val</field>
<value name="OID">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="l!pgo+GlmzwwC]_HI91`">
<field name="TEXT"></field>
</shadow>
<block type="variables_get" id="SXXoJ_W7}7hHfR6dtN:O">
<field name="VAR" id=",RO*rmH)Gb7=:?$7ny,.">pir_lux_01</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="variables_get" id="#WWg!0nb[;hd2BjXuxyU">
<field name="VAR" id="l;ilJ`6Z6%G5EJ2clI_)">pir_lux_limit</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="eTUQ*ww|/ed@9;S%s}-j">
<field name="OP">LTE</field>
<value name="A">
<block type="get_value_var" id="YK(7;gzM6dVPS:A73yEM">
<field name="ATTR">val</field>
<value name="OID">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="l!pgo+GlmzwwC]_HI91`">
<field name="TEXT"></field>
</shadow>
<block type="variables_get" id="7m_{g`_/[MXWAl-`DC#.">
<field name="VAR" id="vS_F0r}]%+GePgY3vks8">pir_lux_02</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="variables_get" id="0%tca!9u76jk}{6-?%gU">
<field name="VAR" id="l;ilJ`6Z6%G5EJ2clI_)">pir_lux_limit</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="controls_if" id="my:jHuH-uZ[heLt5odjN">
<mutation else="1"></mutation>
<value name="IF0">
<block type="logic_operation" id="2@Oub9,o`$uLYKd#ike;" inline="false">
<field name="OP">OR</field>
<value name="A">
<block type="logic_compare" id="fDk/.),o=!;r%8}@Oj((">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="MLk5m2`)K$Ln,8X1nzY,">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.GlobalVars.NightLightMode</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="QU=Z,j)pD7B2@NT8DZT3">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="|DV~^IlJv:Ox0YnUc(BZ">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="/4K81(B*=/]_T^fFEX!p">
<field name="VAR" id="(5n|JY/|pl^WYG41i],:">IgnoreNightMode</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="vhBU1H5MlSZkTK|)_(M4">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="controls_if" id="bd`D]$NJk`XfFoJR)D(9">
<mutation else="1"></mutation>
<value name="IF0">
<block type="logic_compare" id="foMR6tBoUz!~0uvQ!h)/">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="c{KA+=Oqc=kiOQpE$h^b">
<field name="VAR" id="dt+.dW.Wy09/+7%X.I|+">KeepOff</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="F8Y;KnErl}VAcHtBaqV*">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="debug" id="{XM_Z[.V#$`fKe=q6]pi">
<field name="Severity">log</field>
<value name="TEXT">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="g1ueDh_2oKR+gkXL:9pO">
<field name="TEXT">Schalte Licht AN</field>
</shadow>
<block type="procedures_callreturn" id="OT^6G[h;^:Iaf!H3(sI(">
<mutation name="SetSwitchlist">
<arg name="switches"></arg>
<arg name="TurnON"></arg>
<arg name="OFFTime"></arg>
</mutation>
<value name="ARG0">
<block type="variables_get" id="j]:ZsWiNYrm{qG~5`8FR">
<field name="VAR" id="xjjCO3x]~#p7S0:#%i0_">switches</field>
</block>
</value>
<value name="ARG1">
<block type="logic_boolean" id="Xm$Z%t5Txvj2h*3@(z/d">
<field name="BOOL">TRUE</field>
</block>
</value>
<value name="ARG2">
<block type="math_number" id="rM2-%6M0Aws#{Yq}[fW#">
<field name="NUM">0</field>
</block>
</value>
</block>
</value>
</block>
</statement>
<statement name="ELSE">
<block type="debug" id="KGn4QdU`T-)yKwG+iNN^">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="Mie1Y-G5Qe_DU9A]RORD">
<field name="TEXT">KeepOff aktiv</field>
</shadow>
</value>
</block>
</statement>
</block>
</statement>
<statement name="ELSE">
<block type="debug" id="$[}zC!R!}1DzHgyjg]7Y">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="oj7c6l7Jo.9P?{BQn]bz">
<field name="TEXT">NightMode ist aktiviert</field>
</shadow>
</value>
</block>
</statement>
</block>
</statement>
<statement name="ELSE">
<block type="debug" id=",Ym^I`tBP[(f/~}UUyvZ">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="5p]hJo6He4uf],!kf/f1">
<field name="TEXT">Lux-Limit nicht erreicht</field>
</shadow>
</value>
</block>
</statement>
</block>
</statement>
<value name="IF1">
<block type="logic_operation" id="Y9HcpuFnRwAcU+DRYnzs" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="}fhd$Qugm+Y_NZAUow?L">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value_var" id="EA}#b?R`A;Z9O]1ifL/U">
<field name="ATTR">val</field>
<value name="OID">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="..N%+1lwIwm=r.aG-acQ">
<field name="TEXT"></field>
</shadow>
<block type="variables_get" id="w,;R}@a)@_pkf$S(4pL!">
<field name="VAR" id="@Bz823N{#FDtr?!utT_^">pir_01</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="B04@`]HK4baj1{WnXJ@R">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="Aj1mhM#}c4:VCVxv`wf!">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value_var" id="77)-SO(|n.sYV?!*uk-v">
<field name="ATTR">val</field>
<value name="OID">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="..N%+1lwIwm=r.aG-acQ">
<field name="TEXT"></field>
</shadow>
<block type="variables_get" id="wWyw1M_Qu-i{]+ZB1:y2">
<field name="VAR" id="0I[}CDRB#1t;RiBC2c!N">pir_02</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="B1cUqzunb:@p4kyyFAQc">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO1">
<block type="controls_if" id="gP1*@4yos%O0lP;b}pNB">
<mutation else="1"></mutation>
<value name="IF0">
<block type="logic_compare" id="%6q}y6+`0U.pq2g#.2]d">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="veC@9j2mM%s%VV6699[[">
<field name="VAR" id="VpvRaw-o{?h#_.0;LXn;">KeepOn</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="/O~8zybjznA@dt-c@aOL">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="debug" id="K_%4zoRRL,YF:}lvWA=P">
<field name="Severity">log</field>
<value name="TEXT">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="EEDPy`ac^p!TSLb$aq::">
<field name="TEXT">warte einen moment bis aus</field>
</shadow>
<block type="text_join" id="D;c]Ryf7si+PeeL0=!N^">
<mutation items="3"></mutation>
<value name="ADD0">
<block type="text" id="Z/70*s;axS=/Id:=X^q8">
<field name="TEXT">Warte </field>
</block>
</value>
<value name="ADD1">
<block type="variables_get" id="O4TW=,f+N0AaVd*MiNvO">
<field name="VAR" id=".vDs7L59v=fy*rrUz[gY">OFFTime</field>
</block>
</value>
<value name="ADD2">
<block type="text" id="wiGGDqtwX]z#pXf%mdvW">
<field name="TEXT"> Minuten bis OFF</field>
</block>
</value>
</block>
</value>
<next>
<block type="debug" id="15rPv#n#;3jitxTUDEIT">
<field name="Severity">log</field>
<value name="TEXT">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="g1ueDh_2oKR+gkXL:9pO">
<field name="TEXT">Schalte Licht AN</field>
</shadow>
<block type="procedures_callreturn" id="*k?WNwCJ0aPyUlzN#a+w">
<mutation name="SetSwitchlist">
<arg name="switches"></arg>
<arg name="TurnON"></arg>
<arg name="OFFTime"></arg>
</mutation>
<value name="ARG0">
<block type="variables_get" id="ZX.1a@SjH4vzl@:UEBd4">
<field name="VAR" id="xjjCO3x]~#p7S0:#%i0_">switches</field>
</block>
</value>
<value name="ARG1">
<block type="logic_boolean" id="7iFP3(LXB6rzjk!lsYqP">
<field name="BOOL">FALSE</field>
</block>
</value>
<value name="ARG2">
<block type="variables_get" id="|_#g|ZY2ShK[%eT-/nR8">
<field name="VAR" id=".vDs7L59v=fy*rrUz[gY">OFFTime</field>
</block>
</value>
</block>
</value>
<next>
<block type="debug" id="!xYW,+B]Db9[aIwPo,C!">
<field name="Severity">log</field>
<value name="TEXT">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="g1ueDh_2oKR+gkXL:9pO">
<field name="TEXT">Schalte Licht AN</field>
</shadow>
<block type="procedures_callreturn" id="/fW6EVniBm487}BR6x$N">
<mutation name="SetSwitchlist">
<arg name="switches"></arg>
<arg name="TurnON"></arg>
<arg name="OFFTime"></arg>
</mutation>
<value name="ARG0">
<block type="variables_get" id="dWrb*+`1}G$e|Dtk}lSg">
<field name="VAR" id="v5r*F/J_D*#a2B^L/XDs">extraOFFswitches</field>
</block>
</value>
<value name="ARG1">
<block type="logic_boolean" id="?Q]jg}0S{r1=6qR?QVBy">
<field name="BOOL">FALSE</field>
</block>
</value>
<value name="ARG2">
<block type="variables_get" id="ZHEfb=L^*DR$G~S,aaUU">
<field name="VAR" id=".vDs7L59v=fy*rrUz[gY">OFFTime</field>
</block>
</value>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</statement>
<statement name="ELSE">
<block type="debug" id="RoF6h7sWR!@iX!pzB:PJ">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="e)Z3x84fp]xeIVE$kQyL">
<field name="TEXT">KeepOn aktiv</field>
</shadow>
</value>
</block>
</statement>
</block>
</statement>
<statement name="ELSE">
<block type="debug" id="YqWeRdU|(Tbc6l?nx)rT">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="7R:0S=+L;a~6g,e@izq.">
<field name="TEXT">Diese Ausgabe sollte nie kommen</field>
</shadow>
</value>
<next>
<block type="debug" id="AcmL]1^kiJ?y63QM+{WT" collapsed="true" disabled="true">
<field name="Severity">warn</field>
<value name="TEXT">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="i1Fbtc$Ax`kx:je)u(z?">
<field name="TEXT">test</field>
</shadow>
<block type="text_join" id="rpCEJ)?!!49X)k0/*i/!">
<mutation items="19"></mutation>
<value name="ADD0">
<block type="variables_get" id="c,qbd7Q(nCTXLaHb4OU%">
<field name="VAR" id="IX/gU^R_Zpb]{vD5A]Sn">RoomName</field>
</block>
</value>
<value name="ADD1">
<block type="text_newline" id="%Ik4z(5$X/?J+jQubsu4">
<field name="Type">\n</field>
</block>
</value>
<value name="ADD2">
<block type="text_join" id="2XGYG631?#H6eU%]_CR*">
<mutation items="2"></mutation>
<value name="ADD0">
<block type="text" id="hG7Wb)xULJV+|Lg0of%r">
<field name="TEXT">pir1: </field>
</block>
</value>
<value name="ADD1">
<block type="get_value_var" id=":[^;#--,=6lsmqN5syA7">
<field name="ATTR">val</field>
<value name="OID">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="KWLPWGd)pP|x?)+`Fpf]">
<field name="TEXT"></field>
</shadow>
<block type="variables_get" id="6+zw,fJ7?_~ju*Z;%of@">
<field name="VAR" id="@Bz823N{#FDtr?!utT_^">pir_01</field>
</block>
</value>
</block>
</value>
</block>
</value>
<value name="ADD3">
<block type="text_newline" id="I=LXvd%[2Pk6i/X[u;0*">
<field name="Type">\n</field>
</block>
</value>
<value name="ADD4">
<block type="text_join" id="c{QG4zZ?l~4*1^wok/pQ">
<mutation items="2"></mutation>
<value name="ADD0">
<block type="text" id="M{GSL,`(~}pQ#2U67wOa">
<field name="TEXT">pir2: </field>
</block>
</value>
<value name="ADD1">
<block type="get_value_var" id=")!UYW.hyznN:gQ;SdzE#">
<field name="ATTR">val</field>
<value name="OID">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="(VS#ar)mX#FH0??a`YpE">
<field name="TEXT"></field>
</shadow>
<block type="variables_get" id="%;,.b-1n3Q`x=i_P[4vm">
<field name="VAR" id="0I[}CDRB#1t;RiBC2c!N">pir_02</field>
</block>
</value>
</block>
</value>
</block>
</value>
<value name="ADD5">
<block type="text_newline" id="Q{AczwXB+2+H_GY^V!^n">
<field name="Type">\n</field>
</block>
</value>
<value name="ADD6">
<block type="text_join" id="32C,uF1^t#{UHw0][q93">
<mutation items="2"></mutation>
<value name="ADD0">
<block type="text" id="dFa:8_P}IR^_:nz_z_dO">
<field name="TEXT">globallux: </field>
</block>
</value>
<value name="ADD1">
<block type="variables_get" id=",Or5XiX-3X^JCPc$TZXR">
<field name="VAR" id="Z}*@ZQ],86inGv;ML!G/">GlobalLuxLimit</field>
</block>
</value>
</block>
</value>
<value name="ADD7">
<block type="text_newline" id="9=A#2My=k/T0#yX4}O3N">
<field name="Type">\n</field>
</block>
</value>
<value name="ADD8">
<block type="text_join" id="!pl#DxkwBOo[#FmhEU][">
<mutation items="2"></mutation>
<value name="ADD0">
<block type="text" id="Q3h@!@QF_[k]vWzB5_2.">
<field name="TEXT">pirlux1: </field>
</block>
</value>
<value name="ADD1">
<block type="get_value_var" id="[,6n}%mfloy_0]eXm:Gq">
<field name="ATTR">val</field>
<value name="OID">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="D1(g!9bHQJTuB3|[v(_c">
<field name="TEXT"></field>
</shadow>
<block type="variables_get" id="1NDs=?3k6Cyr`FPFfx3%">
<field name="VAR" id=",RO*rmH)Gb7=:?$7ny,.">pir_lux_01</field>
</block>
</value>
</block>
</value>
</block>
</value>
<value name="ADD9">
<block type="text_newline" id="JNAUqM;Cc/t[Nw^,glSw">
<field name="Type">\n</field>
</block>
</value>
<value name="ADD10">
<block type="text_join" id="swNic27o0_au*F^3ZCKd">
<mutation items="2"></mutation>
<value name="ADD0">
<block type="text" id="vr}:sf4i]:8k!nl:T}:,">
<field name="TEXT">pirlux2: </field>
</block>
</value>
<value name="ADD1">
<block type="get_value_var" id="#AuZ%*phOL2fIynrTg+V">
<field name="ATTR">val</field>
<value name="OID">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="ZJ|8Hav~G`]Cw(k/cChq">
<field name="TEXT"></field>
</shadow>
<block type="variables_get" id="U^gz2:[g-S*=I`i)3O~m">
<field name="VAR" id="vS_F0r}]%+GePgY3vks8">pir_lux_02</field>
</block>
</value>
</block>
</value>
</block>
</value>
<value name="ADD11">
<block type="text_newline" id="tQp]vzu1j),1zqnA=%kI">
<field name="Type">\n</field>
</block>
</value>
<value name="ADD12">
<block type="text_join" id="6`CpDnDEH3fD$y$Tr.3`">
<mutation items="2"></mutation>
<value name="ADD0">
<block type="text" id="hvc9H|$dYS/([AXNBRu8">
<field name="TEXT">keepoff: </field>
</block>
</value>
<value name="ADD1">
<block type="variables_get" id="9Cu!b{}G1U%p%_cAT]8{">
<field name="VAR" id="dt+.dW.Wy09/+7%X.I|+">KeepOff</field>
</block>
</value>
</block>
</value>
<value name="ADD13">
<block type="text_newline" id="Xh.~^jNAi8vQfu,XBwY/">
<field name="Type">\n</field>
</block>
</value>
<value name="ADD14">
<block type="text_join" id="PIJsihRA^q^8=b^R[iQ9">
<mutation items="2"></mutation>
<value name="ADD0">
<block type="text" id="VRS.ox6#^x38buHk*P8[">
<field name="TEXT">keepon: </field>
</block>
</value>
<value name="ADD1">
<block type="variables_get" id="0ysKwoLmG^d{,=-Kh4C:">
<field name="VAR" id="VpvRaw-o{?h#_.0;LXn;">KeepOn</field>
</block>
</value>
</block>
</value>
<value name="ADD15">
<block type="text_newline" id="}0CIvBLSU)hH!zF)*Cr@">
<field name="Type">\n</field>
</block>
</value>
<value name="ADD16">
<block type="text_join" id="qZ5C%ICEMmGMSwQVpzkF">
<mutation items="2"></mutation>
<value name="ADD0">
<block type="text" id="UG`[U$3_0K}:PCnWdN7y">
<field name="TEXT">offtime: </field>
</block>
</value>
<value name="ADD1">
<block type="variables_get" id="gK{}F7N:?$FLcHumKGSD">
<field name="VAR" id=".vDs7L59v=fy*rrUz[gY">OFFTime</field>
</block>
</value>
</block>
</value>
<value name="ADD17">
<block type="text_newline" id="jfKTL$`gU)~]mK(.q|l9">
<field name="Type">\n</field>
</block>
</value>
<value name="ADD18">
<block type="text_join" id="|{:o[_0#lDt!rr++hzFw">
<mutation items="2"></mutation>
<value name="ADD0">
<block type="text" id="OH5gl[1+!/]+TT+I+)]X">
<field name="TEXT">switches: </field>
</block>
</value>
<value name="ADD1">
<block type="variables_get" id="{7JOz9JWX{|Kgb2i[]m}">
<field name="VAR" id="xjjCO3x]~#p7S0:#%i0_">switches</field>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</next>
</block>
</statement>
</block>
</statement>
<statement name="ELSE">
<block type="debug" id="4w2|1F,M`I5e77zwa.ns">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="bbxou~4]2_z*wGe#{4[k">
<field name="TEXT">AutoLight ist deaktiviert</field>
</shadow>
</value>
</block>
</statement>
<next>
<block type="comment" id="hoxnMLgQ2aNN0m=5Y:}m">
<field name="COMMENT">AtHomeTimer</field>
<next>
<block type="controls_if" id="v*U[9UI_|4@c)yiirCvb">
<value name="IF0">
<block type="logic_compare" id="}W#E1zCXZitL.S|r_*u,">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id=",Nlb[/RysL/LlIrpQ+e.">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.GlobalVars.AtHome</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="sOIRl}w5*9@4|Cu}Qa?F">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="debug" id="vcPx3~z~f}j@TgeL8)8S">
<field name="Severity">debug</field>
<value name="TEXT">
<shadow type="text" id="{V%?2,E+`DP%Jt6u@jBz">
<field name="TEXT">Schalte OFF in 10 Minuten weil nicht zuhause</field>
</shadow>
</value>
<next>
<block type="comment" id="RVtp!r)ays=b{:K7RYxJ">
<field name="COMMENT">AtHomeTimer</field>
<next>
<block type="debug" id="jQU}W-zBlE`x1UT+%n.v">
<field name="Severity">debug</field>
<value name="TEXT">
<shadow type="text" id="397}R%`ouk+n%Ab}WH%%">
<field name="TEXT">Schalte OFF weil nicht zuhause</field>
</shadow>
</value>
<next>
<block type="debug" id="zFy.s;7+hO@}w7+K1uY[">
<field name="Severity">log</field>
<value name="TEXT">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="g1ueDh_2oKR+gkXL:9pO">
<field name="TEXT">Schalte Licht AN</field>
</shadow>
<block type="procedures_callreturn" id="~mNhEHA+,LT?rX%eZ2lR">
<mutation name="SetSwitchlist">
<arg name="switches"></arg>
<arg name="TurnON"></arg>
<arg name="OFFTime"></arg>
</mutation>
<value name="ARG0">
<block type="variables_get" id="_Yf;JY5.:8UL{r9*yAn;">
<field name="VAR" id="xjjCO3x]~#p7S0:#%i0_">switches</field>
</block>
</value>
<value name="ARG1">
<block type="logic_boolean" id="f%n5w^9=kBCnrPPhJn;=">
<field name="BOOL">FALSE</field>
</block>
</value>
<value name="ARG2">
<block type="math_number" id="i_ImUcS(?61s*B~NN-39">
<field name="NUM">10</field>
</block>
</value>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
<value name="RETURN">
<block type="text_join" id="!bwM/xMn9lV`jZFwfsa/">
<mutation items="2"></mutation>
<value name="ADD0">
<block type="text" id="NjBm7Pn=DYJEAIm@_6UC">
<field name="TEXT">PIR Done: </field>
</block>
</value>
<value name="ADD1">
<block type="variables_get" id="u_!p(H,3VMjs5mEvL+43">
<field name="VAR" id="IX/gU^R_Zpb]{vD5A]Sn">RoomName</field>
</block>
</value>
</block>
</value>
</block>
<block type="on_ext" id=";^LGVCUKOD;aGmWXc=c6" x="13" y="3188">
<mutation xmlns="http://www.w3.org/1999/xhtml" items="4"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="field_oid" id="=Z_mw^?rB%bQC7u}kx|%">
<field name="oid">deconz.0.Sensors.40.presence</field>
</shadow>
<block type="field_oid" id="JsYO^Vgi0)-y|F+^oviC">
<field name="oid">0_userdata.0.GlobalVars.AtHome</field>
</block>
</value>
<value name="OID1">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="field_oid" id="$nQiwk=`v3y=fQ]PvUN0">
<field name="oid">default</field>
</shadow>
<block type="field_oid" id="[}`A:Y9U/u;5q,+v,W48">
<field name="oid">deconz.0.Sensors.25.presence</field>
</block>
</value>
<value name="OID2">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="field_oid" id="]e+nkTtwhknTJrrtFP4I">
<field name="oid">default</field>
</shadow>
<block type="field_oid" id="N#U0xQObgj/`[$L^lonm">
<field name="oid">deconz.0.Sensors.12.presence</field>
</block>
</value>
<value name="OID3">
<shadow type="field_oid" id="O;xK`Y0:=Myj8klNmIBi">
<field name="oid">default</field>
</shadow>
<block type="field_oid" id="A{Zk{I]]+wwcj:MI]+He">
<field name="oid">0_userdata.0.GlobalVars.Wohnzimmer_TV</field>
</block>
</value>
<statement name="STATEMENT">
<block type="debug" id="u8|~_n$bA:aWJ`UqCTFC">
<field name="Severity">log</field>
<value name="TEXT">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="ynfu|Z|NikvpCQ:1o:BB">
<field name="TEXT">test</field>
</shadow>
<block type="procedures_callreturn" id="nLv0b%CGK37Z)cY~zw/z">
<mutation name="PIROnOff">
<arg name="RoomName"></arg>
<arg name="pir_01"></arg>
<arg name="pir_02"></arg>
<arg name="pir_lux_01"></arg>
<arg name="pir_lux_02"></arg>
<arg name="pir_lux_limit"></arg>
<arg name="switches"></arg>
<arg name="extraOFFswitches"></arg>
<arg name="OFFTime"></arg>
<arg name="KeepOn"></arg>
<arg name="KeepOff"></arg>
<arg name="IgnoreNightMode"></arg>
</mutation>
<value name="ARG0">
<block type="text" id="}I(7Bqqm)_X~_X|bEiB1">
<field name="TEXT">Wohnzimmer</field>
</block>
</value>
<value name="ARG1">
<block type="field_oid" id="d`u(D,@Raq%;fP4CKEJt">
<field name="oid">deconz.0.Sensors.25.presence</field>
</block>
</value>
<value name="ARG2">
<block type="field_oid" id="NUjj.[urXP,8St`J=il:">
<field name="oid">deconz.0.Sensors.12.presence</field>
</block>
</value>
<value name="ARG3">
<block type="field_oid" id="c4R}~dbft8bbBgzDj3|r">
<field name="oid">deconz.0.Sensors.26.lux</field>
</block>
</value>
<value name="ARG4">
<block type="field_oid" id="{^ndJH5O0Hu5[@t(aCqz">
<field name="oid">deconz.0.Sensors.11.lux</field>
</block>
</value>
<value name="ARG5">
<block type="variables_get" id="vO{DatzV5%jA(Um]`XI*">
<field name="VAR" id="Z}*@ZQ],86inGv;ML!G/">GlobalLuxLimit</field>
</block>
</value>
<value name="ARG6">
<block type="procedures_callreturn" id="4b:WqC9H[=9`.[Ojfj?}">
<mutation name="wz_select_device"></mutation>
</block>
</value>
<value name="ARG7">
<block type="lists_create_with" id="c*D~`u7fuL5XaFK,!dJj">
<mutation items="7"></mutation>
<value name="ADD0">
<block type="field_oid" id="l;tyX^aUS_sSz%qL*TA)">
<field name="oid">deconz.0.Lights.21.on</field>
</block>
</value>
<value name="ADD1">
<block type="field_oid" id="t30:yg6P5=n3yIO$o^JK">
<field name="oid">deconz.0.Lights.22.on</field>
</block>
</value>
<value name="ADD2">
<block type="field_oid" id="mTIp`Y(Qt[?)#9bwPzRW">
<field name="oid">deconz.0.Lights.25.on</field>
</block>
</value>
<value name="ADD3">
<block type="field_oid" id="8ERU2+Cpj6jc128qe|Y!">
<field name="oid">deconz.0.Lights.26.on</field>
</block>
</value>
<value name="ADD4">
<block type="field_oid" id="F.g)-!0lCT):XZgMp@y,">
<field name="oid">milight-smart-light.2.wz_tv.fullColor-1.on</field>
</block>
</value>
<value name="ADD5">
<block type="field_oid" id="-Pi@+Lq]TB1.=9-_3Bdk">
<field name="oid">deconz.0.Lights.2.on</field>
</block>
</value>
<value name="ADD6">
<block type="field_oid" id="#t5{77?jGUrm/b@71+d]">
<field name="oid">scene.0.Szene_pir-wohnzimmer</field>
</block>
</value>
</block>
</value>
<value name="ARG8">
<block type="math_number" id="DpGu,O=HhqM~YNvwYd(q">
<field name="NUM">15</field>
</block>
</value>
<value name="ARG9">
<block type="get_value_var" id="`0Sf$59Dvioli#0BigAu">
<field name="ATTR">val</field>
<value name="OID">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="clv1]niZbc4686`koi;*">
<field name="TEXT"></field>
</shadow>
<block type="field_oid" id="[aYgpU8$]POx,/._r.ZL">
<field name="oid">0_userdata.0.GlobalVars.Wohnzimmer_TV</field>
</block>
</value>
</block>
</value>
<value name="ARG10">
<block type="logic_boolean" id="RwUt,vY#EAiFlDjIpHC1">
<field name="BOOL">FALSE</field>
</block>
</value>
<value name="ARG11">
<block type="logic_boolean" id="hD~{MtehXnYitYJ:{oei">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</value>
</block>
</statement>
</block>
<block type="procedures_defreturn" id="97)riRpuhw.aXAyJOQ#[" x="13" y="3913">
<mutation>
<arg name="switches" varid="xjjCO3x]~#p7S0:#%i0_"></arg>
<arg name="TurnON" varid="N=.oocr,|f!EjH[T#m4W"></arg>
<arg name="OFFTime" varid=".vDs7L59v=fy*rrUz[gY"></arg>
</mutation>
<field name="NAME">SetSwitchlist</field>
<comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
<statement name="STACK">
<block type="controls_forEach" id="?W@B=92zUWf^!ER$H:2S">
<field name="VAR" id="#DF~YDx#7HA~2_~c}$P?">switch</field>
<value name="LIST">
<block type="variables_get" id="cFsXd};PL_5F@w6(c(Qg">
<field name="VAR" id="xjjCO3x]~#p7S0:#%i0_">switches</field>
</block>
</value>
<statement name="DO">
<block type="controls_if" id="~kwRL!VPw_s!Z|Lw:Y=t">
<mutation else="1"></mutation>
<value name="IF0">
<block type="variables_get" id="~Hs{Nb8!2FayVhlmP{_o">
<field name="VAR" id="#DF~YDx#7HA~2_~c}$P?">switch</field>
</block>
</value>
<statement name="DO0">
<block type="debug" id="gjY2qE}KLN:vNc$SoY~/">
<field name="Severity">log</field>
<value name="TEXT">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="6Lv/kM);m|r--.+Hld*_">
<field name="TEXT">test</field>
</shadow>
<block type="text_join" id="N7@;X%^/S.U5nHl*eN=T">
<mutation items="6"></mutation>
<value name="ADD0">
<block type="text" id="yG%!Tu:2Cm3+)#s)HGga">
<field name="TEXT">Schalte: </field>
</block>
</value>
<value name="ADD1">
<block type="variables_get" id="|Wz|g-AiGzZSF(sbV,7L">
<field name="VAR" id="#DF~YDx#7HA~2_~c}$P?">switch</field>
</block>
</value>
<value name="ADD2">
<block type="text" id="gTBof0-WEUX0K|/%@NqH">
<field name="TEXT"> - </field>
</block>
</value>
<value name="ADD3">
<block type="variables_get" id="SF|0p5(O[YcG%OBo}h3w">
<field name="VAR" id="N=.oocr,|f!EjH[T#m4W">TurnON</field>
</block>
</value>
<value name="ADD4">
<block type="text" id=".y0Iqt1N6.gIv/P9fYSd">
<field name="TEXT"> - delay </field>
</block>
</value>
<value name="ADD5">
<block type="variables_get" id="-3KJjwlYCU;SI:}WNZz@">
<field name="VAR" id=".vDs7L59v=fy*rrUz[gY">OFFTime</field>
</block>
</value>
</block>
</value>
<next>
<block type="control_ex" id="79VIhFd[8OR7W~)]+Q7u">
<field name="TYPE">false</field>
<field name="CLEAR_RUNNING">TRUE</field>
<value name="OID">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="field_oid" id=",6QIA.:kmqHzLpOpp8{;">
<field name="oid">Object ID</field>
</shadow>
<block type="variables_get" id="G:^~pH88w+vU!!SqMNx^">
<field name="VAR" id="#DF~YDx#7HA~2_~c}$P?">switch</field>
</block>
</value>
<value name="VALUE">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="logic_boolean" id="M)y7lc35WCOB-sP@0.+Y">
<field name="BOOL">TRUE</field>
</shadow>
<block type="variables_get" id="CRtJGnM(7mlyCrjtAS#2">
<field name="VAR" id="N=.oocr,|f!EjH[T#m4W">TurnON</field>
</block>
</value>
<value name="DELAY_MS">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="*6fVY^7+fvHLGB^6ICUb">
<field name="NUM">0</field>
</shadow>
<block type="math_arithmetic" id="pM[;2Up_AS8vj(_EDMK)">
<field name="OP">ADD</field>
<value name="A">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="bVbb!f6+5,f}Wl`KX4^f">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="JrRlB#cNt~OPNxUEH.;#">
<field name="OP">MULTIPLY</field>
<value name="A">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="G{^vO}H,^Q{6{Y#)%NQE">
<field name="NUM">10</field>
</shadow>
<block type="variables_get" id="bZmmlv;6v=s;zh!Gb/h0">
<field name="VAR" id=".vDs7L59v=fy*rrUz[gY">OFFTime</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="``T4@SD7}ao:1:$~a5?R">
<field name="NUM">60000</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="*61~~OTr35.DVn~j@84c">
<field name="NUM">1</field>
</shadow>
<block type="math_random_int" id="Dvdm;BUT|h?pR6|d8Ncr">
<value name="FROM">
<shadow type="math_number" id="My|V/L|ec}ckrD)G)|2n">
<field name="NUM">1</field>
</shadow>
</value>
<value name="TO">
<shadow type="math_number" id="xKoCsxqCSQp{q${^Y**t">
<field name="NUM">500</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
</block>
</next>
</block>
</statement>
<statement name="ELSE">
<block type="debug" id="=.|w?9nf5~~PyKL5=g46">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="G=+l93Z8O{D|r+-TKizq">
<field name="TEXT">Switches Eintrag ist leer</field>
</shadow>
</value>
</block>
</statement>
</block>
</statement>
</block>
</statement>
<value name="RETURN">
<block type="text" id="(U$(5asPxY/vxdWptKjo">
<field name="TEXT">SetSwitches</field>
</block>
</value>
</block>
<block type="procedures_defreturn" id="Ly=3A3kJj[%)$pL1Y*Js" x="13" y="4513">
<mutation>
<arg name="switches" varid="xjjCO3x]~#p7S0:#%i0_"></arg>
</mutation>
<field name="NAME">GetSwitches</field>
<comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
<statement name="STACK">
<block type="variables_set" id="XFx8yOAtiL4G[Z;-r39M">
<field name="VAR" id=":#q3xGH!O9R*~b!?qxmd">counter</field>
<value name="VALUE">
<block type="math_number" id="A}w2Qz(.Sb}.d_=K[)kV">
<field name="NUM">0</field>
</block>
</value>
<next>
<block type="controls_forEach" id="OYbqZv/z,%U*6pycO0Ia">
<field name="VAR" id="#DF~YDx#7HA~2_~c}$P?">switch</field>
<value name="LIST">
<block type="variables_get" id="?2SsKISMzWqd/!ldagRl">
<field name="VAR" id="xjjCO3x]~#p7S0:#%i0_">switches</field>
</block>
</value>
<statement name="DO">
<block type="controls_if" id="*)}3??[G]V$)lT*Dc(kl">
<value name="IF0">
<block type="variables_get" id="qsq)yI{bGs5rs35sMFev">
<field name="VAR" id="#DF~YDx#7HA~2_~c}$P?">switch</field>
</block>
</value>
<statement name="DO0">
<block type="controls_if" id="-Rxingu-2hBJ?hm)NC8r">
<mutation else="1"></mutation>
<value name="IF0">
<block type="logic_compare" id="%R@E-(.[4?QEQ(XUEkUU">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value_var" id="6RXvDhz[f3Nc+|--=VEN">
<field name="ATTR">val</field>
<value name="OID">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="O:I4V1*pY/CJ6le4+IP@">
<field name="TEXT"></field>
</shadow>
<block type="variables_get" id="5tn`VgHa5Ba+g^i3hn]1">
<field name="VAR" id="#DF~YDx#7HA~2_~c}$P?">switch</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="-l?E7{+i:c.,=!NAAvc*">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="math_change" id="sbUQ?-Q!Dkk~Ppqv{a_m">
<field name="VAR" id=":#q3xGH!O9R*~b!?qxmd">counter</field>
<value name="DELTA">
<shadow type="math_number" id="cl$?.u]-:?xmJw8Ai!_Q">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</statement>
<statement name="ELSE">
<block type="variables_set" id="Ip0ZYg-1)*0N9c0Avxhp">
<field name="VAR" id=":#q3xGH!O9R*~b!?qxmd">counter</field>
<value name="VALUE">
<block type="math_number" id=":]i@+YY1zf=2pmyk940O">
<field name="NUM">0</field>
</block>
</value>
</block>
</statement>
</block>
</statement>
</block>
</statement>
<next>
<block type="controls_if" id=",mB*mcs]MX,^99pPJUa{">
<mutation else="1"></mutation>
<value name="IF0">
<block type="logic_compare" id="|pnl;7.yklmYt**dQ(^0">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="}IuVQ4.8q2.^[k6ZDPEO">
<field name="VAR" id=":#q3xGH!O9R*~b!?qxmd">counter</field>
</block>
</value>
<value name="B">
<block type="lists_length" id="}:5;_`YuLk6Hg3HVw[@d">
<value name="VALUE">
<block type="variables_get" id="e!:Q`NRUF#W.,-{8(^Oe">
<field name="VAR" id="xjjCO3x]~#p7S0:#%i0_">switches</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="debug" id="P9{2K[xAC7^JZaWZ;V~P">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="AD(k:Pz|uh5edFFT2Q*W">
<field name="TEXT">Switches sind AN</field>
</shadow>
</value>
<next>
<block type="variables_set" id="6QcH=2!04EY?p9o/ChzL">
<field name="VAR" id="UFl:*B!P.|vFu=[uU3T/">return</field>
<value name="VALUE">
<block type="logic_boolean" id="NMtD{*YcoYw9zD@Z2WDp">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</next>
</block>
</statement>
<statement name="ELSE">
<block type="debug" id="~CIg6id=8ds{FM[;#Udk">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="gE$ehZm~b8}1t7Kr6+9E">
<field name="TEXT">Switches sind AUS</field>
</shadow>
</value>
<next>
<block type="variables_set" id="3OFGY-djS_YMS$;~.+s]">
<field name="VAR" id="UFl:*B!P.|vFu=[uU3T/">return</field>
<value name="VALUE">
<block type="logic_boolean" id="ym(,6;S:c{KTq-}6A2In">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</statement>
<value name="RETURN">
<block type="variables_get" id="F6:BVND*:t/WUU}QVqc3">
<field name="VAR" id="UFl:*B!P.|vFu=[uU3T/">return</field>
</block>
</value>
</block>
</xml>