- ioBroker Community Home
- Deutsch
- Skripten / Logik
- Blockly
- Philipps Hue letzte settings/zustand Speichern
Philipps Hue letzte settings/zustand Speichern
-
Ich habe ein kleines Blockly gebaut welches den Stand der letzten Settings in Variablen speichert und bsp. nach einem Alarm wieder den Orginal Zustand (wie es vorhin war) wiederherstellt.
Mir gefällt jedoch das Coding nicht wirklich. Am liebsten würde ich gerne den IST Zustand als Objekt speichern und nach meinem Alarm wiederherstellen.
Hat jemand eine Idee wie sich das Blockly optimieren liesse?

-
Ich habe ein kleines Blockly gebaut welches den Stand der letzten Settings in Variablen speichert und bsp. nach einem Alarm wieder den Orginal Zustand (wie es vorhin war) wiederherstellt.
Mir gefällt jedoch das Coding nicht wirklich. Am liebsten würde ich gerne den IST Zustand als Objekt speichern und nach meinem Alarm wiederherstellen.
Hat jemand eine Idee wie sich das Blockly optimieren liesse?

kannst dir ja datenpunkte erstellen welche den ist Zustand aufnehmen, nur dann hast das selbe nur nicht als variablen
dein Skript hat gar kein Trigger ... wenn soll er das denn tun ?
was ist der "toNumber" denn für ein Block, und welche rolle doll er spielen ? der wert den du in die variable aufgenommen hast muss doch schon ein nummerischer wert sein oder ?
ebenso der letzte abschnitt ... wenn er vorher false war steht es doch so in deiner Variable, wozu denn noch mal prüfen ? einfach mit dem wert der variable alle wiederherstellen
Synology DS918+, Fritzbox 6690 Cable, #Docker #Blockly #Vis2 #Deconz #Tasmota
-
kannst dir ja datenpunkte erstellen welche den ist Zustand aufnehmen, nur dann hast das selbe nur nicht als variablen
dein Skript hat gar kein Trigger ... wenn soll er das denn tun ?
was ist der "toNumber" denn für ein Block, und welche rolle doll er spielen ? der wert den du in die variable aufgenommen hast muss doch schon ein nummerischer wert sein oder ?
ebenso der letzte abschnitt ... wenn er vorher false war steht es doch so in deiner Variable, wozu denn noch mal prüfen ? einfach mit dem wert der variable alle wiederherstellen
@dom-sc Ich bin noch am testen deswegen ist da auch noch kein Trigger. Der toNumber ist ein Typecasting weil sonst die Variable den Wert als String gespeichert hatte und ioBroker reklamierte :-).
Das ganze funktioniert auch, nur finde ich den Code hässlich :-). Ich würde gerne den Zustand einmal Triggern und nicht für jeden Wert einzeln.
Bezüglich dem letzten Abschnitt habe ich optimiert, aber auch da war ein Typecasting notwendig :(:

-
@dom-sc Ich bin noch am testen deswegen ist da auch noch kein Trigger. Der toNumber ist ein Typecasting weil sonst die Variable den Wert als String gespeichert hatte und ioBroker reklamierte :-).
Das ganze funktioniert auch, nur finde ich den Code hässlich :-). Ich würde gerne den Zustand einmal Triggern und nicht für jeden Wert einzeln.
Bezüglich dem letzten Abschnitt habe ich optimiert, aber auch da war ein Typecasting notwendig :(:

@flo-0 ich bin noch nicht ganz sicher was du meinst, vielleicht ist es so übersichtlicher für dich

Synology DS918+, Fritzbox 6690 Cable, #Docker #Blockly #Vis2 #Deconz #Tasmota
-
@flo-0 ich bin noch nicht ganz sicher was du meinst, vielleicht ist es so übersichtlicher für dich

@dom-sch sieht etwas besser aus. Würde nur gerne sämtliche Werte als Objekt (bsp. Json) speichern und auch nur einmal zuweisen müssen.
Habe es jetzt mit dem Trigger drin und mal testweise "green" Visualisiert. Funktioniert ganz gut. Nur eben ist das für mich etwas Spaghetti Code ;-). In jeder Programmiersprache würde ich das ganze Objekt kopieren und dann komplett zuweisen. Bin offen für Optimierungen ... :-)

-
@dom-sch sieht etwas besser aus. Würde nur gerne sämtliche Werte als Objekt (bsp. Json) speichern und auch nur einmal zuweisen müssen.
Habe es jetzt mit dem Trigger drin und mal testweise "green" Visualisiert. Funktioniert ganz gut. Nur eben ist das für mich etwas Spaghetti Code ;-). In jeder Programmiersprache würde ich das ganze Objekt kopieren und dann komplett zuweisen. Bin offen für Optimierungen ... :-)

@flo-0 es gibt ja so konvertierungs bausteine:

das übersteigt leider meine Kompetenz, vielleicht findet sich ja noch ein schlauer Kopf der sich dahingehend gut auskennt.
Trotzdem gefällt es mir besser so :) Viel erfolg weiterhin
Synology DS918+, Fritzbox 6690 Cable, #Docker #Blockly #Vis2 #Deconz #Tasmota
-
@flo-0 es gibt ja so konvertierungs bausteine:

das übersteigt leider meine Kompetenz, vielleicht findet sich ja noch ein schlauer Kopf der sich dahingehend gut auskennt.
Trotzdem gefällt es mir besser so :) Viel erfolg weiterhin
@dom-sch sagte in Philipps Hue letzte settings/zustand Speichern:
vielleicht findet sich ja noch ein schlauer Kopf der sich dahingehend gut auskennt.
Der schlaue Kopt @Asgothian hat sich schon gefunden und ein super script für sowas gestrickt. Danke dafür

