NEWS
[Javascript] Midas (Aquatemp) Poolheizung
-
Hallo zusammen, ist bei euch auch aus der App eure Wärmepumpe rausgeflogen? Auch das Script findet dadurch logischerweise keine Pumpe mehr
Gruß
-
@sunnylaila Nö. Bei mir alles schick. Gab unter Android aber gestern ein Update.
Ich fürchte, Du musst neu anlernen
-
Also ich habe eine Inverpro 21 und nutze die Aqua Temp App.
Jetzt wollte ich via dem Script sie in mein Iob einbinden, leider erfolglos.
Was kann ich tun?
Kann mir jemand das Standard PW für die Parametereinstellungen geben?îch habe jetzt mal im IOB full logging eingestellt, mit dem Ergebnis: javascript.0 (3274326) script.js.Marco.Pool_Heizung: {"statusCode":200,"body":{"error_code":"-1","error_msg":"Error username or password","error_msg_code":"","is_reuslt_suc":false},"headers":{"date":"Wed, 21 Jun 2023 15:47:27 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","set-cookie":["JSESSIONID=BA17FF10AC237A5DF895C0B24C475BA1; Path=/cloudservice; HttpOnly"]},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com","port":443,"hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/cloudservice/api/app/user/login.json","path":"/cloudservice/api/app/user/login.json","href":"https://cloud.linked-go.com/cloudservice/api/app/user/login.json"},"method":"POST","headers":{"accept":"application/json","content-type":"application/json","content-length":83}}}
-
@radi71 Habe nochmal ein paar weitere Product-IDs gefunden. Versuche bitte mal das aktuelle Skript aus dem ersten Post.
-
@oxident
Aber es war ja ein loginfehler: Error username or passwordUnd das war ganz richtig, ohne komische Sonderzeichen
-
@radi71 Ja, richtig. Und beim Username gibtst Du auch die eMail-Adresse ein, oder?
-
@oxident
Ja genau und beim PW auch das Passwort -
Hallo Zusammen,
ich habe heute auch den WLAN Adapter an meiner Poolsana Prime 10 in Betrieb genommen. Die Aqua Temp App ist installiert und läuft.
Im IoBroker habe ich jetzt das Script unter Scripte angelegt und meine Daten eingetragen. Unter Objekte wurde auch der Ordner Poolheizung angelegt:
Leider bekomme ich keine Daten.
Habe im Script noch meine ProduktID ergänzt, hat aber auch nicht gebraucht.
Hat noch jemand eine Idee?
Hier noch das Log aus dem IoBroker:
Danke. Grüße
-
@pietnb Komisch. Kannst Du mal folgendes Skript probieren und vorher alle Datenpunkte wieder löschen?
// Midas Poolheizung // v0.0.7 // Changelog: // 0.0.7: Kleinigkeiten überarbeitet // weitere Modelle hinzugefügt // 0.0.6: Gültigkeitsprüfung des Zertifikats deaktiviert (Dank an znyde) // Kompatibilität mit Promo Next Modellen durch generische Product-ID (Dank an znyde) // 0.0.5: weitere Abfragewerte hinzugefügt (Kompressor- und Ansaugtemperatur) // 0.0.4: Tokenverfall jetzt 60min nach Skriptstart und nicht zu jeder vollen Stunde (Dank an dering) // 0.0.3: Datenpunkte beim Start automatisch anlegen (Dank an Andy200877) // 0.0.2: Token bei jedem Set-Vorgang prüfen und ggf. neu anfordern (Dank an dering) const username = "EMAIL"; const password = "KENNWORT"; const interval = 30; const cloudURL = "https://cloud.linked-go.com/cloudservice/api"; const dpRoot = "0_userdata.0.Poolheizung"; var token = ""; var tokenRefreshTimer; var device = ""; var reachable = false; function clearValues() { saveValue("error", true, "boolean"); saveValue("consumption", 0, "number"); saveValue("state", false, "boolean"); } function saveValue(key, value, sType) { var dp = dpRoot + "." + key; if ( !existsState(dp )) { createState(dp,value,{name: key, type: 'number', role: 'value'}, function () {}); } else { setState(dp,value,true); } } function findCodeVal(result, code) { //log(code); for(var i=0; i<result.length; i++) { //log(result[i].code); if(result[i].code.indexOf(code) >= 0) { return result[i].value; } } return ""; } function createobjects() { log ("erstelle Objekte"); createState(dpRoot + '.ambient', {read: true, write: false, type: "number", unit:"°C", name: "Umgebungstemperatur"}); createState(dpRoot + '.connection', {read: true, write: false, type: "boolean", role: "state", name: "Verbindung", def: false}); createState(dpRoot + '.consumption', {read: true, write: false, type: "number", unit:"W", name: "Stromverbrauch", def: 0}); createState(dpRoot + '.error', {read: true, write: false, type: "boolean", role: "state", name: "Fehler", def: false}); createState(dpRoot + '.errorCode', {read: true, write: false, type: "string", name: "Fehlercode", def: ""}); createState(dpRoot + '.errorLevel', {read: true, write: false, type: "number", name: "Fehlerlevel"}); createState(dpRoot + '.errorMessage', {read: true, write: false, type: "string", name: "Fehlermeldung", def: ""}); createState(dpRoot + '.mode', {read: true, write: true, type: "string", states: "-1:off;0:cool;1:heat;2:auto", name: "Modus", def: ""}); createState(dpRoot + '.rotor', {read: true, write: false, type: "number", unit:"rpm", def: 0, name: "Lüfterdrehzahl"}); createState(dpRoot + '.silent', {read: true, write: true, type: "boolean", role: "state", name: "Silent", def: false}); createState(dpRoot + '.state', {read: true, write: false, type: "boolean", role: "state", name: "Status", def: false}); createState(dpRoot + '.tempIn', {read: true, write: false, type: "number", unit:"°C", name: "Eingangstemperatur"}); createState(dpRoot + '.tempOut', {read: true, write: false, type: "number", unit:"°C", name: "Ausgangstemperatur"}); createState(dpRoot + '.tempSet', {read: true, write: true, type: "number", unit:"°C", name: "Solltemperatur"}); createState(dpRoot + '.suctionTemp', {read: true, write: false, type: "number", unit:"°C", name: "Luftansaugtemperatur"}); createState(dpRoot + '.coilTemp', {read: true, write: false, type: "number", unit:"°C", name: "Kompressortemperatur"}); createState(dpRoot + '.rawJSON', {read: true, write: false, type: "array", name: "komplette Rückgabe"}); } function updateToken() { if(token=="") { //log("Token Neuanforderung"); var request = require('request'); var options = { url: cloudURL + '/app/user/login.json', method: 'POST', json: { "user_name": username, "password": password, "type": "2" }, rejectUnauthorized: false }; request(options,function (error, response, body){ //log(JSON.stringify(response)); if(parseInt(body.error_code)==0) { token = body.object_result["x-token"]; //log("Login ok! Token " + token); updateDeviceID(); } else { // Login-Fehler //log("Login-Fehler in updateToken(): " + response.body, "error"); token = ""; saveValue("connection", false, "boolean"); } }); } else { updateDeviceID(); } } function updateDeviceID() { if(token!="") { var optionsDev = { url: cloudURL + '/app/device/deviceList.json', headers: { "x-token": token }, body: {product_ids: [ "1132174963097280512", "1186904563333062656", "1158905952238313472", "1245226668902080512", "1442284873216843776", "1548963836789501952", ]}, method: 'POST', json: true, rejectUnauthorized: false }; var request = require('request'); request(optionsDev,function (error, response, body){ //log(JSON.stringify(response)); //log(JSON.stringify(body.object_result)); if(parseInt(body.error_code)==0) { //token = body.object_result["x-token"]; //log("Login ok! Token " + token); device = body.object_result[0].device_code; reachable = (body.object_result[0].device_status=="ONLINE"); if(reachable) { saveValue("connection", true, "boolean"); if(device!="") updateDeviceStatus(device); } else { // offline device = ""; saveValue("connection", false, "boolean"); } } else { // Login-Fehler //log("Fehler in updateDeviceID(): " + response.body, "error"); token = ""; device = ""; reachable = false; saveValue("connection", false, "boolean"); } }); } } function updateDeviceStatus(devicecode) { if(token!="") { var optionsDev = { url: cloudURL + '/app/device/getDeviceStatus.json', headers: { "x-token": token }, json: { "device_code": devicecode }, method: 'POST', rejectUnauthorized: false }; var request = require('request'); request(optionsDev,function (error, response, body){ //log(JSON.stringify(response)); //log(JSON.stringify(body.object_result)); if(parseInt(body.error_code)==0) { if(body.object_result["is_fault"]==true) { // TODO: Fehlerbeschreibung abrufen //clearValues(); saveValue("error", true, "boolean"); updateDeviceDetails(devicecode); updateDeviceErrorMsg(devicecode); } else { // kein Fehler saveValue("error", false, "boolean"); saveValue("errorMessage", "", "string"); saveValue("errorCode", "", "string"); saveValue("errorLevel", 0, "number"); updateDeviceDetails(devicecode); } //token = body.object_result["x-token"]; //log("Login ok! Token " + token); } else { // Login-Fehler //log("Fehler in updateDeviceStatus(): " + response.body, "error"); token = ""; device = ""; saveValue("connection", false, "boolean"); } }); } } function updateDeviceErrorMsg(devicecode) { if(token!="") { var optionsDev = { url: cloudURL + '/app/device/getFaultDataByDeviceCode.json', headers: { "x-token": token }, json: { "device_code": devicecode }, method: 'POST', rejectUnauthorized: false //headers: {"content-type": "application/json"}, //charset: 'utf8', //json: true }; var request = require('request'); request(optionsDev,function (error, response, body){ //log(JSON.stringify(response)); //log(JSON.stringify(body.object_result)); if(parseInt(body.error_code)==0) { saveValue("error", true, "boolean"); saveValue("errorMessage", body.object_result[0].description, "string"); saveValue("errorCode", body.object_result[0].fault_code, "string"); saveValue("errorLevel", body.object_result[0].error_level, "string"); } else { // Login-Fehler //log("Fehler in updateDeviceErrorMsg(): " + response.body, "error"); token = ""; device = ""; saveValue("connection", false, "boolean"); } }); } } function updateDeviceDetails(devicecode) { if(token!="") { var optionsDev = { url: cloudURL + '/app/device/getDataByCode.json', headers: { "x-token": token }, json: { "device_code": devicecode, "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05","T07","T14","T17"] }, // "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05"] method: 'POST', rejectUnauthorized: false }; var request = require('request'); request(optionsDev,function (error, response, body){ if(parseInt(body.error_code)==0) { saveValue("rawJSON", body.object_result, "string"); if(findCodeVal(body.object_result, "Power")=="1") { // Stromverbrauch T07 x T14 in Watt saveValue("consumption", parseFloat(findCodeVal(body.object_result, "T07")) * parseFloat(findCodeVal(body.object_result, "T14")), "number"); // Lüfter-Drehzahl T17 saveValue("rotor", parseInt(findCodeVal(body.object_result, "T17")), "number"); // Luftansaug-Temperatur T01 saveValue("suctionTemp", parseFloat(findCodeVal(body.object_result, "T01")), "number"); // Inlet-Temperatur T02 saveValue("tempIn", parseFloat(findCodeVal(body.object_result, "T02")), "number"); // outlet-Temperatur T03 saveValue("tempOut", parseFloat(findCodeVal(body.object_result, "T03")), "number"); // Coil-Temperatur T04 saveValue("coilTemp", parseFloat(findCodeVal(body.object_result, "T04")), "number"); } else { saveValue("consumption", 0, "number"); saveValue("rotor", 0, "number"); } // Ziel-Temperatur Set_Temp saveValue("tempSet", parseFloat(findCodeVal(body.object_result, "Set_Temp")), "number"); // Umgebungs-Temperatur T05 saveValue("ambient", parseFloat(findCodeVal(body.object_result, "T05")), "number"); // Flüstermodus Manual-mute if(findCodeVal(body.object_result, "Manual-mute")=="1") { saveValue("silent", true, "boolean"); } else { saveValue("silent", false, "boolean"); } // Zustand Power if(findCodeVal(body.object_result, "Power")=="1") { saveValue("state", true, "boolean"); saveValue("mode", findCodeVal(body.object_result,"Mode"), "string"); } else { saveValue("state", false, "boolean"); saveValue("mode", "-1", "string"); } saveValue("connection", true, "boolean"); // Durchlauf ENDE //log(findCodeVal(body.object_result, "T07")); } else { // Login-Fehler //log("Fehler in updateDeviceDetails(): " + response.body, "error"); token = ""; device = ""; saveValue("connection", false, "boolean"); } }); } } function updateDevicePower(devicecode, power) { var powerOpt; var powerMode = 2; if(power==-1) { // aus powerOpt = 0; powerMode = -1; } else if(power==0) { // an und kühlen powerOpt = 1; powerMode = 0; } else if(power==1) { // an und heizen powerOpt = 1; powerMode = 1; } else if(power==2) { // an und auto powerOpt = 1; powerMode = 2; } else { log("ungülter Zustand!"); return; } if(token!="") { var optionsDev = { url: cloudURL + '/app/device/control.json', headers: { "x-token": token }, json: {"param":[{ "device_code": devicecode, "protocol_code": "Power","value": powerOpt }]}, method: 'POST', rejectUnauthorized: false }; var request = require('request'); request(optionsDev,function (error, response, body){ //log(devicecode); //log(JSON.stringify(response)); //log(JSON.stringify(body.object_result)); if(parseInt(body.error_code)==0) { saveValue("mode", power, "string"); if(power>=0) updateDeviceMode(device, power); } else { log("Zustandsänderung fehlgeschlagen!", "error"); } }); } } function updateDeviceMode(devicecode, mode) { if(token!="") { var optionsDev = { url: cloudURL + '/app/device/control.json', headers: { "x-token": token }, json: {"param":[{ "device_code": devicecode, "protocol_code": "mode","value": mode }]}, method: 'POST', rejectUnauthorized: false //headers: {"content-type": "application/json"}, //charset: 'utf8', //json: true }; var request = require('request'); request(optionsDev,function (error, response, body){ //log(devicecode); //log(JSON.stringify(response)); //log(JSON.stringify(body.object_result)); if(parseInt(body.error_code)==0) { saveValue("mode", mode, "string"); } else { log("Zustandsänderung fehlgeschlagen!", "error"); token = ""; device = ""; saveValue("connection", false, "boolean"); } }); } } function updateDeviceSilent(devicecode, silent) { var silentMode; if(silent) { silentMode = "1"; } else { silentMode = "0"; } if(token!="") { var optionsDev = { url: cloudURL + '/app/device/control.json', headers: { "x-token": token }, json: {"param":[{ "device_code": devicecode, "protocol_code": "Manual-mute","value": silentMode }]}, method: 'POST', rejectUnauthorized: false //headers: {"content-type": "application/json"}, //charset: 'utf8', //json: true }; var request = require('request'); request(optionsDev,function (error, response, body){ //log(devicecode); //log(JSON.stringify(response)); //log(JSON.stringify(body.object_result)); if(parseInt(body.error_code)==0) { saveValue("silent", silent, "boolean"); } else { log("Zustandsänderung fehlgeschlagen!", "error"); token = ""; device = ""; saveValue("connection", false, "boolean"); } }); } } function updateDeviceSetTemp(devicecode, temperature) { var sTemperature = temperature.toString().replace(",", "."); var sMode = getState(dpRoot + ".mode").val; if(sMode=="-1") { //log("Gerät einschalten um Temperatur zu ändern!", 'warn'); return; } else if(sMode=="0") { sMode = "R01"; // Kühlen } else if(sMode=="1") { sMode = "R02"; // Heizen } else if(sMode=="2") { sMode = "R03"; // Auto } if(token!="") { var optionsDev = { url: cloudURL + '/app/device/control.json', headers: { "x-token": token }, json: {"param":[{ "device_code": devicecode, "protocol_code": "R01","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R02","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R03","value": sTemperature },{ "device_code": devicecode, "protocol_code": "Set_Temp","value": sTemperature }]}, method: 'POST', rejectUnauthorized: false //headers: {"content-type": "application/json"}, //charset: 'utf8', //json: true }; var request = require('request'); request(optionsDev,function (error, response, body){ //log(devicecode); //log(JSON.stringify(response)); //log(JSON.stringify(body.object_result)); if(parseInt(body.error_code)==0) { saveValue("tempSet", temperature, "number"); } else { log("Zustandsänderung fehlgeschlagen!", "error"); token = ""; device = ""; saveValue("connection", false, "boolean"); //log(JSON.stringify(response)); } }); } } // Beginn des Skripts createobjects(); // DPs anlegen updateToken(); // Zugriffstoken erfragen und aktuelle Werte lesen schedule('*/' + interval + ' * * * * *', function () { // regelmäßig Token und Zustand abfragen updateToken(); // gewünschte Änderungen ausführen if(!getState(dpRoot + ".mode").ack) { updateDevicePower(device, getState(dpRoot + ".mode").val); } if(!getState(dpRoot + ".silent").ack) { updateDevicePower(device, getState(dpRoot + ".silent").val); } }); tokenRefreshTimer = setInterval(async function () { // Token verfällt nach 60min token = ""; //log("Token nach Intervall verworfen.") updateToken(); }, 3600000); on({id: dpRoot + ".mode", change: "ne", ack: false}, async function (obj) { updateToken(); updateDevicePower(device, getState(dpRoot + ".mode").val); }); on({id: dpRoot + ".silent", change: "ne", ack: false}, async function (obj) { updateToken(); updateDeviceSilent(device, getState(dpRoot + ".silent").val); }); on({id: dpRoot + ".tempSet", change: "ne", ack: false}, async function (obj) { updateToken(); updateDeviceSetTemp(device, getState(dpRoot + ".tempSet").val); });
-
Als Info: Vieles an Info habe ich von diesem Github-Projekt:
-
@oxident Danke für deine Hilfe. Hab alle Datenpunkte und das Script gelöscht und alles neu angelegt. Weiterhin bekomme ich keine Daten.
Sehr eigenartig...
Kann es sein das es an meiner Email Adresse liegt? Die ist eine generierte von Apple mit Unterstrich und Punkt? Im Log Stand zwar das er andere Signal erwartet aber kann ja sein.
-
@pietnb Ich glaube, irgendwas ist bei Deinem Modell anders als bei mir. Eventuell müssten wir mal bei Github schauen, ob bei Deiner Pumpe etwas speziell ist.
-
@oxident Ich werde mal eine andere Mailadresse probieren. Evtl. bringt es ja was.
Was ich nicht verstehe ist das der Adapter ja eigentlich gleich angebunden ist. Wenn was von der Pumpe nicht unterstützt wird wäre doch nur kein Signal da aber die Verbindung müsste doch aufgebaut werden?
-
@pietnb Ja, da hast Du eigentlich Recht. Beim Lesen der Quellen ist mir aber aufgefallen, dass jeder Hersteller scheinbar selber definiert, welche Werte unter welcher Bezeichnung übertragen werden.
Bei meinem InverPro 21 fragt das Skript den Wert von "T02" ab und weiß, dass es sich um die Temperatur am Wassereingang handelt. Bei anderen Modellen könnte dies ganz anders sein (und sogar die Bezeichnung abweichen).
Das haben die echt blöd gelöst. Ich frage mich aber, woher die App dann z. B. immer genau weiß, was sie fragen muss und wie die Antwort zu verstehen ist.
Die Lösung wird irgendwo in diesem Bereich hier stehen:
https://github.com/radical-squared/aquatemp#per-product-id -
@oxident Ich habe inzwischen einen neuen Benutzer mit "klarer" Emailadresse angelegt. Leider bisher noch keine Daten. Habe aber eine Fehlermeldung im Log:
17:36:43.119 info javascript.0 (1373) Start javascript script.js.Poolheizung 17:36:43.150 info javascript.0 (1373) script.js.Poolheizung: erstelle Objekte 17:36:43.159 info javascript.0 (1373) script.js.Poolheizung: registered 3 subscriptions, 1 schedule, 0 messages, 0 logs and 0 file subscriptions 17:36:43.312 error javascript.0 (1373) script.js.Poolheizung: TypeError: Cannot read property 'toString' of null 17:36:43.313 error javascript.0 (1373) at updateDeviceSetTemp (script.js.Poolheizung:485:36) 17:36:43.313 error javascript.0 (1373) at Object.<anonymous> (script.js.Poolheizung:576:5)
avascript.0 2023-06-26 17:57:00.282 info State value to set for "0_userdata.0.Poolheizung.state" has to be type "boolean" but received type "string" javascript.0 2023-06-26 17:57:00.246 info State value to set for "0_userdata.0.Poolheizung.silent" has to be type "boolean" but received type "string" javascript.0 2023-06-26 17:57:00.244 info State value to set for "0_userdata.0.Poolheizung.error" has to be type "boolean" but received type "string" javascript.0 2023-06-26 17:57:00.241 info State value to set for "0_userdata.0.Poolheizung.connection" has to be type "boolean" but received type "string" javascript.0 2023-06-26 17:57:00.239 warn at processImmediate (internal/timers.js:466:21) javascript.0 2023-06-26 17:57:00.239 warn at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:2242:33) javascript.0 2023-06-26 17:57:00.238 warn You are assigning a string to the state "0_userdata.0.Poolheizung.state" which expects a boolean. Please fix your code to use a boolean or change the state type to string. This warning might become an error in future versions. javascript.0 2023-06-26 17:57:00.235 warn at processImmediate (internal/timers.js:466:21) javascript.0 2023-06-26 17:57:00.235 warn at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:2242:33) javascript.0 2023-06-26 17:57:00.234 warn You are assigning a string to the state "0_userdata.0.Poolheizung.silent" which expects a boolean. Please fix your code to use a boolean or change the state type to string. This warning might become an error in future versions. javascript.0 2023-06-26 17:57:00.214 warn at processImmediate (internal/timers.js:466:21) javascript.0 2023-06-26 17:57:00.214 warn at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:2242:33) javascript.0 2023-06-26 17:57:00.213 warn You are assigning a string to the state "0_userdata.0.Poolheizung.error" which expects a boolean. Please fix your code to use a boolean or change the state type to string. This warning might become an error in future versions. javascript.0 2023-06-26 17:57:00.208 warn at processImmediate (internal/timers.js:466:21) javascript.0 2023-06-26 17:57:00.208 warn at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:2242:33) javascript.0 2023-06-26 17:57:00.207 warn You are assigning a string to the state "0_userdata.0.Poolheizung.connection" which expects a boolean. Please fix your code to use a boolean or change the state type to string. This warning might become an error in future versions. javascript.0 2023-06-26 17:57:00.169 info State value to set for "0_userdata.0.Poolheizung.state" has to be type "boolean" but received type "string" javascript.0 2023-06-26 17:57:00.168 info State value to set for "0_userdata.0.Poolheizung.silent" has to be type "boolean" but received type "string" javascript.0 2023-06-26 17:57:00.164 info State value to set for "0_userdata.0.Poolheizung.error" has to be type "boolean" but received type "string" javascript.0 2023-06-26 17:57:00.160 info State value to set for "0_userdata.0.Poolheizung.connection" has to be type "boolean" but received type "string" javascript.0 2023-06-26 17:57:00.157 warn Read-only state "0_userdata.0.Poolheizung.rawJSON" has been written without ack-flag with value "null" javascript.0 2023-06-26 17:57:00.120 error at processImmediate (internal/timers.js:464:21) javascript.0 2023-06-26 17:57:00.120 error at Immediate.<anonymous> (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:5708:41) javascript.0 2023-06-26 17:57:00.120 error at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:596:29) javascript.0 2023-06-26 17:57:00.119 error at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1214:38) javascript.0 2023-06-26 17:57:00.119 error at Object.<anonymous> (script.js.Poolheizung:577:5) javascript.0 2023-06-26 17:57:00.118 error at updateDeviceSetTemp (script.js.Poolheizung:486:36) javascript.0 2023-06-26 17:57:00.117 error script.js.Poolheizung: TypeError: Cannot read property 'toString' of null javascript.0 2023-06-26 17:57:00.106 warn Read-only state "0_userdata.0.Poolheizung.coilTemp" has been written without ack-flag with value "null" javascript.0 2023-06-26 17:57:00.082 warn Read-only state "0_userdata.0.Poolheizung.suctionTemp" has been written without ack-flag with value "null" javascript.0 2023-06-26 17:57:00.081 warn Read-only state "0_userdata.0.Poolheizung.tempOut" has been written without ack-flag with value "null" javascript.0 2023-06-26 17:57:00.080 warn Read-only state "0_userdata.0.Poolheizung.tempIn" has been written without ack-flag with value "null" javascript.0 2023-06-26 17:57:00.079 warn Read-only state "0_userdata.0.Poolheizung.errorLevel" has been written without ack-flag with value "null" javascript.0 2023-06-26 17:57:00.078 warn Read-only state "0_userdata.0.Poolheizung.ambient" has been written without ack-flag with value "null" javascript.0 2023-06-26 17:57:00.022 info script.js.Poolheizung: ungülter Zustand! javascript.0 2023-06-26 17:57:00.022 warn at processTimers (internal/timers.js:500:7) javascript.0 2023-06-26 17:57:00.022 warn at listOnTimeout (internal/timers.js:557:17) javascript.0 2023-06-26 17:57:00.022 warn at Timeout._onTimeout (/opt/iobroker/node_modules/node-schedule/lib/Invocation.js:228:7) javascript.0 2023-06-26 17:57:00.022 warn at /opt/iobroker/node_modules/node-schedule/lib/Invocation.js:268:28 javascript.0 2023-06-26 17:57:00.022 warn at Job.invoke (/opt/iobroker/node_modules/node-schedule/lib/Job.js:171:15) javascript.0 2023-06-26 17:57:00.021 warn at Job.job (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1565:34) javascript.0 2023-06-26 17:57:00.021 warn at Object.<anonymous> (script.js.Poolheizung:554:35) javascript.0 2023-06-26 17:57:00.020 warn getState "0_userdata.0.Poolheizung.silent" not found (3) javascript.0 2023-06-26 17:57:00.020 warn at processTimers (internal/timers.js:500:7) javascript.0 2023-06-26 17:57:00.020 warn at listOnTimeout (internal/timers.js:557:17) javascript.0 2023-06-26 17:57:00.019 warn at Timeout._onTimeout (/opt/iobroker/node_modules/node-schedule/lib/Invocation.js:228:7) javascript.0 2023-06-26 17:57:00.019 warn at /opt/iobroker/node_modules/node-schedule/lib/Invocation.js:268:28 javascript.0 2023-06-26 17:57:00.019 warn at Job.invoke (/opt/iobroker/node_modules/node-schedule/lib/Job.js:171:15) javascript.0 2023-06-26 17:57:00.019 warn at Job.job (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1565:34) javascript.0 2023-06-26 17:57:00.019 warn at Object.<anonymous> (script.js.Poolheizung:553:9) javascript.0 2023-06-26 17:57:00.018 warn getState "0_userdata.0.Poolheizung.silent" not found (3) javascript.0 2023-06-26 17:57:00.017 info script.js.Poolheizung: ungülter Zustand! javascript.0 2023-06-26 17:57:00.017 warn at processTimers (internal/timers.js:500:7) javascript.0 2023-06-26 17:57:00.017 warn at listOnTimeout (internal/timers.js:557:17) javascript.0 2023-06-26 17:57:00.016 warn at Timeout._onTimeout (/opt/iobroker/node_modules/node-schedule/lib/Invocation.js:228:7) javascript.0 2023-06-26 17:57:00.016 warn at /opt/iobroker/node_modules/node-schedule/lib/Invocation.js:268:28 javascript.0 2023-06-26 17:57:00.016 warn at Job.invoke (/opt/iobroker/node_modules/node-schedule/lib/Job.js:171:15) javascript.0 2023-06-26 17:57:00.016 warn at Job.job (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1565:34) javascript.0 2023-06-26 17:57:00.016 warn at Object.<anonymous> (script.js.Poolheizung:551:35) javascript.0 2023-06-26 17:57:00.014 warn getState "0_userdata.0.Poolheizung.mode" not found (3) javascript.0 2023-06-26 17:57:00.014 warn at processTimers (internal/timers.js:500:7) javascript.0 2023-06-26 17:57:00.014 warn at listOnTimeout (internal/timers.js:557:17) javascript.0 2023-06-26 17:57:00.014 warn at Timeout._onTimeout (/opt/iobroker/node_modules/node-schedule/lib/Invocation.js:228:7) javascript.0 2023-06-26 17:57:00.014 warn at /opt/iobroker/node_modules/node-schedule/lib/Invocation.js:268:28 javascript.0 2023-06-26 17:57:00.014 warn at Job.invoke (/opt/iobroker/node_modules/node-schedule/lib/Job.js:171:15) javascript.0 2023-06-26 17:57:00.013 warn at Job.job (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1565:34) javascript.0 2023-06-26 17:57:00.013 warn at Object.<anonymous> (script.js.Poolheizung:550:9) javascript.0 2023-06-26 17:57:00.011 warn getState "0_userdata.0.Poolheizung.mode" not found (3) javascript.0 2023-06-26 17:56:59.922 info script.js.Poolheizung: registered 3 subscriptions, 1 schedule, 0 messages, 0 logs and 0 file subscriptions javascript.0 2023-06-26 17:56:59.913 info script.js.Poolheizung: erstelle Objekte javascript.0 2023-06-26 17:56:59.896 info Start javascript script.js.Poolheizung
Kannst du damit etwas anfangen?
-
@pietnb Ich verstehe nicht, warum er bei Dir den DP "Poolheizung.mode" nicht findet. Den sollte er eigentlich anlegen (bei "erstelle Objekte").
Mich beschleicht ein wenig das Gefühl, dass bei der Objekterstellung eventuell etwas nicht geklappt hat. Hast Du schonmal versucht, den ganzen Baum "0_userdata.0.Poolheizung" zu löschen und das Skript nochmal zu starten.
-
@oxident Habe den ganzen Raum schon mehrfach komplett neu erstellt. Eben gerade habe ich den Code von @znyde mal versucht. Da kommt auf jeden fall eine andere Fehlermeldung:
21:42:30.129 warn javascript.0 (1373) script.js.Poolheizung: Login-Fehler in updateToken(): [object Object] 21:42:31.685 info javascript.0 (1373) Stop script script.js.Poolheizung 21:42:31.696 info javascript.0 (1373) Start javascript script.js.Poolheizung 21:42:31.708 info javascript.0 (1373) script.js.Poolheizung: erstelle Objekte 21:42:31.710 info javascript.0 (1373) script.js.Poolheizung: Token Neuanforderung 21:42:31.721 info javascript.0 (1373) script.js.Poolheizung: registered 3 subscriptions, 1 schedule, 0 messages, 0 logs and 0 file subscriptions 21:42:31.862 info javascript.0 (1373) script.js.Poolheizung: null 21:42:31.862 info javascript.0 (1373) script.js.Poolheizung: {"statusCode":200,"body":{"error_code":"-1","error_msg":"Error username or password","error_msg_code":"","is_reuslt_suc":false},"headers":{"date":"Mon, 26 Jun 2023 19:42:31 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","set-cookie":["JSESSIONID=64B4E7902212B3E3E71863E387CF8679; Path=/cloudservice; HttpOnly"]},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com","port":443,"hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/cloudservice/api/app/user/login.json","path":"/cloudservice/api/app/user/login.json","href":"https://cloud.linked-go.com/cloudservice/api/app/user/login.json"},"method":"POST","headers":{"accept":"application/json","content-type":"application/json","content-length":71}}} 21:42:31.863 warn javascript.0 (1373) script.js.Poolheizung: Login-Fehler in updateToken(): [object Object] 21:43:00.004 info javascript.0 (1373) script.js.Poolheizung: Token Neuanforderung 21:43:00.103 info javascript.0 (1373) script.js.Poolheizung: null 21:43:00.104 info javascript.0 (1373) script.js.Poolheizung: {"statusCode":200,"body":{"error_code":"-1","error_msg":"Error username or password","error_msg_code":"","is_reuslt_suc":false},"headers":{"date":"Mon, 26 Jun 2023 19:43:00 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","set-cookie":["JSESSIONID=05095B09FE1F60ED5DF5C496F5D09A98; Path=/cloudservice; HttpOnly"]},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com","port":443,"hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/cloudservice/api/app/user/login.json","path":"/cloudservice/api/app/user/login.json","href":"https://cloud.linked-go.com/cloudservice/api/app/user/login.json"},"method":"POST","headers":{"accept":"application/json","content-type":"application/json","content-length":71}}} 21:43:00.105 warn javascript.0 (1373) script.js.Poolheizung: Login-Fehler in updateToken(): [object Object] 21:43:30.022 info javascript.0 (1373) script.js.Poolheizung: Token Neuanforderung 21:43:30.263 info javascript.0 (1373) script.js.Poolheizung: null 21:43:30.264 info javascript.0 (1373) script.js.Poolheizung: {"statusCode":200,"body":{"error_code":"-1","error_msg":"Error username or password","error_msg_code":"","is_reuslt_suc":false},"headers":{"date":"Mon, 26 Jun 2023 19:43:30 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","set-cookie":["JSESSIONID=EFFFDCBA8843D7355F60A256C1D9B5E9; Path=/cloudservice; HttpOnly"]},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com","port":443,"hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/cloudservice/api/app/user/login.json","path":"/cloudservice/api/app/user/login.json","href":"https://cloud.linked-go.com/cloudservice/api/app/user/login.json"},"method":"POST","headers":{"accept":"application/json","content-type":"application/json","content-length":71}}} 21:43:30.264 warn javascript.0 (1373) script.js.Poolheizung: Login-Fehler in updateToken(): [object Object]
Evtl. bringt das ja etwas ich ins dunkel. Wenn ich das richtig lese hat er Probleme mit dem Login? Passwort und User stimmen aber.
Dort steht ja bei product_ids nur eine, deshalb habe ich da meine eingegeben.
-
-
@oxident Kannst du bitte mal den ursprünglichen Code von dir nochmal posten? Würde dann Stück für Stück die Änderungen nochmal durchgehen. Nicht das sich bei den Änderungen doch was reingeschlichen hat?
So schnell möchte ich nicht aufgeben
-
@pietnb Mein Code ist noch unverändert im ersten Post, also ganz oben.
Dein Problem ist im allerersten Schritt, also bei updateToken(). Das ist quasi der Login. Wenn der nicht klappt, dann hört das Skript sofort auf.
Wesentlich wäre jetzt, dass einer von Euch den Login von der App mitschneiden kann. Dann wissen wir, was los ist.