Pittini / iobroker-Fensterauswertung

Zählt geöffnete Fenster pro Raum und gesamt. Kann einmalig oder zyklisch an offene Fenster erinnern. Erzeugt Lüftungswarnung uvm.
MIT License
42 stars 15 forks source link

Scripteditor zeigt einige Fehler an #41

Closed MarkSau closed 3 years ago

MarkSau commented 3 years ago

Hi,

ich wollte dein Skript nutzen. Nur leider scheint das Skript Fehler zu enthalten. Zumindest zeigt mir das der Editor an und auch, wenn ich das Skript starte, Fehler genau auf dieses Stellen. Nutze den Javascript Adapter 5.2.13.

image

und image


den WriteEventLog an mehreren Stellen.

image

enumNames scheint nicht deklariert zu sein.

Fehler nach Start:

`

Quelle | Zeit | debug | Nachricht -- | -- | -- | -- javascript.0 | 2021-11-07 11:55:12.660 | error | at processImmediate (internal/timers.js:466:21) javascript.0 | 2021-11-07 11:55:12.660 | error | at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1988:38) javascript.0 | 2021-11-07 11:55:12.657 | error | at Object. (script.js.common.Ueberwachung.01_Fensterueberwachung:279:13) javascript.0 | 2021-11-07 11:55:12.656 | error | at InitialSort (script.js.common.Ueberwachung.01_Fensterueberwachung:315:5) javascript.0 | 2021-11-07 11:55:12.656 | error | at main (script.js.common.Ueberwachung.01_Fensterueberwachung:352:5) javascript.0 | 2021-11-07 11:55:12.656 | error | at CreateRoomsWithOpenDoorsList (script.js.common.Ueberwachung.01_Fensterueberwachung:865:45) javascript.0 | 2021-11-07 11:55:12.656 | error | Error in callback: TypeError: Cannot set property '1' of undefined javascript.0 | 2021-11-07 11:55:12.654 | info | script.js.common.Ueberwachung.01_Fensterueberwachung: Reaching CreateRoomsWithOpenDoorsList javascript.0 | 2021-11-07 11:55:12.654 | info | script.js.common.Ueberwachung.01_Fensterueberwachung: Reaching CreateRoomsWithVentWarnings javascript.0 | 2021-11-07 11:55:12.654 | info | script.js.common.Ueberwachung.01_Fensterueberwachung: Room 0 = is open or disabled, no vent warning set javascript.0 | 2021-11-07 11:55:12.653 | info | script.js.common.Ueberwachung.01_Fensterueberwachung: Reaching VentCheck x=0 Init=true VentwarnTime[x]=null RoomStateTimeStamp[x]=undefined javascript.0 | 2021-11-07 11:55:12.651 | warn | at processImmediate (internal/timers.js:466:21) javascript.0 | 2021-11-07 11:55:12.650 | warn | at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1988:38) javascript.0 | 2021-11-07 11:55:12.650 | warn | at Object. (script.js.common.Ueberwachung.01_Fensterueberwachung:279:13) javascript.0 | 2021-11-07 11:55:12.650 | warn | at InitialSort (script.js.common.Ueberwachung.01_Fensterueberwachung:315:5) javascript.0 | 2021-11-07 11:55:12.650 | warn | at main (script.js.common.Ueberwachung.01_Fensterueberwachung:350:5) javascript.0 | 2021-11-07 11:55:12.650 | warn | at init (script.js.common.Ueberwachung.01_Fensterueberwachung:342:27) javascript.0 | 2021-11-07 11:55:12.649 | warn | getState "javascript.0.FensterUeberwachung..VentWarnTime" not found (3) javascript.0 | 2021-11-07 11:55:12.648 | info | script.js.common.Ueberwachung.01_Fensterueberwachung: x=0= SendWindowWarnMsg=null SendDoorWarnMsg=null SendVentMsg=null SendWindowOpenCloseMsg=null SendDoorOpenCloseMsg=null javascript.0 | 2021-11-07 11:55:12.648 | warn | at processImmediate (internal/timers.js:466:21) javascript.0 | 2021-11-07 11:55:12.648 | warn | at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1988:38) javascript.0 | 2021-11-07 11:55:12.648 | warn | at Object. (script.js.common.Ueberwachung.01_Fensterueberwachung:279:13) javascript.0 | 2021-11-07 11:55:12.648 | warn | at InitialSort (script.js.common.Ueberwachung.01_Fensterueberwachung:315:5) javascript.0 | 2021-11-07 11:55:12.648 | warn | at main (script.js.common.Ueberwachung.01_Fensterueberwachung:350:5) javascript.0 | 2021-11-07 11:55:12.647 | warn | at init (script.js.common.Ueberwachung.01_Fensterueberwachung:330:30) javascript.0 | 2021-11-07 11:55:12.646 | warn | getState "javascript.0.FensterUeberwachung..SendDoorWarnMsg" not found (3) javascript.0 | 2021-11-07 11:55:12.646 | warn | at processImmediate (internal/timers.js:466:21) javascript.0 | 2021-11-07 11:55:12.646 | warn | at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1988:38) javascript.0 | 2021-11-07 11:55:12.646 | warn | at Object. (script.js.common.Ueberwachung.01_Fensterueberwachung:279:13) javascript.0 | 2021-11-07 11:55:12.646 | warn | at InitialSort (script.js.common.Ueberwachung.01_Fensterueberwachung:315:5) javascript.0 | 2021-11-07 11:55:12.645 | warn | at main (script.js.common.Ueberwachung.01_Fensterueberwachung:350:5) javascript.0 | 2021-11-07 11:55:12.645 | warn | at init (script.js.common.Ueberwachung.01_Fensterueberwachung:329:32) javascript.0 | 2021-11-07 11:55:12.644 | warn | getState "javascript.0.FensterUeberwachung..SendWindowWarnMsg" not found (3) javascript.0 | 2021-11-07 11:55:12.644 | warn | at processImmediate (internal/timers.js:466:21) javascript.0 | 2021-11-07 11:55:12.644 | warn | at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1988:38) javascript.0 | 2021-11-07 11:55:12.644 | warn | at Object. (script.js.common.Ueberwachung.01_Fensterueberwachung:279:13) javascript.0 | 2021-11-07 11:55:12.643 | warn | at InitialSort (script.js.common.Ueberwachung.01_Fensterueberwachung:315:5) javascript.0 | 2021-11-07 11:55:12.643 | warn | at main (script.js.common.Ueberwachung.01_Fensterueberwachung:350:5) javascript.0 | 2021-11-07 11:55:12.643 | warn | at init (script.js.common.Ueberwachung.01_Fensterueberwachung:328:37) javascript.0 | 2021-11-07 11:55:12.642 | warn | getState "javascript.0.FensterUeberwachung..SendWindowOpenCloseMsg" not found (3) javascript.0 | 2021-11-07 11:55:12.642 | warn | at processImmediate (internal/timers.js:466:21) javascript.0 | 2021-11-07 11:55:12.641 | warn | at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1988:38) javascript.0 | 2021-11-07 11:55:12.641 | warn | at Object. (script.js.common.Ueberwachung.01_Fensterueberwachung:279:13) javascript.0 | 2021-11-07 11:55:12.641 | warn | at InitialSort (script.js.common.Ueberwachung.01_Fensterueberwachung:315:5) javascript.0 | 2021-11-07 11:55:12.641 | warn | at main (script.js.common.Ueberwachung.01_Fensterueberwachung:350:5) javascript.0 | 2021-11-07 11:55:12.640 | warn | at init (script.js.common.Ueberwachung.01_Fensterueberwachung:327:35) javascript.0 | 2021-11-07 11:55:12.639 | warn | getState "javascript.0.FensterUeberwachung..SendDoorOpenCloseMsg" not found (3) javascript.0 | 2021-11-07 11:55:12.639 | warn | at processImmediate (internal/timers.js:466:21) javascript.0 | 2021-11-07 11:55:12.639 | warn | at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1988:38) javascript.0 | 2021-11-07 11:55:12.639 | warn | at Object. (script.js.common.Ueberwachung.01_Fensterueberwachung:279:13) javascript.0 | 2021-11-07 11:55:12.636 | warn | at InitialSort (script.js.common.Ueberwachung.01_Fensterueberwachung:315:5) javascript.0 | 2021-11-07 11:55:12.636 | warn | at main (script.js.common.Ueberwachung.01_Fensterueberwachung:350:5) javascript.0 | 2021-11-07 11:55:12.636 | warn | at init (script.js.common.Ueberwachung.01_Fensterueberwachung:326:26) javascript.0 | 2021-11-07 11:55:12.634 | warn | getState "javascript.0.FensterUeberwachung..SendVentMsg" not found (3) javascript.0 | 2021-11-07 11:55:12.633 | info | script.js.common.Ueberwachung.01_Fensterueberwachung: CreateStates fertig! javascript.0 | 2021-11-07 11:55:12.629 | info | script.js.common.Ueberwachung.01_Fensterueberwachung: registered 0 subscriptions and 0 schedules javascript.0 | 2021-11-07 11:55:12.628 | info | script.js.common.Ueberwachung.01_Fensterueberwachung: starting Fensterskript, Version 1.6.14 javascript.0 | 2021-11-07 11:55:12.606 | info | Start javascript script.js.common.Ueberwachung.01_Fensterueberwachung

`

Pittini commented 3 years ago

Das passt schon so alles, die Fehler sind keine, der Syntaxcheck kapiert manche Sachen einfach nicht. Dein Fehler kommt vermutlich weil Du UseEventlog und evtl. auch UseSay im Einstellungsbereich nicht auf false gesetzt hast.