Bei mir wird getriggert, wenn die USV auf Batteriebetrieb geht. Dann werden alle
hue.0.*.onDatenpunkte in ein Array und anschließend in einen Datenpunkt geschrieben.
Geht die USV wieder vom Batterie- in den Strombetrieb, wird das Array aus dem Datenpunkt gelesen und die Zuständehue.0.*.onwieder hergestellt.Als blockly-Abbild ist es nicht lesbar, aber hier der blockly code:
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="v)ThBW#6*Lwc?/vI,1M2">Liste</variable> <variable id="ZIackd:1cVfq+^O~SCHh">LampenID</variable> <variable id="gTnwbHh{jaMH2Wc,ZJyb">SingleLamp</variable> <variable id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</variable> <variable id="#V`U~..X){!wj7g%RO:S">Index</variable> <variable id="3EuyA}D`Aya}`fF}^k8M">Status</variable> <variable id="4lY1[T_Z6iE@v,UU.ci8">RestoreFromObjectList</variable> <variable id="P`@Z_Qg9hccZE^-7m.Qe">ID</variable> <variable id="aCDz+_:?M/v3g|}He0w@">i</variable> </variables> <block type="procedures_defnoreturn" id="lBCxR(H?$F=0@7N%}2M2" x="187" y="-462"> <mutation> <arg name="Liste" varid="v)ThBW#6*Lwc?/vI,1M2"></arg> </mutation> <field name="NAME">SetObjectsFromList</field> <comment pinned="false" h="80" w="160">Describe this function...</comment> <statement name="STACK"> <block type="debug" id="OcF1YAdl@6ri|KkjK;X!"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="LkxArFuL1Y4I-Lf3AO]f"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="JVHXuizh1OdsLyOct3,~"> <field name="TEXT">SetObjectsFromList</field> </block> </value> <value name="ADD1"> <block type="convert_object2json" id="l{3!klvuwGv#QSYCy^l|"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="cpHzin3Klgc%J@FoM9Ma"> <field name="VAR" id="v)ThBW#6*Lwc?/vI,1M2">Liste</field> </block> </value> </block> </value> </block> </value> <next> <block type="controls_forEach" id="7]d~.LGS1{N*},HUGuj5"> <field name="VAR" id="gTnwbHh{jaMH2Wc,ZJyb">SingleLamp</field> <value name="LIST"> <block type="variables_get" id="Z^a0~N~l*$aJsHv|6Ff^"> <field name="VAR" id="v)ThBW#6*Lwc?/vI,1M2">Liste</field> </block> </value> <statement name="DO"> <block type="variables_set" id="A6we{Tn^x{@_hkFhJ|qc"> <field name="VAR" id="#V`U~..X){!wj7g%RO:S">Index</field> <value name="VALUE"> <block type="text_indexOf" id="nlp_kmY5Q|=@lkxYaM]_"> <field name="END">FIRST</field> <value name="VALUE"> <block type="variables_get" id="1wKVE!%d_#ZMSA8gf#Z$"> <field name="VAR" id="gTnwbHh{jaMH2Wc,ZJyb">SingleLamp</field> </block> </value> <value name="FIND"> <shadow type="text" id="j~tZGKXAc4u~7UsKfEG!"> <field name="TEXT">:</field> </shadow> </value> </block> </value> <next> <block type="variables_set" id="T1k34:Vy!vv9px/:]y2@"> <field name="VAR" id="3EuyA}D`Aya}`fF}^k8M">Status</field> <value name="VALUE"> <block type="text_getSubstring" id="~.,#?Bz8Xbl(SYp_ST%A"> <mutation at1="true" at2="true"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">FROM_START</field> <value name="STRING"> <block type="variables_get" id="uk!W-7Z,^GQi(g2zyG2c"> <field name="VAR" id="gTnwbHh{jaMH2Wc,ZJyb">SingleLamp</field> </block> </value> <value name="AT1"> <block type="math_arithmetic" id="ydiNynl2-f224pjn.HH#"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="HWMJ}Nd6S5RyCH1RXgi)"> <field name="VAR" id="#V`U~..X){!wj7g%RO:S">Index</field> </block> </value> <value name="B"> <shadow type="math_number" id="0}6Ql|fh|md/]@ZhLZ?f"> <field name="NUM">1</field> </shadow> </value> </block> </value> <value name="AT2"> <block type="text_length" id="}m+lmIJi[+s*[1JTqN1Z"> <value name="VALUE"> <shadow type="text"> <field name="TEXT">abc</field> </shadow> <block type="variables_get" id="8c?gvT~A*74az_T.Z`75"> <field name="VAR" id="gTnwbHh{jaMH2Wc,ZJyb">SingleLamp</field> </block> </value> </block> </value> </block> </value> <next> <block type="variables_set" id="t%%m(c[(f;=nTpI4cV5]"> <field name="VAR" id="P`@Z_Qg9hccZE^-7m.Qe">ID</field> <value name="VALUE"> <block type="text_getSubstring" id="@|jyU}5h5!Hdi},X.+c+"> <mutation at1="true" at2="true"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">FROM_START</field> <value name="STRING"> <block type="variables_get" id="}MO?_nm0f[IX0j{T:ooW"> <field name="VAR" id="gTnwbHh{jaMH2Wc,ZJyb">SingleLamp</field> </block> </value> <value name="AT1"> <block type="math_number" id="{_j)K%Y/y*7^~Y(*KbLJ"> <field name="NUM">1</field> </block> </value> <value name="AT2"> <block type="math_arithmetic" id="8/}teXcdlyaQ|Dfu9[HJ"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="v}O=26xs?D1itwTvk6wv"> <field name="VAR" id="#V`U~..X){!wj7g%RO:S">Index</field> </block> </value> <value name="B"> <shadow type="math_number" id="D,XkBU.6z1Lf?{b`|.@@"> <field name="NUM">1</field> </shadow> </value> </block> </value> </block> </value> <next> <block type="controls_if" id="Bi8AbRX*#G}Qy|CHLD1["> <value name="IF0"> <block type="logic_compare" id="-fBNRt=W)%K9QpB;eh4l"> <field name="OP">EQ</field> <value name="A"> <block type="text_indexOf" id="=xNl;;X49VVLc$79@Ee}"> <field name="END">FIRST</field> <value name="VALUE"> <block type="variables_get" id="-vryYngryr71D/!GTcD6"> <field name="VAR" id="P`@Z_Qg9hccZE^-7m.Qe">ID</field> </block> </value> <value name="FIND"> <shadow type="text" id="miq!{.RDij8M[K02B)Lj"> <field name="TEXT">group</field> </shadow> </value> </block> </value> <value name="B"> <block type="math_number" id="dhF7l(h*=m,7_-)NAK^="> <field name="NUM">0</field> </block> </value> </block> </value> <statement name="DO0"> <block type="control_ex" id="a3v8$}$0umJyO,RB[D/o"> <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="HP6:AF5CwZvAH`k_@mIQ"> <field name="VAR" id="P`@Z_Qg9hccZE^-7m.Qe">ID</field> </block> </value> <value name="VALUE"> <shadow type="logic_boolean" id="AZz:7#;Q4+4!,u7N4V44"> <field name="BOOL">TRUE</field> </shadow> <block type="convert_toboolean" id="Yxq9go*s203.+F.$K]q^"> <value name="VALUE"> <block type="variables_get" id="~C6?3}qGF5duTytJ*Mls"> <field name="VAR" id="3EuyA}D`Aya}`fF}^k8M">Status</field> </block> </value> </block> </value> <value name="DELAY_MS"> <shadow type="math_number" id="{j6McaL:r/z4d`c$nBb!"> <field name="NUM">0</field> </shadow> </value> <next> <block type="debug" id="=4g3JL;A1j?!J8}8:4G^"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="CWRr^!51A.iVFG~T,eoY"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="5K|8$m@9s|}Q,^cp;b1H"> <mutation items="4"></mutation> <value name="ADD0"> <block type="text" id="j|5,d~-k~W+?}pUP`sjS"> <field name="TEXT"> ID is </field> </block> </value> <value name="ADD1"> <block type="variables_get" id="+BLrTSG-w4wihOoik4LQ"> <field name="VAR" id="P`@Z_Qg9hccZE^-7m.Qe">ID</field> </block> </value> <value name="ADD2"> <block type="text" id="q?ubUIiR;rA4RV~uW.Ax"> <field name="TEXT"> Status is </field> </block> </value> <value name="ADD3"> <block type="variables_get" id=":S{u@[a(T3V53aNsuCqR"> <field name="VAR" id="3EuyA}D`Aya}`fF}^k8M">Status</field> </block> </value> </block> </value> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </next> </block> </statement> </block> <block type="variables_set" id="bcc[YiKCKws9qzoCzYxM" x="188" y="263"> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> <value name="VALUE"> <block type="selector" id="/)JC5[56*|q8,Nh,jh_b"> <field name="TEXT">state[id='hue.0.*.on']</field> </block> </value> <next> <block type="debug" id="%9qGizhF;(AqDEegXQ9."> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="QbA~ytWq]_J)MuEFTP8c"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="4-LDSneQd~I`dsG9Ngn}"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="A+l]]88{m1:zCeatvlt?"> <field name="TEXT">Ids nach Selector</field> </block> </value> <value name="ADD1"> <block type="convert_object2json" id="_rDX3pS?@jH(Zkql*^wq"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="L5zO`};G[Q^@;@HS^!*J"> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> </block> </value> </block> </value> <next> <block type="variables_set" id="hKs]]R2+0F4ORZf8.-@j"> <field name="VAR" id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</field> <value name="VALUE"> <block type="lists_repeat" id=",;nsW3|9O2{$*5X7Z5TE"> <value name="NUM"> <shadow type="math_number" id="0ig!)FJZ/|1B2nAwMfG]"> <field name="NUM">5</field> </shadow> <block type="lists_length" id="2dV7/Gfm!v.h#iYn8@=K"> <value name="VALUE"> <block type="variables_get" id="]H({cZ0dRZ6i/z:h@I.="> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> </block> </value> <value name="ITEM"> <block type="text" id="9v7qY=kCRqLwm,|ryu|K"> <field name="TEXT">:</field> </block> </value> </block> </value> <next> <block type="debug" id="EI[4FgZ^.Dp[k@rN^B0_"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="T,%.cuHw%=h%/wiTO{`g"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="G2?9wTZ,PjofkBmT/$_2"> <field name="TEXT">States vor Schreiben (C)</field> </block> </value> <value name="ADD1"> <block type="convert_object2json" id="f/7V@j#LJd;BO(pH42xD"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="8c1kcNI^r?+Ac(YszqI+"> <field name="VAR" id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</field> </block> </value> </block> </value> </block> </value> <next> <block type="variables_set" id="AU{#!BgE-!d)BQ[5vjiB"> <field name="VAR" id="4lY1[T_Z6iE@v,UU.ci8">RestoreFromObjectList</field> <value name="VALUE"> <block type="convert_json2object" id="V-Era=pq)XSHHEL,(G=d"> <value name="VALUE"> <block type="get_value" id="Jt-j=gi[r+h`#U|M!f.Y"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.Licht.Hue.Lampenstatus</field> </block> </value> </block> </value> <next> <block type="debug" id="#7MvP;xVTEIi2p?qzPQR"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="0]kiB*j;u:P!JUIL?_6}"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="qc~OB]|4W_%n.S!qKOL*"> <field name="TEXT">States vor Schreiben (B)</field> </block> </value> <value name="ADD1"> <block type="convert_object2json" id="2CnAIs2kZ,]9B=b;s4gI"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="7GC[UtvLEMiL{G6S,-Wm"> <field name="VAR" id="4lY1[T_Z6iE@v,UU.ci8">RestoreFromObjectList</field> </block> </value> </block> </value> </block> </value> <next> <block type="procedures_callnoreturn" id="GXPZT]7L/VB]khTg0yHa"> <mutation name="SetObjectsFromList"> <arg name="Liste"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="?pSo0lu]3}-vF%3kh[dY"> <field name="VAR" id="4lY1[T_Z6iE@v,UU.ci8">RestoreFromObjectList</field> </block> </value> <next> <block type="controls_for" id="0vP32[B@w6[t8kV6gNzO" collapsed="true"> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> <value name="FROM"> <shadow type="math_number" id="Iv,2{(uLGs_D3S8A(Lv`"> <field name="NUM">1</field> </shadow> </value> <value name="TO"> <shadow type="math_number"> <field name="NUM">10</field> </shadow> <block type="lists_length" id="@#Xy|BiK#@bPv|Dfxi:P"> <value name="VALUE"> <block type="variables_get" id="E=LyC~:GJ@9~mLyj6cF("> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> </block> </value> <value name="BY"> <shadow type="math_number" id="86ic_(RvR4.aHr.jm[U/"> <field name="NUM">1</field> </shadow> </value> <statement name="DO"> <block type="debug" id="Fr5.s02e8vS64B{mD^;I"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text"> <field name="TEXT">test</field> </shadow> <block type="text_join" id=")f~j~Jg7h4;b?8Z1$%9Z"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="_~q[CFU);+lc)=K*n$A6"> <field name="TEXT">Element der Liste </field> </block> </value> <value name="ADD1"> <block type="lists_getIndex" id=".^ltk3G;lEV4[o?:ANZr"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="}2b3:RQp}0c.vOCxK_Vc"> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> <value name="AT"> <block type="variables_get" id="wwQ1d|*MMT9E_G-@NBEU"> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> </block> </value> </block> </value> </block> </value> <next> <block type="variables_set" id="ll]`iihz@.)IE((+wwg+"> <field name="VAR" id="3EuyA}D`Aya}`fF}^k8M">Status</field> <value name="VALUE"> <block type="get_value_var" id="#t?S~MjW,5?R8+!ol$~v"> <field name="ATTR">val</field> <value name="OID"> <shadow type="text"> <field name="TEXT"></field> </shadow> <block type="lists_getIndex" id="o7Pg8*pp?L42#yxtkQ,x"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="%1AlS{JCMB*fubv=9!8f"> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> <value name="AT"> <block type="variables_get" id="_?567yOs_EYse-|F_yNG"> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> </block> </value> </block> </value> </block> </value> <next> <block type="lists_setIndex" id="FhK%wR33x9,aW{:=wruE"> <mutation at="true"></mutation> <field name="MODE">SET</field> <field name="WHERE">FROM_START</field> <value name="LIST"> <block type="variables_get" id="-.c2@76~/t,EEqk`~MG0"> <field name="VAR" id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</field> </block> </value> <value name="AT"> <block type="variables_get" id="T5%{.FQwcRgDOEQcTjWu"> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> </block> </value> <value name="TO"> <block type="text_join" id="]eE2nfaIDN~BV2b0HRKk"> <mutation items="3"></mutation> <value name="ADD0"> <block type="lists_getIndex" id="nTdIF;ODA2F*x(WVQ]O)" inline="false"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="fsghM`PU1?^Pe!Z;d68:"> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> <value name="AT"> <block type="variables_get" id="jpaACpbKb,D)0}T;5On4"> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> </block> </value> </block> </value> <value name="ADD1"> <block type="text" id="B#a3Vnx;LTO{x{i$.3SV"> <field name="TEXT">:</field> </block> </value> <value name="ADD2"> <block type="variables_get" id="UAo--tXrG4~3:(VB416m"> <field name="VAR" id="3EuyA}D`Aya}`fF}^k8M">Status</field> </block> </value> </block> </value> </block> </next> </block> </next> </block> </statement> <next> <block type="control" id="vh(8p[!pW*ed|*q{oR00"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Licht.Hue.Lampenstatus</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="convert_object2json" id="(rgrKD|=M=O/NA9WfVJV"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="!}g4^Y1$OR*Dg4gED5;9"> <field name="VAR" id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</field> </block> </value> </block> </value> <next> <block type="control" id=".ybpDlK.V(OzW;4ub#GB"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Licht.Hue.Lampenstatus</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="convert_object2json" id="Fb+D8I^PNONhR~W4a#gK"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="lists_create_with" id="6!km.pJ-=$}-|:(o,S_$"> <mutation items="0"></mutation> </block> </value> </block> </value> <next> <block type="on" id="H:[ZR08R_=uS-U=3o=PE"> <field name="OID">nut.0.status.onbattery</field> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <statement name="STATEMENT"> <block type="comment" id="79pzzKtk_bLFks=v{j}!"> <field name="COMMENT">True: USV auf Batterie, False: </field> <next> <block type="controls_if" id="Wt^_LK+|TQTf5Xs5HSc6"> <mutation else="1"></mutation> <value name="IF0"> <block type="on_source" id="(YWgUdbkcu^dVS[Jw!Nw"> <field name="ATTR">state.val</field> </block> </value> <statement name="DO0"> <block type="controls_for" id="TDg?UKs,xH[uTksG,o^W"> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> <value name="FROM"> <shadow type="math_number" id="=9AIS0BQjt31[}0rVl*_"> <field name="NUM">1</field> </shadow> </value> <value name="TO"> <shadow type="math_number" id="81|Fx9_;#ZvJtpAOa$wp"> <field name="NUM">10</field> </shadow> <block type="lists_length" id="CAW1qY6$oJY;67PulJS`"> <value name="VALUE"> <block type="variables_get" id="Q6w6A.q1#_@nPAD3C1R_"> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> </block> </value> <value name="BY"> <shadow type="math_number" id="M,J4$L0!}T+r@rBGdI~n"> <field name="NUM">1</field> </shadow> </value> <statement name="DO"> <block type="debug" id="o@n3G2TI8d**7YfHY3$i"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="$9u5D9G4%z;CCdc%Mc=a"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="sl#09+/d(@w#2B{{5a^g"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="uCK0ne@HAS3.V%frJU[x"> <field name="TEXT">Element der Liste </field> </block> </value> <value name="ADD1"> <block type="lists_getIndex" id="(7ngt{6By=Tc6uz(KRrw"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="`.,~#WkV?fbqi%%`T}!S"> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> <value name="AT"> <block type="variables_get" id="i7(gMmK,4)KQE04vqUNs"> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> </block> </value> </block> </value> </block> </value> <next> <block type="variables_set" id="6mR{XO..VjRi/brC5-=w"> <field name="VAR" id="3EuyA}D`Aya}`fF}^k8M">Status</field> <value name="VALUE"> <block type="get_value_var" id="kph5NEr,9;Q(dOj;,p4f"> <field name="ATTR">val</field> <value name="OID"> <shadow type="text" id="!$WV.?$gl:O}Eeh$wuhl"> <field name="TEXT"></field> </shadow> <block type="lists_getIndex" id=".[SAYYng4-7X}~?@%MBA"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="b%x0MBMdW+5~H;dDZeE]"> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> <value name="AT"> <block type="variables_get" id="4=g[5-jE`OvY;@L0d4Tj"> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> </block> </value> </block> </value> </block> </value> <next> <block type="lists_setIndex" id=".bXJ^^G]Qb5Q,/X`O{Oa"> <mutation at="true"></mutation> <field name="MODE">SET</field> <field name="WHERE">FROM_START</field> <value name="LIST"> <block type="variables_get" id="1HtNy]GMpt/Mxb]9d(_f"> <field name="VAR" id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</field> </block> </value> <value name="AT"> <block type="variables_get" id="}^/?K_V,fpV?peTALfU("> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> </block> </value> <value name="TO"> <block type="text_join" id="2V]92`csR[[^:o40:cY}"> <mutation items="3"></mutation> <value name="ADD0"> <block type="lists_getIndex" id="Yd%}V(v|g,?U/*.+saqW" inline="false"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id=")H$iN)-%zK7+J(:klOd,"> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> <value name="AT"> <block type="variables_get" id="eiio?P,ADl$w6u0K#7e^"> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> </block> </value> </block> </value> <value name="ADD1"> <block type="text" id=")+7jxZx)2!v_`0|gphyG"> <field name="TEXT">:</field> </block> </value> <value name="ADD2"> <block type="variables_get" id="a;itq:R:5mz/dpw(Z2Es"> <field name="VAR" id="3EuyA}D`Aya}`fF}^k8M">Status</field> </block> </value> </block> </value> </block> </next> </block> </next> </block> </statement> <next> <block type="debug" id="pb,X9kzK:*wo;-P?JO]h"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text"> <field name="TEXT">test</field> </shadow> <block type="text_join" id=".rg?.[c!E`yV}:9{Uhi*"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="*prP~X$U*10doE@M:cox"> <field name="TEXT">States nach Lesen</field> </block> </value> <value name="ADD1"> <block type="convert_object2json" id="-3?VGCw7(S7EhMz.eBzo"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="~4.6%qS!uVi1LMA}:_z3"> <field name="VAR" id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</field> </block> </value> </block> </value> </block> </value> <next> <block type="control" id="w{R$3to}E#v1!Urf)U;M"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Licht.Hue.Lampenstatus</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="convert_object2json" id="M-1u,Dl0]VKZqFEiPq4g"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="dY|cb$DXH|V=zuc{a`4E"> <field name="VAR" id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</field> </block> </value> </block> </value> </block> </next> </block> </next> </block> </statement> <statement name="ELSE"> <block type="debug" id="x!FL{jT[Yc|nnyC;5*Nz"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="X`:,{4/;/{G:dF,!8Ho("> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="o5Lt3N-)giP:=8L:7$PB"> <field name="TEXT">States vor Schreiben (A)</field> </block> </value> <value name="ADD1"> <block type="convert_object2json" id="Fo?Fn{.WSCHEnfODi+Fn"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="e_Eyrjv[X:`.dA#ja]jA"> <field name="VAR" id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</field> </block> </value> </block> </value> </block> </value> <next> <block type="procedures_callnoreturn" id="]W2T8~5=5|x$sm3mn~uu"> <mutation name="SetObjectsFromList"> <arg name="Liste"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="*+5WQd1WpP[8_5)%N}+Q"> <field name="VAR" id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</field> </block> </value> <next> <block type="control" id="Ck|WfGBb=:f{,SPiL+Aj"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Licht.Hue.Lampenstatus</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="convert_object2json" id="bGS9r#7n49{xJ9+K9I}G"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="lists_create_with" id="2%x*Fw0$Ln/4+.DeCpOw"> <mutation items="0"></mutation> </block> </value> </block> </value> </block> </next> </block> </next> </block> </statement> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </xml>Proxmox und HA - dank KI/AI endlich "blocklyfrei"
-
@dom-sch sagte in Philipps Hue letzte settings/zustand Speichern:
vielleicht findet sich ja noch ein schlauer Kopf der sich dahingehend gut auskennt.
Der schlaue Kopt @Asgothian hat sich schon gefunden und ein super script für sowas gestrickt. Danke dafür

Bei mir wird getriggert, wenn die USV auf Batteriebetrieb geht. Dann werden alle
hue.0.*.onDatenpunkte in ein Array und anschließend in einen Datenpunkt geschrieben.
Geht die USV wieder vom Batterie- in den Strombetrieb, wird das Array aus dem Datenpunkt gelesen und die Zuständehue.0.*.onwieder hergestellt.Als blockly-Abbild ist es nicht lesbar, aber hier der blockly code:
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="v)ThBW#6*Lwc?/vI,1M2">Liste</variable> <variable id="ZIackd:1cVfq+^O~SCHh">LampenID</variable> <variable id="gTnwbHh{jaMH2Wc,ZJyb">SingleLamp</variable> <variable id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</variable> <variable id="#V`U~..X){!wj7g%RO:S">Index</variable> <variable id="3EuyA}D`Aya}`fF}^k8M">Status</variable> <variable id="4lY1[T_Z6iE@v,UU.ci8">RestoreFromObjectList</variable> <variable id="P`@Z_Qg9hccZE^-7m.Qe">ID</variable> <variable id="aCDz+_:?M/v3g|}He0w@">i</variable> </variables> <block type="procedures_defnoreturn" id="lBCxR(H?$F=0@7N%}2M2" x="187" y="-462"> <mutation> <arg name="Liste" varid="v)ThBW#6*Lwc?/vI,1M2"></arg> </mutation> <field name="NAME">SetObjectsFromList</field> <comment pinned="false" h="80" w="160">Describe this function...</comment> <statement name="STACK"> <block type="debug" id="OcF1YAdl@6ri|KkjK;X!"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="LkxArFuL1Y4I-Lf3AO]f"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="JVHXuizh1OdsLyOct3,~"> <field name="TEXT">SetObjectsFromList</field> </block> </value> <value name="ADD1"> <block type="convert_object2json" id="l{3!klvuwGv#QSYCy^l|"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="cpHzin3Klgc%J@FoM9Ma"> <field name="VAR" id="v)ThBW#6*Lwc?/vI,1M2">Liste</field> </block> </value> </block> </value> </block> </value> <next> <block type="controls_forEach" id="7]d~.LGS1{N*},HUGuj5"> <field name="VAR" id="gTnwbHh{jaMH2Wc,ZJyb">SingleLamp</field> <value name="LIST"> <block type="variables_get" id="Z^a0~N~l*$aJsHv|6Ff^"> <field name="VAR" id="v)ThBW#6*Lwc?/vI,1M2">Liste</field> </block> </value> <statement name="DO"> <block type="variables_set" id="A6we{Tn^x{@_hkFhJ|qc"> <field name="VAR" id="#V`U~..X){!wj7g%RO:S">Index</field> <value name="VALUE"> <block type="text_indexOf" id="nlp_kmY5Q|=@lkxYaM]_"> <field name="END">FIRST</field> <value name="VALUE"> <block type="variables_get" id="1wKVE!%d_#ZMSA8gf#Z$"> <field name="VAR" id="gTnwbHh{jaMH2Wc,ZJyb">SingleLamp</field> </block> </value> <value name="FIND"> <shadow type="text" id="j~tZGKXAc4u~7UsKfEG!"> <field name="TEXT">:</field> </shadow> </value> </block> </value> <next> <block type="variables_set" id="T1k34:Vy!vv9px/:]y2@"> <field name="VAR" id="3EuyA}D`Aya}`fF}^k8M">Status</field> <value name="VALUE"> <block type="text_getSubstring" id="~.,#?Bz8Xbl(SYp_ST%A"> <mutation at1="true" at2="true"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">FROM_START</field> <value name="STRING"> <block type="variables_get" id="uk!W-7Z,^GQi(g2zyG2c"> <field name="VAR" id="gTnwbHh{jaMH2Wc,ZJyb">SingleLamp</field> </block> </value> <value name="AT1"> <block type="math_arithmetic" id="ydiNynl2-f224pjn.HH#"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="HWMJ}Nd6S5RyCH1RXgi)"> <field name="VAR" id="#V`U~..X){!wj7g%RO:S">Index</field> </block> </value> <value name="B"> <shadow type="math_number" id="0}6Ql|fh|md/]@ZhLZ?f"> <field name="NUM">1</field> </shadow> </value> </block> </value> <value name="AT2"> <block type="text_length" id="}m+lmIJi[+s*[1JTqN1Z"> <value name="VALUE"> <shadow type="text"> <field name="TEXT">abc</field> </shadow> <block type="variables_get" id="8c?gvT~A*74az_T.Z`75"> <field name="VAR" id="gTnwbHh{jaMH2Wc,ZJyb">SingleLamp</field> </block> </value> </block> </value> </block> </value> <next> <block type="variables_set" id="t%%m(c[(f;=nTpI4cV5]"> <field name="VAR" id="P`@Z_Qg9hccZE^-7m.Qe">ID</field> <value name="VALUE"> <block type="text_getSubstring" id="@|jyU}5h5!Hdi},X.+c+"> <mutation at1="true" at2="true"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">FROM_START</field> <value name="STRING"> <block type="variables_get" id="}MO?_nm0f[IX0j{T:ooW"> <field name="VAR" id="gTnwbHh{jaMH2Wc,ZJyb">SingleLamp</field> </block> </value> <value name="AT1"> <block type="math_number" id="{_j)K%Y/y*7^~Y(*KbLJ"> <field name="NUM">1</field> </block> </value> <value name="AT2"> <block type="math_arithmetic" id="8/}teXcdlyaQ|Dfu9[HJ"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="v}O=26xs?D1itwTvk6wv"> <field name="VAR" id="#V`U~..X){!wj7g%RO:S">Index</field> </block> </value> <value name="B"> <shadow type="math_number" id="D,XkBU.6z1Lf?{b`|.@@"> <field name="NUM">1</field> </shadow> </value> </block> </value> </block> </value> <next> <block type="controls_if" id="Bi8AbRX*#G}Qy|CHLD1["> <value name="IF0"> <block type="logic_compare" id="-fBNRt=W)%K9QpB;eh4l"> <field name="OP">EQ</field> <value name="A"> <block type="text_indexOf" id="=xNl;;X49VVLc$79@Ee}"> <field name="END">FIRST</field> <value name="VALUE"> <block type="variables_get" id="-vryYngryr71D/!GTcD6"> <field name="VAR" id="P`@Z_Qg9hccZE^-7m.Qe">ID</field> </block> </value> <value name="FIND"> <shadow type="text" id="miq!{.RDij8M[K02B)Lj"> <field name="TEXT">group</field> </shadow> </value> </block> </value> <value name="B"> <block type="math_number" id="dhF7l(h*=m,7_-)NAK^="> <field name="NUM">0</field> </block> </value> </block> </value> <statement name="DO0"> <block type="control_ex" id="a3v8$}$0umJyO,RB[D/o"> <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="HP6:AF5CwZvAH`k_@mIQ"> <field name="VAR" id="P`@Z_Qg9hccZE^-7m.Qe">ID</field> </block> </value> <value name="VALUE"> <shadow type="logic_boolean" id="AZz:7#;Q4+4!,u7N4V44"> <field name="BOOL">TRUE</field> </shadow> <block type="convert_toboolean" id="Yxq9go*s203.+F.$K]q^"> <value name="VALUE"> <block type="variables_get" id="~C6?3}qGF5duTytJ*Mls"> <field name="VAR" id="3EuyA}D`Aya}`fF}^k8M">Status</field> </block> </value> </block> </value> <value name="DELAY_MS"> <shadow type="math_number" id="{j6McaL:r/z4d`c$nBb!"> <field name="NUM">0</field> </shadow> </value> <next> <block type="debug" id="=4g3JL;A1j?!J8}8:4G^"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="CWRr^!51A.iVFG~T,eoY"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="5K|8$m@9s|}Q,^cp;b1H"> <mutation items="4"></mutation> <value name="ADD0"> <block type="text" id="j|5,d~-k~W+?}pUP`sjS"> <field name="TEXT"> ID is </field> </block> </value> <value name="ADD1"> <block type="variables_get" id="+BLrTSG-w4wihOoik4LQ"> <field name="VAR" id="P`@Z_Qg9hccZE^-7m.Qe">ID</field> </block> </value> <value name="ADD2"> <block type="text" id="q?ubUIiR;rA4RV~uW.Ax"> <field name="TEXT"> Status is </field> </block> </value> <value name="ADD3"> <block type="variables_get" id=":S{u@[a(T3V53aNsuCqR"> <field name="VAR" id="3EuyA}D`Aya}`fF}^k8M">Status</field> </block> </value> </block> </value> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </next> </block> </statement> </block> <block type="variables_set" id="bcc[YiKCKws9qzoCzYxM" x="188" y="263"> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> <value name="VALUE"> <block type="selector" id="/)JC5[56*|q8,Nh,jh_b"> <field name="TEXT">state[id='hue.0.*.on']</field> </block> </value> <next> <block type="debug" id="%9qGizhF;(AqDEegXQ9."> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="QbA~ytWq]_J)MuEFTP8c"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="4-LDSneQd~I`dsG9Ngn}"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="A+l]]88{m1:zCeatvlt?"> <field name="TEXT">Ids nach Selector</field> </block> </value> <value name="ADD1"> <block type="convert_object2json" id="_rDX3pS?@jH(Zkql*^wq"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="L5zO`};G[Q^@;@HS^!*J"> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> </block> </value> </block> </value> <next> <block type="variables_set" id="hKs]]R2+0F4ORZf8.-@j"> <field name="VAR" id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</field> <value name="VALUE"> <block type="lists_repeat" id=",;nsW3|9O2{$*5X7Z5TE"> <value name="NUM"> <shadow type="math_number" id="0ig!)FJZ/|1B2nAwMfG]"> <field name="NUM">5</field> </shadow> <block type="lists_length" id="2dV7/Gfm!v.h#iYn8@=K"> <value name="VALUE"> <block type="variables_get" id="]H({cZ0dRZ6i/z:h@I.="> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> </block> </value> <value name="ITEM"> <block type="text" id="9v7qY=kCRqLwm,|ryu|K"> <field name="TEXT">:</field> </block> </value> </block> </value> <next> <block type="debug" id="EI[4FgZ^.Dp[k@rN^B0_"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="T,%.cuHw%=h%/wiTO{`g"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="G2?9wTZ,PjofkBmT/$_2"> <field name="TEXT">States vor Schreiben (C)</field> </block> </value> <value name="ADD1"> <block type="convert_object2json" id="f/7V@j#LJd;BO(pH42xD"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="8c1kcNI^r?+Ac(YszqI+"> <field name="VAR" id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</field> </block> </value> </block> </value> </block> </value> <next> <block type="variables_set" id="AU{#!BgE-!d)BQ[5vjiB"> <field name="VAR" id="4lY1[T_Z6iE@v,UU.ci8">RestoreFromObjectList</field> <value name="VALUE"> <block type="convert_json2object" id="V-Era=pq)XSHHEL,(G=d"> <value name="VALUE"> <block type="get_value" id="Jt-j=gi[r+h`#U|M!f.Y"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.Licht.Hue.Lampenstatus</field> </block> </value> </block> </value> <next> <block type="debug" id="#7MvP;xVTEIi2p?qzPQR"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="0]kiB*j;u:P!JUIL?_6}"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="qc~OB]|4W_%n.S!qKOL*"> <field name="TEXT">States vor Schreiben (B)</field> </block> </value> <value name="ADD1"> <block type="convert_object2json" id="2CnAIs2kZ,]9B=b;s4gI"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="7GC[UtvLEMiL{G6S,-Wm"> <field name="VAR" id="4lY1[T_Z6iE@v,UU.ci8">RestoreFromObjectList</field> </block> </value> </block> </value> </block> </value> <next> <block type="procedures_callnoreturn" id="GXPZT]7L/VB]khTg0yHa"> <mutation name="SetObjectsFromList"> <arg name="Liste"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="?pSo0lu]3}-vF%3kh[dY"> <field name="VAR" id="4lY1[T_Z6iE@v,UU.ci8">RestoreFromObjectList</field> </block> </value> <next> <block type="controls_for" id="0vP32[B@w6[t8kV6gNzO" collapsed="true"> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> <value name="FROM"> <shadow type="math_number" id="Iv,2{(uLGs_D3S8A(Lv`"> <field name="NUM">1</field> </shadow> </value> <value name="TO"> <shadow type="math_number"> <field name="NUM">10</field> </shadow> <block type="lists_length" id="@#Xy|BiK#@bPv|Dfxi:P"> <value name="VALUE"> <block type="variables_get" id="E=LyC~:GJ@9~mLyj6cF("> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> </block> </value> <value name="BY"> <shadow type="math_number" id="86ic_(RvR4.aHr.jm[U/"> <field name="NUM">1</field> </shadow> </value> <statement name="DO"> <block type="debug" id="Fr5.s02e8vS64B{mD^;I"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text"> <field name="TEXT">test</field> </shadow> <block type="text_join" id=")f~j~Jg7h4;b?8Z1$%9Z"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="_~q[CFU);+lc)=K*n$A6"> <field name="TEXT">Element der Liste </field> </block> </value> <value name="ADD1"> <block type="lists_getIndex" id=".^ltk3G;lEV4[o?:ANZr"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="}2b3:RQp}0c.vOCxK_Vc"> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> <value name="AT"> <block type="variables_get" id="wwQ1d|*MMT9E_G-@NBEU"> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> </block> </value> </block> </value> </block> </value> <next> <block type="variables_set" id="ll]`iihz@.)IE((+wwg+"> <field name="VAR" id="3EuyA}D`Aya}`fF}^k8M">Status</field> <value name="VALUE"> <block type="get_value_var" id="#t?S~MjW,5?R8+!ol$~v"> <field name="ATTR">val</field> <value name="OID"> <shadow type="text"> <field name="TEXT"></field> </shadow> <block type="lists_getIndex" id="o7Pg8*pp?L42#yxtkQ,x"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="%1AlS{JCMB*fubv=9!8f"> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> <value name="AT"> <block type="variables_get" id="_?567yOs_EYse-|F_yNG"> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> </block> </value> </block> </value> </block> </value> <next> <block type="lists_setIndex" id="FhK%wR33x9,aW{:=wruE"> <mutation at="true"></mutation> <field name="MODE">SET</field> <field name="WHERE">FROM_START</field> <value name="LIST"> <block type="variables_get" id="-.c2@76~/t,EEqk`~MG0"> <field name="VAR" id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</field> </block> </value> <value name="AT"> <block type="variables_get" id="T5%{.FQwcRgDOEQcTjWu"> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> </block> </value> <value name="TO"> <block type="text_join" id="]eE2nfaIDN~BV2b0HRKk"> <mutation items="3"></mutation> <value name="ADD0"> <block type="lists_getIndex" id="nTdIF;ODA2F*x(WVQ]O)" inline="false"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="fsghM`PU1?^Pe!Z;d68:"> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> <value name="AT"> <block type="variables_get" id="jpaACpbKb,D)0}T;5On4"> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> </block> </value> </block> </value> <value name="ADD1"> <block type="text" id="B#a3Vnx;LTO{x{i$.3SV"> <field name="TEXT">:</field> </block> </value> <value name="ADD2"> <block type="variables_get" id="UAo--tXrG4~3:(VB416m"> <field name="VAR" id="3EuyA}D`Aya}`fF}^k8M">Status</field> </block> </value> </block> </value> </block> </next> </block> </next> </block> </statement> <next> <block type="control" id="vh(8p[!pW*ed|*q{oR00"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Licht.Hue.Lampenstatus</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="convert_object2json" id="(rgrKD|=M=O/NA9WfVJV"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="!}g4^Y1$OR*Dg4gED5;9"> <field name="VAR" id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</field> </block> </value> </block> </value> <next> <block type="control" id=".ybpDlK.V(OzW;4ub#GB"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Licht.Hue.Lampenstatus</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="convert_object2json" id="Fb+D8I^PNONhR~W4a#gK"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="lists_create_with" id="6!km.pJ-=$}-|:(o,S_$"> <mutation items="0"></mutation> </block> </value> </block> </value> <next> <block type="on" id="H:[ZR08R_=uS-U=3o=PE"> <field name="OID">nut.0.status.onbattery</field> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <statement name="STATEMENT"> <block type="comment" id="79pzzKtk_bLFks=v{j}!"> <field name="COMMENT">True: USV auf Batterie, False: </field> <next> <block type="controls_if" id="Wt^_LK+|TQTf5Xs5HSc6"> <mutation else="1"></mutation> <value name="IF0"> <block type="on_source" id="(YWgUdbkcu^dVS[Jw!Nw"> <field name="ATTR">state.val</field> </block> </value> <statement name="DO0"> <block type="controls_for" id="TDg?UKs,xH[uTksG,o^W"> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> <value name="FROM"> <shadow type="math_number" id="=9AIS0BQjt31[}0rVl*_"> <field name="NUM">1</field> </shadow> </value> <value name="TO"> <shadow type="math_number" id="81|Fx9_;#ZvJtpAOa$wp"> <field name="NUM">10</field> </shadow> <block type="lists_length" id="CAW1qY6$oJY;67PulJS`"> <value name="VALUE"> <block type="variables_get" id="Q6w6A.q1#_@nPAD3C1R_"> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> </block> </value> <value name="BY"> <shadow type="math_number" id="M,J4$L0!}T+r@rBGdI~n"> <field name="NUM">1</field> </shadow> </value> <statement name="DO"> <block type="debug" id="o@n3G2TI8d**7YfHY3$i"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="$9u5D9G4%z;CCdc%Mc=a"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="sl#09+/d(@w#2B{{5a^g"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="uCK0ne@HAS3.V%frJU[x"> <field name="TEXT">Element der Liste </field> </block> </value> <value name="ADD1"> <block type="lists_getIndex" id="(7ngt{6By=Tc6uz(KRrw"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="`.,~#WkV?fbqi%%`T}!S"> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> <value name="AT"> <block type="variables_get" id="i7(gMmK,4)KQE04vqUNs"> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> </block> </value> </block> </value> </block> </value> <next> <block type="variables_set" id="6mR{XO..VjRi/brC5-=w"> <field name="VAR" id="3EuyA}D`Aya}`fF}^k8M">Status</field> <value name="VALUE"> <block type="get_value_var" id="kph5NEr,9;Q(dOj;,p4f"> <field name="ATTR">val</field> <value name="OID"> <shadow type="text" id="!$WV.?$gl:O}Eeh$wuhl"> <field name="TEXT"></field> </shadow> <block type="lists_getIndex" id=".[SAYYng4-7X}~?@%MBA"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="b%x0MBMdW+5~H;dDZeE]"> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> <value name="AT"> <block type="variables_get" id="4=g[5-jE`OvY;@L0d4Tj"> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> </block> </value> </block> </value> </block> </value> <next> <block type="lists_setIndex" id=".bXJ^^G]Qb5Q,/X`O{Oa"> <mutation at="true"></mutation> <field name="MODE">SET</field> <field name="WHERE">FROM_START</field> <value name="LIST"> <block type="variables_get" id="1HtNy]GMpt/Mxb]9d(_f"> <field name="VAR" id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</field> </block> </value> <value name="AT"> <block type="variables_get" id="}^/?K_V,fpV?peTALfU("> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> </block> </value> <value name="TO"> <block type="text_join" id="2V]92`csR[[^:o40:cY}"> <mutation items="3"></mutation> <value name="ADD0"> <block type="lists_getIndex" id="Yd%}V(v|g,?U/*.+saqW" inline="false"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id=")H$iN)-%zK7+J(:klOd,"> <field name="VAR" id="ZIackd:1cVfq+^O~SCHh">LampenID</field> </block> </value> <value name="AT"> <block type="variables_get" id="eiio?P,ADl$w6u0K#7e^"> <field name="VAR" id="aCDz+_:?M/v3g|}He0w@">i</field> </block> </value> </block> </value> <value name="ADD1"> <block type="text" id=")+7jxZx)2!v_`0|gphyG"> <field name="TEXT">:</field> </block> </value> <value name="ADD2"> <block type="variables_get" id="a;itq:R:5mz/dpw(Z2Es"> <field name="VAR" id="3EuyA}D`Aya}`fF}^k8M">Status</field> </block> </value> </block> </value> </block> </next> </block> </next> </block> </statement> <next> <block type="debug" id="pb,X9kzK:*wo;-P?JO]h"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text"> <field name="TEXT">test</field> </shadow> <block type="text_join" id=".rg?.[c!E`yV}:9{Uhi*"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="*prP~X$U*10doE@M:cox"> <field name="TEXT">States nach Lesen</field> </block> </value> <value name="ADD1"> <block type="convert_object2json" id="-3?VGCw7(S7EhMz.eBzo"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="~4.6%qS!uVi1LMA}:_z3"> <field name="VAR" id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</field> </block> </value> </block> </value> </block> </value> <next> <block type="control" id="w{R$3to}E#v1!Urf)U;M"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Licht.Hue.Lampenstatus</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="convert_object2json" id="M-1u,Dl0]VKZqFEiPq4g"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="dY|cb$DXH|V=zuc{a`4E"> <field name="VAR" id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</field> </block> </value> </block> </value> </block> </next> </block> </next> </block> </statement> <statement name="ELSE"> <block type="debug" id="x!FL{jT[Yc|nnyC;5*Nz"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="X`:,{4/;/{G:dF,!8Ho("> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="o5Lt3N-)giP:=8L:7$PB"> <field name="TEXT">States vor Schreiben (A)</field> </block> </value> <value name="ADD1"> <block type="convert_object2json" id="Fo?Fn{.WSCHEnfODi+Fn"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="e_Eyrjv[X:`.dA#ja]jA"> <field name="VAR" id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</field> </block> </value> </block> </value> </block> </value> <next> <block type="procedures_callnoreturn" id="]W2T8~5=5|x$sm3mn~uu"> <mutation name="SetObjectsFromList"> <arg name="Liste"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="*+5WQd1WpP[8_5)%N}+Q"> <field name="VAR" id="`6fxSgAi_*c!=]CkYML9">StatusVorStromausfall</field> </block> </value> <next> <block type="control" id="Ck|WfGBb=:f{,SPiL+Aj"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Licht.Hue.Lampenstatus</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="convert_object2json" id="bGS9r#7n49{xJ9+K9I}G"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="lists_create_with" id="2%x*Fw0$Ln/4+.DeCpOw"> <mutation items="0"></mutation> </block> </value> </block> </value> </block> </next> </block> </next> </block> </statement> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </xml>Vielen Dank euch beiden. Bin gerade von den Bergen zurück :-). Genau nach sowas habe ich gesucht.
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