Hi,
Ich bin auf dein Video und dein Script gestoßen.
So sollte er leichter Adaptierbar sein.
Code
- <xml xmlns="https://developers.google.com/blockly/xml">
- <variables>
- <variable id="%|]TB#teUGeR0wJzu2[Q">connection</variable>
- <variable id="W=X{9dF9~uX1Dl:]=qC{">alive</variable>
- <variable id="CO:ud)z.~aaOJnu;]oWC">stop</variable>
- <variable type="timeout" id="timeout">timeout</variable>
- <variable type="timeout" id="timeout2">timeout2</variable>
- </variables>
- <block type="variables_set" id="F`@l+$8|JV3/~2=OGry?" x="13" y="513">
- <field name="VAR" id="CO:ud)z.~aaOJnu;]oWC">stop</field>
- <value name="VALUE">
- <block type="math_number" id="Wb%4ow@v5^EX]PuImXu.">
- <field name="NUM">0</field>
- </block>
- </value>
- <next>
- <block type="on_ext" id="he^YhuAl30gkIU;SQlwL">
- <mutation xmlns="http://www.w3.org/1999/xhtml" items="2"></mutation>
- <field name="CONDITION">false</field>
- <field name="ACK_CONDITION"></field>
- <value name="OID0">
- <shadow type="field_oid" id="n-S9GM%7lGMzkNz1%f`h">
- <field name="oid">meross.0.info.connection</field>
- </shadow>
- <block type="field_oid" id="Uuo;DCGt}/G;}x$4e#kB">
- <field name="oid">zigbee.0.info.connection</field>
- </block>
- </value>
- <value name="OID1">
- <shadow type="field_oid" id="7-4aA;[o^Qsy8b/htxtN">
- <field name="oid">system.adapter.meross.0.alive</field>
- </shadow>
- <block type="field_oid" id="a=#JF,9rKF@wCf-`E`#M">
- <field name="oid">system.adapter.zigbee.0.alive</field>
- </block>
- </value>
- <statement name="STATEMENT">
- <block type="procedures_callnoreturn" id="i}3C3wW!crSf$%c[{$~o">
- <mutation name="Neustart">
- <arg name="connection"></arg>
- <arg name="alive"></arg>
- </mutation>
- <value name="ARG0">
- <block type="field_oid" id="[r)Q,@U?IPu^/A$zG0og">
- <field name="oid">zigbee.0.info.connection</field>
- </block>
- </value>
- <value name="ARG1">
- <block type="field_oid" id="IgVA=HDdq}Wl;p!|U_~t">
- <field name="oid">system.adapter.zigbee.0.alive</field>
- </block>
- </value>
- </block>
- </statement>
- </block>
- </next>
- </block>
- <block type="procedures_defnoreturn" id="fr.0~GyF:fND6Y4vMv1C" x="13" y="763">
- <mutation>
- <arg name="connection" varid="%|]TB#teUGeR0wJzu2[Q"></arg>
- <arg name="alive" varid="W=X{9dF9~uX1Dl:]=qC{"></arg>
- </mutation>
- <field name="NAME">Neustart</field>
- <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
- <statement name="STACK">
- <block type="controls_if" id="cCW=b58cS6/-z~mv7wzs">
- <value name="IF0">
- <block type="logic_compare" id="x^K/2:0e[GW-E)S+b}eY">
- <field name="OP">EQ</field>
- <value name="A">
- <block type="variables_get" id="~78s{,cAdvf3FRucW1aQ">
- <field name="VAR" id="CO:ud)z.~aaOJnu;]oWC">stop</field>
- </block>
- </value>
- <value name="B">
- <block type="math_number" id="?(vHUd;3SYu$`C9L_s*E">
- <field name="NUM">0</field>
- </block>
- </value>
- </block>
- </value>
- <statement name="DO0">
- <block type="variables_set" id="SHG@Vg.ywYg0GI;dz0QT">
- <field name="VAR" id="CO:ud)z.~aaOJnu;]oWC">stop</field>
- <value name="VALUE">
- <block type="math_number" id="rd9l{r6N~x6%-Os?n*kV">
- <field name="NUM">1</field>
- </block>
- </value>
- <next>
- <block type="control_ex" id="DZ%qH+sqT)oWEl.iBvX8">
- <field name="TYPE">false</field>
- <field name="CLEAR_RUNNING">FALSE</field>
- <value name="OID">
- <shadow type="field_oid">
- <field name="oid">Object ID</field>
- </shadow>
- <block type="variables_get" id="xAhFJU(!!8Q3cx5c[9p/">
- <field name="VAR" id="W=X{9dF9~uX1Dl:]=qC{">alive</field>
- </block>
- </value>
- <value name="VALUE">
- <shadow type="logic_boolean" id=",Oi9|G[L++rb(dfcGg*s">
- <field name="BOOL">FALSE</field>
- </shadow>
- </value>
- <value name="DELAY_MS">
- <shadow type="math_number" id="c-Y-KE}(C[L,[8t7tp~n">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <next>
- <block type="timeouts_settimeout" id="Y(U_MR/(otAkj|Yo-Y,f">
- <field name="NAME">timeout</field>
- <field name="DELAY">10</field>
- <field name="UNIT">sec</field>
- <statement name="STATEMENT">
- <block type="control_ex" id="e1,x`lPj~J2A^[gDeaDM">
- <field name="TYPE">false</field>
- <field name="CLEAR_RUNNING">FALSE</field>
- <value name="OID">
- <shadow type="field_oid">
- <field name="oid">Object ID</field>
- </shadow>
- <block type="variables_get" id="v!8o_@fo6j]Nf[K@9]OA">
- <field name="VAR" id="W=X{9dF9~uX1Dl:]=qC{">alive</field>
- </block>
- </value>
- <value name="VALUE">
- <shadow type="logic_boolean" id="G5z`r_~hy_JW:Nc@}_w8">
- <field name="BOOL">TRUE</field>
- </shadow>
- </value>
- <value name="DELAY_MS">
- <shadow type="math_number" id="ZUN7/n#9YIyVnTEb,Ze!">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <next>
- <block type="timeouts_settimeout" id="FgVj.;@NA=Mz+.=M;2N|">
- <field name="NAME">timeout2</field>
- <field name="DELAY">2</field>
- <field name="UNIT">min</field>
- <statement name="STATEMENT">
- <block type="variables_set" id="*]j-ugbce.-1;|`;=~.{">
- <field name="VAR" id="CO:ud)z.~aaOJnu;]oWC">stop</field>
- <value name="VALUE">
- <block type="math_number" id="RBN0YlYSH@nDEU`/2]U]">
- <field name="NUM">0</field>
- </block>
- </value>
- <next>
- <block type="control_ex" id=",Xv;NM@oPD2NIRG_ZEB|">
- <field name="TYPE">false</field>
- <field name="CLEAR_RUNNING">FALSE</field>
- <value name="OID">
- <shadow type="field_oid" id="emWD-O2f)m1[W{fcSxhb">
- <field name="oid">Object ID</field>
- </shadow>
- <block type="variables_get" id="Wz:tU(Jiy4M6tqa=X!;~">
- <field name="VAR" id="W=X{9dF9~uX1Dl:]=qC{">alive</field>
- </block>
- </value>
- <value name="VALUE">
- <shadow type="logic_boolean" id="zrr(Z/B3.s_L4sRSVZz[">
- <field name="BOOL">TRUE</field>
- </shadow>
- <block type="get_value_var" id="T=]LFjl#(L`mL27gw|2}">
- <field name="ATTR">val</field>
- <value name="OID">
- <shadow type="text" id=",P@SIE;B,8_7Xln%rEcd">
- <field name="TEXT"></field>
- </shadow>
- <block type="variables_get" id="UJ1:)1x7JPJhzfss+j*!">
- <field name="VAR" id="W=X{9dF9~uX1Dl:]=qC{">alive</field>
- </block>
- </value>
- </block>
- </value>
- <value name="DELAY_MS">
- <shadow type="math_number" id="vBFci_:Xj8X@f)[rEm]2">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <next>
- <block type="control_ex" id="3g]N_!M2}Z4n/Sn5?ruF">
- <field name="TYPE">false</field>
- <field name="CLEAR_RUNNING">FALSE</field>
- <value name="OID">
- <shadow type="field_oid" id="(e{3@(~Z6+sFDQJXTjBu">
- <field name="oid">Object ID</field>
- </shadow>
- <block type="variables_get" id="u90@klgSF(8uQ,LPD!Rv">
- <field name="VAR" id="%|]TB#teUGeR0wJzu2[Q">connection</field>
- </block>
- </value>
- <value name="VALUE">
- <shadow type="logic_boolean" id="b;?w=Ua6QR=i!EmOwCS/">
- <field name="BOOL">TRUE</field>
- </shadow>
- <block type="get_value_var" id="|?voR4ktzfn;Bi^n;RLa">
- <field name="ATTR">val</field>
- <value name="OID">
- <shadow type="text" id="yBDO5D%%%3Wc(^FipKs$">
- <field name="TEXT"></field>
- </shadow>
- <block type="variables_get" id="?Dq#`zdI^1ZPZ~0p4y^8">
- <field name="VAR" id="%|]TB#teUGeR0wJzu2[Q">connection</field>
- </block>
- </value>
- </block>
- </value>
- <value name="DELAY_MS">
- <shadow type="math_number" id="i2tc@ds$V]5gRjgu4_rn">
- <field name="NUM">0</field>
- </shadow>
- </value>
- </block>
- </next>
- </block>
- </next>
- </block>
- </statement>
- </block>
- </next>
- </block>
- </statement>
- </block>
- </next>
- </block>
- </next>
- </block>
- </statement>
- </block>
- </statement>
- </block>
- </xml>