Hi,
ich will eigentlich etwas Vergleichbares Steuern.
Ein Timer, der mittels Mqtt übermittelt wird und dadruch variable ist, derzeit aber noch auf 16:00 Uhr fest ist.
Das Licht soll jedoch 5 Minuten vor dem Timer angehen.
Ich habe versucht mich an deinem Skript zu orientieren aber es klappt leider nicht.
<xml xmlns="http://www.w3.org/1999/xhtml">
<variables>
<variable type="" id="z}kg|mI[kX$/z;}UeFnC">Zeit_Timer</variable>
<variable type="" id="Offrx@ShSg8?(XB1XoXW">Vorlauf_Minuten</variable>
<variable type="" id="fbCFwgjpuQyO=ox-@lqY">Zeit_in_Minuten</variable>
<variable type="" id="uRSlnmWZ9D9l{,FK*.CI">Startzeit_in_Minuten</variable>
<variable type="" id="Dx2cmEA2G[7Rk/~v^=iY">Startzeit_Minuten</variable>
<variable type="" id="q)V*4t+J1NGUNKuMMq!e">start_ss</variable>
<variable type="" id="CCd}L`-iRJU14NDa?-07">start</variable>
<variable type="" id="Z^}ceHl8=w*CKe)=UntZ">start_mm</variable>
<variable type="" id="yr7$.;.y`[93[3Z@zz($">start_min</variable>
</variables>
<block type="schedule" id="|e%$lB3UL3Su,7x{O+PM" x="-412" y="354">
<field name="SCHEDULE">*/30 * * * * *</field>
<statement name="STATEMENT">
<block type="comment" id="sZ{txregW9_QtgFGlWT%">
<field name="COMMENT">meine Grundwerte</field>
<next>
<block type="variables_set" id="04A(,ASt%7L8iZmPa:eX">
<field name="VAR" id="z}kg|mI[kX$/z;}UeFnC" variabletype="">Zeit_Timer</field>
<value name="VALUE">
<block type="text" id="XFL57PiWm`P:VNVF[uO6">
<field name="TEXT">16:00</field>
</block>
</value>
<next>
<block type="variables_set" id="o=?h6B5j[Q*X5.^Psf#B">
<field name="VAR" id="Offrx@ShSg8?(XB1XoXW" variabletype="">Vorlauf_Minuten</field>
<value name="VALUE">
<block type="math_number" id="C)UPQLXsO6%nND^4a-@n">
<field name="NUM">5</field>
</block>
</value>
<next>
<block type="comment" id="i5Z^DNy;EoJ(THY#~V1K">
<field name="COMMENT">Berechnung</field>
<next>
<block type="variables_set" id="kDht]1_`ZaF9VHz5a42H">
<field name="VAR" id="fbCFwgjpuQyO=ox-@lqY" variabletype="">Zeit_in_Minuten</field>
<value name="VALUE">
<block type="convert_from_date" id="hm#WbBeMg53!cl96P-,0">
<mutation format="false" language="false"></mutation>
<field name="OPTION">mid</field>
<value name="VALUE">
<block type="variables_get" id="#.94la:IJpa=6AZJvE][">
<field name="VAR" id="z}kg|mI[kX$/z;}UeFnC" variabletype="">Zeit_Timer</field>
</block>
</value>
</block>
</value>
<next>
<block type="variables_set" id="?J|0veis#ArX3kAJn-cw">
<field name="VAR" id="uRSlnmWZ9D9l{,FK*.CI" variabletype="">Startzeit_in_Minuten</field>
<value name="VALUE">
<block type="math_arithmetic" id="!5H7PshzI?r]f%s{Rc@8">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number" id="#R$;31%U`rEujqjB2Uml">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id="^Y|#W^nIuPqevv1xPQnK">
<field name="VAR" id="fbCFwgjpuQyO=ox-@lqY" variabletype="">Zeit_in_Minuten</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="z~i_{35X!SD(]h)a{[B}">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id="VMH3*HK;P+F$}{IIQ-A!">
<field name="VAR" id="Offrx@ShSg8?(XB1XoXW" variabletype="">Vorlauf_Minuten</field>
</block>
</value>
</block>
</value>
<next>
<block type="variables_set" id="]bb`/bksbrf1:XSUsyw:">
<field name="VAR" id="Dx2cmEA2G[7Rk/~v^=iY" variabletype="">Startzeit_Minuten</field>
<value name="VALUE">
<block type="math_modulo" id="Kz/qP]qAjWMg467rzr.z">
<value name="DIVIDEND">
<shadow type="math_number" id="I3JV.jPqu#R]=m%yRcy#">
<field name="NUM">64</field>
</shadow>
<block type="variables_get" id="[H$!e0P?b#d,Jy$}NF(N">
<field name="VAR" id="uRSlnmWZ9D9l{,FK*.CI" variabletype="">Startzeit_in_Minuten</field>
</block>
</value>
<value name="DIVISOR">
<shadow type="math_number" id="C%0:Y=+pa|~KddvdTpp2">
<field name="NUM">60</field>
</shadow>
</value>
</block>
</value>
<next>
<block type="variables_set" id="Xg`E[ch|+GsIlb;D?9}6">
<field name="VAR" id="q)V*4t+J1NGUNKuMMq!e" variabletype="">start_ss</field>
<value name="VALUE">
<block type="math_arithmetic" id="LDsr=ST$[n_z@4^cZ)WB">
<field name="OP">DIVIDE</field>
<value name="A">
<shadow type="math_number" id="4MiU2nLX)Pq#|L`NY~0^">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="+c9Xm7n)}2WVZ/5uYw~y">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number" id="R1o)nTe.JeWdc)Db0=`X">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id="=t{9+:xs=P!MA9#)rK:w">
<field name="VAR" id="yr7$.;.y`[93[3Z@zz($" variabletype="">start_min</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="c|Feu6iq1~U9rd_$W5?t">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id="l.+;^d%$N3xQ`lSixwGO">
<field name="VAR" id="Z^}ceHl8=w*CKe)=UntZ" variabletype="">start_mm</field>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="/2F?`b}HH=osw$?LdGGI">
<field name="NUM">60</field>
</shadow>
</value>
</block>
</value>
<next>
<block type="variables_set" id="a6m?;gvKf?:4J%)a,d_$">
<field name="VAR" id="CCd}L`-iRJU14NDa?-07" variabletype="">start</field>
<value name="VALUE">
<block type="text_join" id="ksx)Vm}cTypk_H:aawd[">
<mutation items="3"></mutation>
<value name="ADD0">
<block type="variables_get" id="f`dfhmH?TJKWAN;;ZnkT">
<field name="VAR" id="q)V*4t+J1NGUNKuMMq!e" variabletype="">start_ss</field>
</block>
</value>
<value name="ADD1">
<block type="text" id="2,x!9GF,ldj_0IszHGeU">
<field name="TEXT">:</field>
</block>
</value>
<value name="ADD2">
<block type="variables_get" id="L:FZ}.Ox-gW?Fx7=JxL1">
<field name="VAR" id="Z^}ceHl8=w*CKe)=UntZ" variabletype="">start_mm</field>
</block>
</value>
</block>
</value>
<next>
<block type="comment" id="cU~;[Yp@3:$!1w;wOMc,">
<field name="COMMENT">Abfrage der Zeit und Steuerung</field>
<next>
<block type="controls_if" id="e}#qr}oEK?vLGOVAl@)F">
<value name="IF0">
<block type="time_compare_ex" id="^-by2v:c@o47[(q1-=HJ">
<mutation end_time="false" actual_time="true"></mutation>
<field name="USE_ACTUAL_TIME">TRUE</field>
<field name="OPTION">==</field>
<value name="START_TIME">
<shadow type="text" id="6MX(2LM7^,%1ehw=(,RB">
<field name="TEXT">12:00</field>
</shadow>
<block type="variables_get" id="(xaKxHD(|VB5i7wTO?k!">
<field name="VAR" id="CCd}L`-iRJU14NDa?-07" variabletype="">start</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="control" id="8E_Q-1+Vo9XydYCQEGSx">
<mutation delay_input="false"></mutation>
<field name="OID">shelly.0.SHSW-1#2C04AC#1.Relay0.Switch</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="|.`Jz5(JSM=f[ly1V5@Q">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</xml>