NEWS
USV Blockly Script, wie richtig steuern?
-
Habe endlich eine USV und möchte nun per Blockly meinen NUC herunterfahren.
Auf dem NUC läuft Proxmox und ioBroker als VM. NUT Adapter ist installiert.
USV Server läuft auf einer Synology.Das Herunterfahren des NUC ist nicht das Problem. Ich möchte aber eine vernünftige Auswertung des NUT-Adapters hinbekommen, sodass der NUC nicht zu früh herunterfährt. Ich habe das Gefühl dass mein Script noch nicht so reif ist. Wie habt ihr das gelöst?

<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable type="timeout" id="UsvShutdown">UsvShutdown</variable> </variables> <block type="on" id="pVb`;V0hftF;~$sT{/GT" x="13" y="13"> <field name="OID">nut.0.status.online</field> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <statement name="STATEMENT"> <block type="controls_if" id="bX~YJFNu,yj}N0nJ(jRR"> <mutation else="1"></mutation> <value name="IF0"> <block type="logic_compare" id="^ELE0t(K6CeI@lik@C{4"> <field name="OP">EQ</field> <value name="A"> <block type="get_value_var" id="CYqRPD2qkhoFcc2i`#/]"> <field name="ATTR">val</field> <value name="OID"> <shadow xmlns="http://www.w3.org/1999/xhtml" type="text"> <field name="TEXT"></field> </shadow> <block type="field_oid" id="3W__]D|Xo#?Gro`T)l22"> <field name="oid">nut.0.status.online</field> </block> </value> </block> </value> <value name="B"> <block type="logic_boolean" id="OrzqbRNJ!Tsqf}eNcV,k"> <field name="BOOL">FALSE</field> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_cleartimeout" id="P.W*m*GiF,6|efFDW@7*"> <field name="NAME">UsvShutdown</field> <next> <block type="timeouts_settimeout" id="Q+qek?g(`}i}O}A`3l7O"> <field name="NAME">UsvShutdown</field> <field name="DELAY">10</field> <field name="UNIT">min</field> <statement name="STATEMENT"> <block type="control" id="*G/Ke+}=?dnBPmQ*W0.*"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.example_state</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id=":]S#aC6@)0bM~wC9kx?5"> <field name="BOOL">TRUE</field> </block> </value> </block> </statement> </block> </next> </block> </statement> <statement name="ELSE"> <block type="timeouts_cleartimeout" id="2]{pj//_]sL}Gd^[=oDV"> <field name="NAME">UsvShutdown</field> </block> </statement> </block> </statement> </block> </xml> -
Habe endlich eine USV und möchte nun per Blockly meinen NUC herunterfahren.
Auf dem NUC läuft Proxmox und ioBroker als VM. NUT Adapter ist installiert.
USV Server läuft auf einer Synology.Das Herunterfahren des NUC ist nicht das Problem. Ich möchte aber eine vernünftige Auswertung des NUT-Adapters hinbekommen, sodass der NUC nicht zu früh herunterfährt. Ich habe das Gefühl dass mein Script noch nicht so reif ist. Wie habt ihr das gelöst?

<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable type="timeout" id="UsvShutdown">UsvShutdown</variable> </variables> <block type="on" id="pVb`;V0hftF;~$sT{/GT" x="13" y="13"> <field name="OID">nut.0.status.online</field> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <statement name="STATEMENT"> <block type="controls_if" id="bX~YJFNu,yj}N0nJ(jRR"> <mutation else="1"></mutation> <value name="IF0"> <block type="logic_compare" id="^ELE0t(K6CeI@lik@C{4"> <field name="OP">EQ</field> <value name="A"> <block type="get_value_var" id="CYqRPD2qkhoFcc2i`#/]"> <field name="ATTR">val</field> <value name="OID"> <shadow xmlns="http://www.w3.org/1999/xhtml" type="text"> <field name="TEXT"></field> </shadow> <block type="field_oid" id="3W__]D|Xo#?Gro`T)l22"> <field name="oid">nut.0.status.online</field> </block> </value> </block> </value> <value name="B"> <block type="logic_boolean" id="OrzqbRNJ!Tsqf}eNcV,k"> <field name="BOOL">FALSE</field> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_cleartimeout" id="P.W*m*GiF,6|efFDW@7*"> <field name="NAME">UsvShutdown</field> <next> <block type="timeouts_settimeout" id="Q+qek?g(`}i}O}A`3l7O"> <field name="NAME">UsvShutdown</field> <field name="DELAY">10</field> <field name="UNIT">min</field> <statement name="STATEMENT"> <block type="control" id="*G/Ke+}=?dnBPmQ*W0.*"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.example_state</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id=":]S#aC6@)0bM~wC9kx?5"> <field name="BOOL">TRUE</field> </block> </value> </block> </statement> </block> </next> </block> </statement> <statement name="ELSE"> <block type="timeouts_cleartimeout" id="2]{pj//_]sL}Gd^[=oDV"> <field name="NAME">UsvShutdown</field> </block> </statement> </block> </statement> </block> </xml>Erstmal nur den Wert nehmen:

-
Erstmal nur den Wert nehmen:

-
Objekt ID -> Wert auswählen
Hey! Du scheinst an dieser Unterhaltung interessiert zu sein, hast aber noch kein Konto.
Hast du es satt, bei jedem Besuch durch die gleichen Beiträge zu scrollen? Wenn du dich für ein Konto anmeldest, kommst du immer genau dorthin zurück, wo du zuvor warst, und kannst dich über neue Antworten benachrichtigen lassen (entweder per E-Mail oder Push-Benachrichtigung). Du kannst auch Lesezeichen speichern und Beiträge positiv bewerten, um anderen Community-Mitgliedern deine Wertschätzung zu zeigen.
Mit deinem Input könnte dieser Beitrag noch besser werden 💗
Registrieren Anmelden

