NEWS
[Gelößt] Hilfe brauche ein Script
-
Der ansatz ist doch richtig. Der soll den wert in den neu angelegten Datenpunkt schreiben. Wenn ich da Liste eintrage schreibt der mir 3 Werte da rein.
Wie bekomme ich das gelößt ?Ich mus auf jedenfall einen zweiten schreibe Block hinzufügen der mit ID Luftfeuchte.
Grüße
-
@winny1900 sagte:
zweiten schreibe Block hinzufügen der mit ID Luftfeuchte.
Schau mal in den Post davor: Die Variable Liste heißt dort svalue.
-
bei aktualisiere Objekt ID kommt domoticz rein oder ?
Weil das Script bei mir nicht läuft.
17:30:05.712 error javascript.0 script.js.common.Test_2: Cannot get svalue of undefined
17:30:05.713 error javascript.0 at Object.<anonymous> (script.js.common.Test_2:7:35) -
@winny1900 sagte in Hilfe brauche ein Script:
bei aktualisiere Objekt ID kommt domoticz rein oder ?
Nein, beim ersten kommt die ID des Datenpunktes für die Temperaturanzeige und beim zweiten für die Feuchteanzeige rein (steht im Kommentar darüber). domoticz/in kommt beim Trigger rein.
-
hatte ich auch aber klappt nicht !
-
-
<xml xmlns="http://www.w3.org/1999/xhtml"> <variables> <variable type="" id="M3M(d4mStWF20,0YTs8-">svalue</variable> <variable type="" id="rXRrCB6TjAFBN}u0m?94">Wert</variable> </variables> <block type="on_ext" id="?0aUoyJ54YONx4lpTknk" x="-62" y="38"> <mutation items="1"></mutation> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="X@|.GI#NMkm!tpElg:0N"> <field name="oid">mqtt.0.domoticz.in</field> </shadow> <block type="field_oid" id="=|F.L85D:FZ~uR(VAqL9"> <field name="oid">mqtt.0.domoticz.in</field> </block> </value> <statement name="STATEMENT"> <block type="variables_set" id=",$-$oLn`tLQuKnm=HAP?"> <field name="VAR" id="M3M(d4mStWF20,0YTs8-" variabletype="">svalue</field> <value name="VALUE"> <block type="lists_split" id="7:n2~,g/#UErIRm78!bd"> <mutation mode="SPLIT"></mutation> <field name="MODE">SPLIT</field> <value name="INPUT"> <block type="get_attr" id="P6Gq~]6C.+XQ}:j%rL!Q"> <value name="PATH"> <shadow type="text" id="UA6bAniM.d`]{i.G)AUU"> <field name="TEXT">svalue</field> </shadow> <block type="text" id="/]q34ws4q$)`qxanFm83"> <field name="TEXT">svalue</field> </block> </value> <value name="OBJECT"> <block type="variables_get" id="#8(Jdx2lV75rL:?gh}!A"> <field name="VAR" id="rXRrCB6TjAFBN}u0m?94" variabletype="">Wert</field> </block> </value> </block> </value> <value name="DELIM"> <shadow type="text" id="YI.KKD*:?hqMram{#d:R"> <field name="TEXT">;</field> </shadow> <block type="text" id=",XR}u%x}l|~rfkM?eg/."> <field name="TEXT">;</field> </block> </value> </block> </value> <next> <block type="update" id="+Qw~Z-c]b(7XXG;SQ=,-"> <mutation delay_input="false"></mutation> <field name="OID">javascript.0.Außentemp</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="convert_tonumber" id=",KQE85]PB{DEo.#kx,1B"> <value name="VALUE"> <block type="lists_getIndex" id="R+k,Tks}7GP2k!0U7x)8"> <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="wZ6)t!iOCh%It;@{4GZ$"> <field name="VAR" id="M3M(d4mStWF20,0YTs8-" variabletype="">svalue</field> </block> </value> <value name="AT"> <block type="math_number" id="5_zkgF{7ky)jKLqU|;lA"> <field name="NUM">1</field> </block> </value> </block> </value> </block> </value> <next> <block type="update" id="idUi)E`+(nGu=!Zgf}L`"> <mutation delay_input="false"></mutation> <field name="OID">javascript.0.Außenluftfeuchte</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="convert_tonumber" id="(hT.wec}=+(x8(|n@ckG"> <value name="VALUE"> <block type="lists_getIndex" id="|y-mRDdVe%`abvj`+39I"> <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="|1kG5WAlJ35yF,10|i-h"> <field name="VAR" id="M3M(d4mStWF20,0YTs8-" variabletype="">svalue</field> </block> </value> <value name="AT"> <block type="math_number" id="7)gDqXV+Lv~A9(v,]*;}"> <field name="NUM">2</field> </block> </value> </block> </value> </block> </value> </block> </next> </block> </next> </block> </statement> </block> </xml>
-
@winny1900 Wert ist keine Variable, sondern eine Eigenschaft des Triggerdatenpunktes (unter Blöcke Trigger) !
Du kannst auch die Variable Wert umbenennen nach value, damit es funktioniert. -
DANKE !! Danke für dein Geduld es Klappt !!!!
-
So eins noch . Versprochen !!!
Unter JAvascript null zeigt der mir bei der Temp 17 % an statt Grad ?
Wie lösen wir das ?
-
Schon erledigt habe was überlesen. War unter einstellungen.