Falls ein Adapter mal "Gelb" oder "Rot" wird, versucht das Script den Adapter neu zu starten.
Wenn man den Adapter "wirklich" deaktivieren möchte, muss man vorher dieses Script deaktivieren. Sonnst startet der Adapter neu da dieses Script... siehe Überschrift
Code
- <xml xmlns="http://www.w3.org/1999/xhtml">
- <variables>
- <variable type="" id="CO:ud)z.~aaOJnu;]oWC">stop</variable>
- <variable type="undefined" id="timeout">timeout</variable>
- <variable type="undefined" id="timeout2">timeout2</variable>
- </variables>
- <block type="variables_set" id="F`@l+$8|JV3/~2=OGry?" x="-362" y="-237">
- <field name="VAR" id="CO:ud)z.~aaOJnu;]oWC" variabletype="">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 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>
- </value>
- <value name="OID1">
- <shadow type="field_oid" id="7-4aA;[o^Qsy8b/htxtN">
- <field name="oid">system.adapter.meross.0.alive</field>
- </shadow>
- </value>
- <statement name="STATEMENT">
- <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" variabletype="">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" variabletype="">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" id="#yM,3nvcL%EOYUTm}z#v">
- <mutation delay_input="false"></mutation>
- <field name="OID">system.adapter.meross.0.alive</field>
- <field name="WITH_DELAY">FALSE</field>
- <value name="VALUE">
- <block type="logic_boolean" id="q#)O8@9Y|HVrhYkG(]JM">
- <field name="BOOL">FALSE</field>
- </block>
- </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" id=")ebirWpfd]UqK07M*z|R">
- <mutation delay_input="false"></mutation>
- <field name="OID">system.adapter.meross.0.alive</field>
- <field name="WITH_DELAY">FALSE</field>
- <value name="VALUE">
- <block type="logic_boolean" id="U(.{+#)8|Pj9vA(MxNAP">
- <field name="BOOL">TRUE</field>
- </block>
- </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" variabletype="">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" id="i9D7@=y*dtRcf+6Cw=AD">
- <mutation delay_input="false"></mutation>
- <field name="OID">system.adapter.meross.0.alive</field>
- <field name="WITH_DELAY">FALSE</field>
- <value name="VALUE">
- <block type="get_value" id="N/kuP=+%xjir^g+@,Mpx">
- <field name="ATTR">val</field>
- <field name="OID">system.adapter.meross.0.alive</field>
- </block>
- </value>
- <next>
- <block type="control" id="T]wfb!#jw88?nmuFr@CA">
- <mutation delay_input="false"></mutation>
- <field name="OID">meross.0.info.connection</field>
- <field name="WITH_DELAY">FALSE</field>
- <value name="VALUE">
- <block type="get_value" id=".~G!NQcfz`p,lFWh0Zos">
- <field name="ATTR">val</field>
- <field name="OID">meross.0.info.connection</field>
- </block>
- </value>
- </block>
- </next>
- </block>
- </next>
- </block>
- </statement>
- </block>
- </next>
- </block>
- </statement>
- </block>
- </next>
- </block>
- </next>
- </block>
- </statement>
- </block>
- </statement>
- </block>
- </next>
- </block>
- </xml>