NEWS
Fehler im Log bei Fenster Aufzählung
-
Hi All,
ich habe leider von JS nicht viel Ahnung daher muss ich leider Frag. Ich verstehe diese Fehlermeldung leider nicht:
javascript.0 2019-03-19 19:17:05.709 warn at TCP.onread (net.js:559:20)
javascript.0 2019-03-19 19:17:05.709 warn at Socket.Readable.push (_stream_readable.js:134:10)
javascript.0 2019-03-19 19:17:05.709 warn at readableAddChunk (_stream_readable.js:176:18)
javascript.0 2019-03-19 19:17:05.709 warn at Socket.emit (events.js:188:7)
javascript.0 2019-03-19 19:17:05.709 warn at emitOne (events.js:96:13)
javascript.0 2019-03-19 19:17:05.709 warn at Socket._ultron.on (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/ws/lib/WebSocket.js:138:22)
javascript.0 2019-03-19 19:17:05.709 warn at Receiver.add (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/ws/lib/Receiver.js:139:10)
javascript.0 2019-03-19 19:17:05.709 warn at Receiver.startLoop (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/ws/lib/Receiver.js:165:16)
javascript.0 2019-03-19 19:17:05.708 warn at Receiver.getData (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/ws/lib/Receiver.js:330:12)
javascript.0 2019-03-19 19:17:05.708 warn at Receiver.dataMessage (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/ws/lib/Receiver.js:389:14)
javascript.0 2019-03-19 19:17:05.708 warn at Receiver._receiver.onmessage (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/ws/lib/WebSocket.js:141:47)
javascript.0 2019-03-19 19:17:05.708 warn at WebSocket.emit (events.js:188:7)
javascript.0 2019-03-19 19:17:05.708 warn at emitOne (events.js:96:13)
javascript.0 2019-03-19 19:17:05.708 warn at WebSocket.onMessage (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/ws/lib/EventTarget.js:99:16)
javascript.0 2019-03-19 19:17:05.708 warn at WebSocket.ws.onmessage (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/engine.io-client/lib/transports/websocket.js:147:10)
javascript.0 2019-03-19 19:17:05.708 warn at WS.Transport.onData (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/engine.io-client/lib/transport.js:137:8)
javascript.0 2019-03-19 19:17:05.708 warn at WS.Transport.onPacket (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/engine.io-client/lib/transport.js:145:8)
javascript.0 2019-03-19 19:17:05.707 warn at WS.Emitter.emit (/opt/iobroker/node_modules/component-emitter/index.js:133:20)
javascript.0 2019-03-19 19:17:05.707 warn at WS.<anonymous> (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/engine.io-client/lib/socket.js:273:10)
javascript.0 2019-03-19 19:17:05.707 warn at Socket.onPacket (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/engine.io-client/lib/socket.js:456:14)
javascript.0 2019-03-19 19:17:05.707 warn at Socket.Emitter.emit (/opt/iobroker/node_modules/component-emitter/index.js:133:20)
javascript.0 2019-03-19 19:17:05.707 warn at Socket.<anonymous> (/opt/iobroker/node_modules/component-bind/index.js:21:15)
javascript.0 2019-03-19 19:17:05.707 warn at Manager.ondata (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/manager.js:335:16)
javascript.0 2019-03-19 19:17:05.707 warn at Decoder.add (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-parser/index.js:251:12)
javascript.0 2019-03-19 19:17:05.707 warn at Decoder.Emitter.emit (/opt/iobroker/node_modules/component-emitter/index.js:133:20)
javascript.0 2019-03-19 19:17:05.707 warn at Decoder.<anonymous> (/opt/iobroker/node_modules/component-bind/index.js:21:15)
javascript.0 2019-03-19 19:17:05.707 warn at Manager.ondecoded (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/manager.js:345:8)
javascript.0 2019-03-19 19:17:05.706 warn at Manager.Emitter.emit (/opt/iobroker/node_modules/component-emitter/index.js:133:20)
javascript.0 2019-03-19 19:17:05.706 warn at Manager.<anonymous> (/opt/iobroker/node_modules/component-bind/index.js:21:15)
javascript.0 2019-03-19 19:17:05.706 warn at Socket.onpacket (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/socket.js:236:12)
javascript.0 2019-03-19 19:17:05.706 warn at Socket.onevent (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/socket.js:278:10)
javascript.0 2019-03-19 19:17:05.706 warn at Socket.Emitter.emit (/opt/iobroker/node_modules/component-emitter/index.js:133:20)
javascript.0 2019-03-19 19:17:05.706 warn at Socket.<anonymous> (/opt/iobroker/node_modules/iobroker.js-controller/lib/states/statesInMemClient.js:52:30)
javascript.0 2019-03-19 19:17:05.706 warn at Object.change (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:3425:37)
javascript.0 2019-03-19 19:17:05.706 warn at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:364:25)
javascript.0 2019-03-19 19:17:05.706 warn at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:963:38)
javascript.0 2019-03-19 19:17:05.702 warn at Object.<anonymous> (script.js.Aufzählung.countOpenWindowsDoors:38:3)
javascript.0 2019-03-19 19:17:05.702 warn at countOpenWindowsDoors (script.js.Aufzählung.countOpenWindowsDoors:33:3)
javascript.0 2019-03-19 19:17:05.702 warn at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1258:20)
javascript.0 2019-03-19 19:17:05.696 warn Wrong type of Datenpunkte.0.StatusWindowOpen: "number". Please fix, while deprecated and will not work in next versions.Das Scribt dazu sieht so aus:
function countOpenWindowsDoors()
{
var openWindows = 0;
var openDoors = 0;// Fenster
var windows = getObject("enum.functions.windowstatus").common.members;
for(let i = 0; i < windows.length; i++) {
var Status = getState(windows[i]).val;
if ( Status ) { openWindows = openWindows + 1; }
}// Türen
var doors = getObject("enum.functions.doorstatus").common.members;
for(let i = 0; i < doors.length; i++) {
var Status = getState(doors[i]).val;
if ( Status ) { openDoors = openDoors + 1; }
}var openWindowsText = "Kein Fenster geöffnet";
var openDoorText = "Keine Tür geöffnet";if ( openWindows > 0 ) {
openWindowsText = openWindows + " Fenster geöffnet";
}
if ( openDoors > 0 ) {
openDoorText = openDoors + " Türe(n) geöffnet";
}setState("Datenpunkte.0.StatusDoorOpenText", openDoorText);
setState("Datenpunkte.0.StatusWindowOpenText", openWindowsText);
setState("Datenpunkte.0.StatusDoorOpen", openDoors);
setState("Datenpunkte.0.StatusWindowOpen", openWindows);}
$('state(functions=windowstatus)').on(function(obj) {
countOpenWindowsDoors();
});$('state(functions=doorstatus)').on(function(obj) {
countOpenWindowsDoors();
});Hoffe mir kann wer helfen. Vielen Dank
-
@Fuga sagte:
warn Wrong type of Datenpunkte.0.StatusWindowOpen: "number"
Die Datenpunkt-Art von "Datenpunkte.0.StatusWindowOpen" in Zahl (number) ändern !
-
Das hatte ich schon gemacht. Musste den Daten Punkt nochmal Löschen und neu erstellen. Jetzt geht es. vielen Danke