! ````
<xml xmlns="http://www.w3.org/1999/xhtml"><block type="create" id="f/h+q}5V%y]EUJ;a=!VW" x="-437" y="-388"><field name="NAME">Kueche_State</field>
<next><block type="create" id="Uzkta:J2#p(pK#gZWHts"><field name="NAME">Lichtautomatik_Kueche</field>
<next><block type="variables_set" id="U,v}AxcbrG,o}/9r)R!"><field name="VAR">licht_Kueche</field>
<value name="VALUE"><block type="get_value" id="7.:eScCos^))#So/]I7"><field name="ATTR">val</field>
<field name="OID">hm-rpc.0.OEQ1148284.1.STATE</field></block></value>
<next><block type="comment" id="bl5[_A@=Q=VNvb.TPlA"><field name="COMMENT">ID Bewegung</field> <next><block type="on" id="^E4sfXy
;J%7%N7!~KYN"><field name="OID">javascript.1.Hue.2.Bewegung_Kueche</field>
<field name="CONDITION">ne</field>
<statement name="STATEMENT"><block type="debug" id="5jySf};|1KIOz|-x5.4Z"><field name="Severity">log</field>
<value name="TEXT"><shadow type="text" id="fHy%l4TaB=O@7CVB%u0b"><field name="TEXT">Motion hat sich geändert</field></shadow></value>
<next><block type="controls_if" id="lZ(wkj5=qNXN;_`3W3EM"><mutation elseif="2"></mutation>
<value name="IF0"><block type="logic_operation" id="E=HM_HQk,dla`gsD4{H:" inline="false"><field name="OP">AND</field>
<value name="A"><block type="logic_operation" id="=cIP!7w_p]G^(AgluL[v" inline="false"><field name="OP">AND</field>
<value name="A"><block type="logic_compare" id="Yh%8NG*Nuwjr^aKM=,nt"><field name="OP">EQ</field>
<value name="A"><block type="get_value" id="#K|]ht@w0d_Zr~6.T2~E"><field name="ATTR">val</field>
<field name="OID">javascript.1.Hue.2.Bewegung_Kueche</field></block></value>
<value name="B"><block type="logic_boolean" id="~y`_6?d~o4)_]EyZ4J;u"><field name="BOOL">TRUE</field></block></value></block></value>
<value name="B"><block type="logic_compare" id="D55i4j~OO6*Hm9PfVjm="><field name="OP">NEQ</field>
<value name="A"><block type="variables_get" id="}cCg)yznc~0`#7APGIT)"><field name="VAR">licht_Kueche</field></block></value>
<value name="B"><block type="logic_boolean" id=";EV32f,;q=g1]+O8c)g2"><field name="BOOL">TRUE</field></block></value></block></value></block></value>
<value name="B"><block type="logic_operation" id="@TpyiC./.ECP0lF-~1?w" inline="false"><field name="OP">AND</field>
<value name="A"><block type="get_value" id="Y(b=sP`q47riGyA,XksN"><field name="ATTR">val</field>
<field name="OID">javascript.1.Hue.2.Helligkeit_Kueche</field></block></value>
<value name="B"><block type="get_value" id="HxQ1+yJnLg==AA(b^I,["><field name="ATTR">val</field>
<field name="OID">javascript.1.Lichtautomatik_Kueche</field></block></value></block></value></block></value>
<statement name="DO0"><block type="debug" id="TKfC_ji*Hm6VcZj*f0}Y"><field name="Severity">log</field>
<value name="TEXT"><shadow type="text" id="(oL_uo[8==.Z}qCFEfA."><field name="TEXT">Alle Bedingungen OK, Licht an</field></shadow></value>
<next><block type="control" id="uE]kwP%Z?J[RCFy42a,7"><mutation delay_input="false"></mutation>
<field name="OID">hm-rpc.0.OEQ1148284.1.STATE</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE"><block type="logic_boolean" id="a6o!G0N:bhTy-.[j1666"><field name="BOOL">TRUE</field></block></value>
<next><block type="control" id="zYhzvwa{q{Q1;,[31^#C"><mutation delay_input="false"></mutation>
<field name="OID">javascript.1.Kueche_State</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE"><block type="logic_boolean" id="?7AV-q45SnEA*.4nNt:6"><field name="BOOL">TRUE</field></block></value></block></next></block></next></block></statement>
<value name="IF1"><block type="logic_operation" id="Y~.i/Pt44SuP|V}YcK|E" inline="false"><field name="OP">AND</field>
<value name="A"><block type="variables_get" id="S5lo2]3s*YpRhW:VD/p4"><field name="VAR">licht_Kueche</field></block></value>
<value name="B"><block type="logic_operation" id="J5`Gld]}n*j10oxbS_?8" inline="false"><field name="OP">AND</field>
<value name="A"><block type="logic_compare" id="rNA:N3@NZ/-^dGkL{Z%u"><field name="OP">EQ</field>
<value name="A"><block type="get_value" id="Ir,D1K,f_535w~SEt0hZ"><field name="ATTR">val</field>
<field name="OID">javascript.1.Hue.2.Bewegung_Kueche</field></block></value>
<value name="B"><block type="logic_boolean" id="qpW(m3)RxeTh?O5(O+L!"><field name="BOOL">TRUE</field></block></value></block></value>
<value name="B"><block type="get_value" id="Q#8EVw/^yor:Ihj=[r_c"><field name="ATTR">val</field>
<field name="OID">javascript.1.Lichtautomatik_Kueche</field></block></value></block></value></block></value>
<statement name="DO1"><block type="timeouts_cleartimeout" id="~qHp3o*Wab.XYgl%rn#g"><field name="NAME">timeout</field>
<next><block type="debug" id="@hNr3:jd6:lD:ehN19DA"><field name="Severity">log</field>
<value name="TEXT"><shadow type="text" id="RRyZEBWQ+9-D,P.D-Dd`"><field name="TEXT">Bewegung erkannt:Licht ist schon an</field></shadow></value></block></next></block></statement>
<value name="IF2"><block type="logic_operation" id="|)+-]QQFMd2kz=~VB:))" inline="false"><field name="OP">AND</field>
<value name="A"><block type="variables_get" id="y8LC=t/!+2P5:OUS3t@2"><field name="VAR">licht_Kueche</field></block></value>
<value name="B"><block type="logic_operation" id="Bm3Pez`%ZLJG4O{Ru5B+" inline="false"><field name="OP">AND</field>
<value name="A"><block type="logic_compare" id="C?YcLvjR8lVZpl.rcpv^"><field name="OP">NEQ</field>
<value name="A"><block type="get_value" id="v#(Lfeg)d%*D{eJ25OAT"><field name="ATTR">val</field>
<field name="OID">javascript.1.Hue.2.Bewegung_Kueche</field></block></value>
<value name="B"><block type="logic_boolean" id="Si}n@@VC@PmZhrx1i^Rl"><field name="BOOL">TRUE</field></block></value></block></value>
<value name="B"><block type="get_value" id="diSen57XIb(F:wZQU.4_"><field name="ATTR">val</field>
<field name="OID">javascript.1.Lichtautomatik_Kueche</field></block></value></block></value></block></value>
<statement name="DO2"><block type="debug" id="L|}GJ8=gE|QE+9=_uQp1"><field name="Severity">log</field>
<value name="TEXT"><shadow type="text" id="OAG4qE^{qe/?ibyjauXE"><field name="TEXT">Keine bewegung timer starten</field></shadow></value>
<next><block type="timeouts_cleartimeout" id="GM7ujBrSBNOMga4_(?Gv"><field name="NAME">timeout</field>
<next><block type="timeouts_settimeout" id="F3Tex_`gJ**]n(K(Ua86"><field name="NAME">timeout</field>
<field name="DELAY">3</field>
<field name="UNIT">min</field>
<statement name="STATEMENT"><block type="controls_if" id="M60^Ic]cp0Mf2p9HbTir"><value name="IF0"><block type="logic_operation" id="_,O3L2RQ2,xI2|{|vz}Y"><field name="OP">AND</field>
<value name="A"><block type="variables_get" id="1WQ7~2dm_.*+H)L(O5@{"><field name="VAR">licht_Kueche</field></block></value>
<value name="B"><block type="logic_compare" id="w{.nM^Kf_iMRR0#tfRjE"><field name="OP">NEQ</field>
<value name="A"><block type="get_value" id="`|/cV^AQND=!;Ly){42("><field name="ATTR">val</field>
<field name="OID">javascript.1.Hue.2.Bewegung_Kueche</field></block></value>
<value name="B"><block type="logic_boolean" id="/(O?--g7uMK7C{qYo{mZ"><field name="BOOL">TRUE</field></block></value></block></value></block></value>
<statement name="DO0"><block type="control" id="*n8yTg,vzGkKwO`;srp."><mutation delay_input="false"></mutation>
<field name="OID">hm-rpc.0.OEQ1148284.1.STATE</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE"><block type="logic_boolean" id="aNXp7_a?dXcb]%{2)IVi"><field name="BOOL">FALSE</field></block></value>
<next><block type="control" id="(u}jL-fI~[Fr8l?83;b8"><mutation delay_input="false"></mutation>
<field name="OID">javascript.1.Kueche_State</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE"><block type="logic_boolean" id="7fg}SH%TtJ2QQl|iJkJH"><field name="BOOL">FALSE</field></block></value></block></next></block></statement></block></statement></block></next></block></next></block></statement></block></next></block></statement>
<next><block type="comment" id="PlNbAyN^w;+~0DlYraf?"><field name="COMMENT">ID Licht</field>
<next><block type="on" id="Qvir^Iyye;}YSbLTY*En"><field name="OID">hm-rpc.0.OEQ1148284.1.STATE</field>
<field name="CONDITION">any</field>
<field name="ACK_CONDITION">true</field>
<statement name="STATEMENT"><block type="variables_set" id="8u+DfM@(Gb|Gpa*5V%gb"><field name="VAR">licht_Kueche</field>
<value name="VALUE"><block type="on_source" id="*z`p%tJ(Mc`=dl6(%0Q%"><field name="ATTR">state.val</field></block></value></block></statement>
<next><block type="on" id="E/h^XM2HRwrs0EAm(~.~"><field name="OID">hm-rpc.0.OEQ1148284.1.STATE</field>
<field name="CONDITION">any</field>
<field name="ACK_CONDITION">true</field>
<statement name="STATEMENT"><block type="controls_if" id="Qu|38ncZ=aV_FiJ|{6B4"><value name="IF0"><block type="logic_compare" id="],+dP__za,Y^P.Ta|/St"><field name="OP">EQ</field>
<value name="A"><block type="get_value" id="*2`@L{}7PKr)=(fAPlO7"><field name="ATTR">val</field>
<field name="OID">hm-rpc.0.OEQ1148284.1.STATE</field></block></value>
<value name="B"><block type="logic_boolean" id="}F{URw/H6b0^AHM1%:im"><field name="BOOL">FALSE</field></block></value></block></value>
<statement name="DO0"><block type="control" id="91r7zNW@!0LKaft8J-fU"><mutation delay_input="false"></mutation>
<field name="OID">javascript.1.Kueche_State</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE"><block type="on_source" id="L~AmN}EsEF#5mRDa7^dP"><field name="ATTR">state.val</field></block></value></block></statement></block></statement></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block>
<block type="comment" id="2aV7tF/;%?p=WCSi2.Nl" x="-62" y="-312"><field name="COMMENT">ID Licht</field></block></xml>
Ich habe es jetzt nochmal umgebaut.. da waren doch noch ein bisschen Denkfehler drin….
Nun funktioniert es perfekt. Einschaltbedingung, erkennen ob Bewegung, wenn Licht schon an ist (timer stoppen, falls schon einer gestartet) und Timer zum ausschalten, wenn licht an und keine Bewegung mehr...
[4885_kueche-neu.jpeg](/assets/uploads/files/4885_kueche-neu.jpeg)