Hi Leute.
Ich habe es einige zeit getestet und es funktioniert perfekt.
falls hier noch Interesse besteht. hier mein Blockly.
Nicht vergessen vorher die Datenpunkte anzulegen!
Viel erfolg euch.
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="_!Mk|-wEQfBvkQb-SOm[">Zähler</variable>
<variable id="]=E8^SqeYtylk80l09h+">i</variable>
<variable type="interval" id="Intervall">Intervall</variable>
</variables>
<block type="comment" id=":6-HX`/i~?}^5,1U+1MP" x="188" y="-462">
<field name="COMMENT">Datenpunkte Anlegen (Zahl):</field>
<next>
<block type="comment" id="^dN$e4tk|^:eT=jG?9Ri">
<field name="COMMENT">Aktiv Einschalten (0 und 1)</field>
<next>
<block type="comment" id="7;,9T.2Jw~Zk60d0*Dtk">
<field name="COMMENT">InUse, im Betrieb (0 und 1)</field>
<next>
<block type="comment" id="f6W.TUo5K`Ds)JBGPHhY">
<field name="COMMENT">RemainingDuration, Countdown (0 und 3600s)</field>
<next>
<block type="comment" id="AhZhr(,+Kam^f[Ys6A/)">
<field name="COMMENT">SetDuration, Einstellzeit (0 und 3600s)</field>
<next>
<block type="comment" id="NW4alIw_ui;)37,Q5m]X">
<field name="COMMENT">ValveTyp symbol 0 für Wasserhahn,1 für Rasensprenger</field>
<next>
<block type="variables_set" id="jGcq:fe4l~0r@e*{me%^">
<field name="VAR" id="_!Mk|-wEQfBvkQb-SOm[">Zähler</field>
<value name="VALUE">
<block type="math_number" id="FVh37G#Xc8,{yZd!@d^|">
<field name="NUM">0</field>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
<block type="on_ext" id="m)b|6Yr3Nyw(c3I{xV!e" x="188" y="-212">
<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=",Xzg6=e;vf[v`rd+SpMI">
<field name="oid">0_userdata.0.Gartenbewässerung.Aktiv_Einschalten</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="comment" id="r9~1?E8y4t(WF3WPd*Ip">
<field name="COMMENT">Einschalten, Hochzählen</field>
<next>
<block type="debug" id="k?M~L~!kcL;0x9!o2/dx">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="tvUZQLnehrl=5B-keCuy">
<field name="TEXT">Aktiv Einschalten</field>
</shadow>
</value>
<next>
<block type="controls_if" id="Ra}!#hM*nX,+P}i-|N,;">
<mutation elseif="1"></mutation>
<value name="IF0">
<block type="logic_compare" id="1nCI$B(edA]$k4ow@,tN">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="xVea[5qqWSM3;E|Iqbg!">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.Gartenbewässerung.Aktiv_Einschalten</field>
</block>
</value>
<value name="B">
<block type="math_number" id="T]UAlA@xnK*5#6U`MOD_">
<field name="NUM">1</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="update" id="^-p+-RN6LmyqTROU0os8">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
<field name="OID">0_userdata.0.Gartenbewässerung.InUse_Im_Betrieb</field>
<field name="WITH_DELAY">TRUE</field>
<field name="DELAY_MS">1</field>
<field name="UNIT">sec</field>
<field name="CLEAR_RUNNING">TRUE</field>
<value name="VALUE">
<block type="math_number" id="U^jU`N:Ch_4-EtfO+43$">
<field name="NUM">1</field>
</block>
</value>
<next>
<block type="control" id="~n,ko~DWW%{{vDX++]@D">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
<field name="OID">sonoff.0.Bewässerung .POWER4</field>
<field name="WITH_DELAY">TRUE</field>
<field name="DELAY_MS">1</field>
<field name="UNIT">sec</field>
<field name="CLEAR_RUNNING">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="QCV_94I$6ZHjf4Gmwlkv">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="debug" id=")Xxj:J!2NV3(6RN@.YXS">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="k|-E}K-7Ju:Mf.`$VL[,">
<field name="TEXT">Timer erhöhen</field>
</shadow>
</value>
<next>
<block type="timeouts_setinterval" id="mgkbCxRZNBw^6*wRu}yv">
<field name="NAME">Intervall</field>
<field name="INTERVAL">1</field>
<field name="UNIT">sec</field>
<statement name="STATEMENT">
<block type="math_change" id="|y[C#u3z}?RN0[w30aU5">
<field name="VAR" id="_!Mk|-wEQfBvkQb-SOm[">Zähler</field>
<value name="DELTA">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="%q!%sZ?))#^3u6|~REY4">
<field name="NUM">1</field>
</shadow>
<block type="math_number" id="0$@o~63rmBdnOwrz}^Mp">
<field name="NUM">1</field>
</block>
</value>
<next>
<block type="update" id="WE]K9F/wOVmu]Zb%krqv">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.Gartenbewässerung.RemainingDuration</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="variables_get" id="g@QUVX$.jKnM).}ORnL?">
<field name="VAR" id="_!Mk|-wEQfBvkQb-SOm[">Zähler</field>
</block>
</value>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
<value name="IF1">
<block type="logic_compare" id="zEy;=xPiOdRSSt[2QV{M">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="_5e_}?Mw1K`+ltp*1Y7t">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.Gartenbewässerung.Aktiv_Einschalten</field>
</block>
</value>
<value name="B">
<block type="math_number" id="T%d*nj)(e13w}Zy`PALl">
<field name="NUM">0</field>
</block>
</value>
</block>
</value>
<statement name="DO1">
<block type="comment" id="KFX.lrp#n,AiTS20q^dE">
<field name="COMMENT">Ausschalten</field>
<next>
<block type="update" id="idk2oC[9!T1KwwGfc[=,">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
<field name="OID">0_userdata.0.Gartenbewässerung.InUse_Im_Betrieb</field>
<field name="WITH_DELAY">TRUE</field>
<field name="DELAY_MS">1</field>
<field name="UNIT">sec</field>
<field name="CLEAR_RUNNING">TRUE</field>
<value name="VALUE">
<block type="math_number" id="w@[$!NZ[7j`^@776di:L">
<field name="NUM">0</field>
</block>
</value>
<next>
<block type="control" id="L(lQ#BlaNMGs%_gk%Kik">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
<field name="OID">sonoff.0.Bewässerung .POWER4</field>
<field name="WITH_DELAY">TRUE</field>
<field name="DELAY_MS">1</field>
<field name="UNIT">sec</field>
<field name="CLEAR_RUNNING">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="Nf+JpzgcI3Yq+_v2lneI">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="timeouts_clearinterval" id="M)MazzXoh,{%5dw9fD~a">
<field name="NAME">Intervall</field>
<next>
<block type="variables_set" id="Q;l{%]}iwiNdpeJ2dte|">
<field name="VAR" id="_!Mk|-wEQfBvkQb-SOm[">Zähler</field>
<value name="VALUE">
<block type="math_number" id="uPOM65F]%ZPX83FOE{Zv">
<field name="NUM">0</field>
</block>
</value>
<next>
<block type="update" id="Bt+-;Td/u5C}O00fqLu$">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.Gartenbewässerung.RemainingDuration</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="variables_get" id="CFW^bxM_RaPC?P(^x1LZ">
<field name="VAR" id="_!Mk|-wEQfBvkQb-SOm[">Zähler</field>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</statement>
<next>
<block type="on_ext" id=":-wV$rCi+Air=]pZ(~$9">
<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="PRypXOE+eu15sp;HG.*U">
<field name="oid">0_userdata.0.Gartenbewässerung.SetDuration__Einstellzeit</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="debug" id="g7FfJ*RtMV]h8r5^0rp)">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id=".2+F?B]6$7~+Wxk9J9Jo">
<field name="TEXT">SetDuration Einstellzeit</field>
</shadow>
</value>
<next>
<block type="comment" id="~dNIOn2gPx}FK-F47zcm">
<field name="COMMENT">Einstellzeit auf Countdown </field>
<next>
<block type="controls_if" id=")A){*)bBtb7cL?@B^8Cy">
<value name="IF0">
<block type="logic_compare" id="1I5_TOz$}D;qb0~Mf-}h">
<field name="OP">GTE</field>
<value name="A">
<block type="get_value" id="bPN:,m1@]bGbI:PJPg}9">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.Gartenbewässerung.SetDuration__Einstellzeit</field>
</block>
</value>
<value name="B">
<block type="math_number" id="7lQd#9*QC,C(d=+8bWy}">
<field name="NUM">0</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="update" id="jyYuv$f^ncWdO^oZ;Q]X">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
<field name="OID">0_userdata.0.Gartenbewässerung.RemainingDuration</field>
<field name="WITH_DELAY">TRUE</field>
<field name="DELAY_MS">1000</field>
<field name="UNIT">ms</field>
<field name="CLEAR_RUNNING">TRUE</field>
<value name="VALUE">
<block type="get_value" id="-%Ek0GK$6|Zd?g(*|6SH">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.Gartenbewässerung.SetDuration__Einstellzeit</field>
</block>
</value>
<next>
<block type="debug" id="haoQV{=H%4+NQna#,HuK">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="g6}xV1aZX-he$K;{D@E-">
<field name="TEXT">RemainingDuration aktualisiert</field>
</shadow>
</value>
<next>
<block type="timeouts_clearinterval" id="rw(_6v9gJ{xHDQz0@_!X">
<field name="NAME">Intervall</field>
<next>
<block type="variables_set" id="83^Kc2#**WZhH,tK)RvU">
<field name="VAR" id="_!Mk|-wEQfBvkQb-SOm[">Zähler</field>
<value name="VALUE">
<block type="math_number" id="+XWEp]7E;[7})rJn]__7">
<field name="NUM">0</field>
</block>
</value>
<next>
<block type="debug" id="v0#RgXgdtqVJ*ie)LrNz">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="?W%]MFZ6Y#FvgU!/T;H8">
<field name="TEXT">Stop Intervall, Zähler auf 0 gesetzt</field>
</shadow>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</statement>
<next>
<block type="on_ext" id="J4D{@QQDJ$r!zr+H3xgl">
<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="GKuM^(CsH!0_-(+;QJ=s">
<field name="oid">0_userdata.0.Gartenbewässerung.RemainingDuration</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="comment" id="eRE3Go`6Ug]S=Ha@Bf63">
<field name="COMMENT">countdown runter zählen</field>
<next>
<block type="controls_if" id="hQT1%MOLlX5i,Vy5r9f(">
<value name="IF0">
<block type="logic_compare" id="=l?J;BP@_G}xn2o(uVN@">
<field name="OP">GT</field>
<value name="A">
<block type="get_value" id="i+{CqpRyG-nG:hf]pxh$">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.Gartenbewässerung.SetDuration__Einstellzeit</field>
</block>
</value>
<value name="B">
<block type="math_number" id="s}(/NQ^:O#wQI7NfyB-K">
<field name="NUM">0</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="debug" id="EI_+]#{~nO|}#Ro0TZQ#">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id=";mCt/wt%LUjjZKhSaNsg">
<field name="TEXT">Zahl Runter Zählen</field>
</shadow>
</value>
<next>
<block type="controls_for" id="%4^sFx=-4P`:WTMrIITD">
<field name="VAR" id="]=E8^SqeYtylk80l09h+">i</field>
<value name="FROM">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="/-8?i4Wk6=Y#56kjO(Gt">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id="*E*K6y.)1G|wLPr8kV%d">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.Gartenbewässerung.RemainingDuration</field>
</block>
</value>
<value name="TO">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="o}xtjoP2%ggW2`R9M#aL">
<field name="NUM">10</field>
</shadow>
<block type="math_number" id="}J6xYgTMul#Dv|c74G%n">
<field name="NUM">0</field>
</block>
</value>
<value name="BY">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="2`Tn-X[1-;2(I+/,*i^H">
<field name="NUM">1</field>
</shadow>
<block type="math_number" id="9Y9=u?f=W{Ed6g-?y%KJ">
<field name="NUM">1</field>
</block>
</value>
<statement name="DO">
<block type="update" id="Vsj/5?YIaB=BDce@P_YQ">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
<field name="OID">0_userdata.0.Gartenbewässerung.RemainingDuration</field>
<field name="WITH_DELAY">TRUE</field>
<field name="DELAY_MS">1</field>
<field name="UNIT">sec</field>
<field name="CLEAR_RUNNING">TRUE</field>
<value name="VALUE">
<block type="math_arithmetic" id="4+3{8a+hcBM,E.;EAIE}">
<field name="OP">MINUS</field>
<value name="A">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="6aX};#M%93}~^8wUyz[I">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id="$2gbU|E[M5#J8dB2CmuW">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.Gartenbewässerung.RemainingDuration</field>
</block>
</value>
<value name="B">
<shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="Z@jGmE?D8Z/3ILu|]DDx">
<field name="NUM">1</field>
</shadow>
<block type="math_number" id="J;/v9[/rJu|y+U_e$.gS">
<field name="NUM">1</field>
</block>
</value>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</statement>
<next>
<block type="comment" id="/+*irFr+K7q9.aIS@99|">
<field name="COMMENT">Wenn Countdown 0 dann ausschalten</field>
<next>
<block type="controls_if" id="vSnxyO@/gPcwnTc$My)G">
<value name="IF0">
<block type="logic_operation" id="}^0rjh]*rXk(dkuz]0yA" inline="false">
<field name="OP">OR</field>
<value name="A">
<block type="logic_compare" id="vNPGJmV@CSU4,!%hGZU;">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="_5ybG5oG+i[V6U3mOSM4">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.Gartenbewässerung.RemainingDuration</field>
</block>
</value>
<value name="B">
<block type="math_number" id="%)S;3VM77EWMoR,:^sui">
<field name="NUM">0</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="SmFbO28(-cw5T]({-~ar">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="5Ds?n51=yL4X`LgU3X@M">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.Gartenbewässerung.Aktiv_Einschalten</field>
</block>
</value>
<value name="B">
<block type="math_number" id="2/03RaW{gpPu]1S2xEW1">
<field name="NUM">0</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="update" id="k);Wg?v/V-CG(rY4Biz.">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.Gartenbewässerung.SetDuration__Einstellzeit</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_number" id="/ty+pj,^Te]_OwLbc[wf">
<field name="NUM">0</field>
</block>
</value>
<next>
<block type="debug" id="g]CU`p,FPkp:[N[x^wHr">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="u0}QiGY]X/B;OES6CoI!">
<field name="TEXT">SetDuration auf 0 gesetzt</field>
</shadow>
</value>
<next>
<block type="update" id="?R^WCO;T.Z%{J_2%WVmC">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.Gartenbewässerung.Aktiv_Einschalten</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_number" id="dHhCp-n~7h[)/*I4whjV">
<field name="NUM">0</field>
</block>
</value>
<next>
<block type="debug" id="{sId+)SfvzM~W~0jpJr6">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="2]%J6a4KU/{?uoq(guLM">
<field name="TEXT">Aktiv Einschalten auf 0 gesetzt</field>
</shadow>
</value>
<next>
<block type="control" id="Gwa;qs|RR.(pU8AwY4ab">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">sonoff.0.Bewässerung .POWER4</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="Xo`7zzd*=?O9:L8,R31|">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="debug" id="TSiY@u.fibE_vbvOm9%M">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="b/M7cMNcf=hYw#g(A8Nb">
<field name="TEXT">Ventil aus geschaltet</field>
</shadow>
</value>
<next>
<block type="telegram" id="!Wwjd)0j1x3w78?VNLX`">
<field name="INSTANCE"></field>
<field name="LOG"></field>
<field name="SILENT">FALSE</field>
<field name="PARSEMODE">default</field>
<value name="MESSAGE">
<shadow type="text" id="pO3R-vX)3-OrnfN%R=!H">
<field name="TEXT">Rasensprenger ist fertig.</field>
</shadow>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</xml>