@oxident
Vielen Dank für die Antwort. Ja das App funktioniert.
Ich habe einmal das PW geändert weil ich vermutet hatte, dass es zu Problemen mit Sonderzeichen kommt. Das war es leider nicht.
Derzeit läuft noch kein Wasser durch die Wärmepumpe, da der Pool noch eingewintert ist. Aus dem Grund zeigt die App eine Fehlermeldung an.
Die Meldung kam aber erst gerade auf, weil ich die Pumpe zu lange ohne den Wassefluss angelassen hatte.
Im App sehe ich trotzdem ein und augehende temperartur. Den Modus kann ich in der App auch schalten. (Off - Heat - Off habe ich erfolgreich in der App getestet. )
Beim initialen Start des Scriptes bekam ich folgende Fehlermeldung:
21:18:49.472 error javascript.0 (430) script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern: TypeError: Cannot read properties of null (reading 'toString')
21:18:49.472 error javascript.0 (430) at updateDeviceSetTemp (script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern:436:36)
21:18:49.473 error javascript.0 (430) at Object.<anonymous> (script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern:523:5)
Dieser Fehler scheint sich aber nur auf die Erstellung der DP zu beziehen. Hier die passenden ausgaben aus dem Log:
javascript.0
2023-05-08 21:18:51.106 error Error in request callback: TypeError: Cannot read properties of undefined (reading 'device_code')
javascript.0
2023-05-08 21:18:50.445 error Error in request callback: TypeError: Cannot read properties of undefined (reading 'device_code')
javascript.0
2023-05-08 21:18:49.529 warn at processImmediate (node:internal/timers:468:21)
javascript.0
2023-05-08 21:18:49.529 warn at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:2411:33)
javascript.0
2023-05-08 21:18:49.528 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-05-08 21:18:49.522 warn at processImmediate (node:internal/timers:468:21)
javascript.0
2023-05-08 21:18:49.522 warn at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:2411:33)
javascript.0
2023-05-08 21:18:49.521 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-05-08 21:18:49.497 warn at processImmediate (node:internal/timers:468:21)
javascript.0
2023-05-08 21:18:49.497 warn at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:2411:33)
javascript.0
2023-05-08 21:18:49.496 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-05-08 21:18:49.473 error at processImmediate (node:internal/timers:466:21)
javascript.0
2023-05-08 21:18:49.473 error at Immediate.<anonymous> (/opt/iobroker/node_modules/@iobroker/js-controller-adapter/src/lib/adapter/adapter.js:5916:56)
javascript.0
2023-05-08 21:18:49.473 error at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:593:29)
javascript.0
2023-05-08 21:18:49.473 error at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1244:38)
javascript.0
2023-05-08 21:18:49.473 error at Object.<anonymous> (script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern:523:5)
javascript.0
2023-05-08 21:18:49.472 error at updateDeviceSetTemp (script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern:436:36)
javascript.0
2023-05-08 21:18:49.472 error script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern: TypeError: Cannot read properties of null (reading 'toString')
javascript.0
2023-05-08 21:18:49.466 warn at processImmediate (node:internal/timers:468:21)
javascript.0
2023-05-08 21:18:49.466 warn at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:2411:33)
javascript.0
2023-05-08 21:18:49.465 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-05-08 21:18:49.454 warn Read-only state "0_userdata.0.Poolheizung.tempOut" has been written without ack-flag with value "null"
javascript.0
2023-05-08 21:18:49.413 warn Read-only state "0_userdata.0.Poolheizung.tempIn" has been written without ack-flag with value "null"
javascript.0
2023-05-08 21:18:49.412 warn Read-only state "0_userdata.0.Poolheizung.errorLevel" has been written without ack-flag with value "null"
javascript.0
2023-05-08 21:18:49.411 warn Read-only state "0_userdata.0.Poolheizung.ambient" has been written without ack-flag with value "null"
javascript.0
2023-05-08 21:18:49.281 warn This object will not be created in future versions. Please report this to the developer.
javascript.0
2023-05-08 21:18:49.281 warn Object 0_userdata.0.Poolheizung.state is invalid: Default value has to be type "boolean" but received type "string"
javascript.0
2023-05-08 21:18:49.281 warn This object will not be created in future versions. Please report this to the developer.
javascript.0
2023-05-08 21:18:49.281 warn Object 0_userdata.0.Poolheizung.silent is invalid: Default value has to be type "boolean" but received type "string"
javascript.0
2023-05-08 21:18:49.281 warn This object will not be created in future versions. Please report this to the developer.
javascript.0
2023-05-08 21:18:49.281 warn Object 0_userdata.0.Poolheizung.mode is invalid: obj.common.states has an invalid type! Expected "object", received "string"
javascript.0
2023-05-08 21:18:49.280 warn This object will not be created in future versions. Please report this to the developer.
javascript.0
2023-05-08 21:18:49.280 warn Object 0_userdata.0.Poolheizung.error is invalid: Default value has to be type "boolean" but received type "string"
javascript.0
2023-05-08 21:18:49.280 warn This object will not be created in future versions. Please report this to the developer.
javascript.0
2023-05-08 21:18:49.280 warn Object 0_userdata.0.Poolheizung.connection is invalid: Default value has to be type "boolean" but received type "string"
Bei jedem Start danach kommt die Meldung nicht mehr.
Wenn ich z.B. mode ändere und das Skript starte sieht die Ausgabe wie folgt aus:
21:22:32.070 info javascript.0 (430) Stop script script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern
21:23:12.289 info javascript.0 (430) Start javascript script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern
21:23:12.293 info javascript.0 (430) script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern: erstelle Objekte
21:23:12.294 info javascript.0 (430) script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern: Token Neuanforderung
21:23:12.295 info javascript.0 (430) script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern: schedule(cron=*/30 * * * * *)
21:23:12.295 info javascript.0 (430) script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern: setInterval(ms=3600000)
21:23:12.297 info javascript.0 (430) script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern: subscribe: {"pattern":{"id":"0_userdata.0.Poolheizung.mode","change":"ne","ack":false,"q":0},"name":"script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern"}
21:23:12.297 info javascript.0 (430) script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern: subscribe: {"pattern":{"id":"0_userdata.0.Poolheizung.silent","change":"ne","ack":false,"q":0},"name":"script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern"}
21:23:12.297 info javascript.0 (430) script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern: subscribe: {"pattern":{"id":"0_userdata.0.Poolheizung.tempSet","change":"ne","ack":false,"q":0},"name":"script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern"}
21:23:12.297 info javascript.0 (430) script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern: registered 3 subscriptions, 1 schedule, 0 messages, 0 logs and 0 file subscriptions
21:23:30.004 info javascript.0 (430) script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern: getState(id=0_userdata.0.Poolheizung.mode, timerId=undefined) => {"val":"1","ack":false,"ts":1683573784694,"q":0,"from":"system.adapter.admin.0","user":"system.user.admin","lc":1683573784694}
21:23:30.005 info javascript.0 (430) script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern: getState(id=0_userdata.0.Poolheizung.mode, timerId=undefined) => {"val":"1","ack":false,"ts":1683573784694,"q":0,"from":"system.adapter.admin.0","user":"system.user.admin","lc":1683573784694}
21:23:30.006 info javascript.0 (430) script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern: getState(id=0_userdata.0.Poolheizung.silent, timerId=undefined) => {"val":"false","ack":true,"ts":1683573529522,"q":0,"c":"script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern","from":"system.adapter.javascript.0","user":"system.user.admin","lc":1683573529457}
21:23:30.130 info javascript.0 (430) script.js.Regeln_Komfort.Pool_Wärmepumpe_steuern: Zustandsänderung fehlgeschlagen!
Im Log gibt es passend die folgende Meldung dazu:
javascript.0
2023-05-08 21:23:31.773 error Error in request callback: TypeError: Cannot read properties of undefined (reading 'device_code')
javascript.0
2023-05-08 21:23:13.092 error Error in request callback: TypeError: Cannot read properties of undefined (reading 'device_code')
Hast du eine Idee woran es liegen kann? Ich schaue parallel weiter, sehe aber bisher keinen Fehler im Skript