Closed Nexus2k closed 6 years ago
Still with the changes it throws the same error. Any ideas?
Can you post the full error message?
`[2018-02-08 10:58:31] [Loxone] [dimmer] iOS - send brightness message to Master-Helligkeit of Lichtsteuerung in Kinderzimmer: 0 /opt/node/lib/node_modules/homebridge-loxone-ws/node_modules/node-lox-ws-api/lib/API.js:190 this.connection.send(this._auth.prepare_control_command(control, command)); ^
TypeError: Cannot read property 'prepare_control_command' of undefined at API.send_control_command (/opt/node/lib/node_modules/homebridge-loxone-ws/node_modules/node-lox-ws-api/lib/API.js:190:36) at API.send_cmd (/opt/node/lib/node_modules/homebridge-loxone-ws/node_modules/node-lox-ws-api/lib/API.js:203:10) at WSListener.sendCommand (/opt/node/lib/node_modules/homebridge-loxone-ws/libs/WSListener.js:113:13) at DimmerItem.setItemState (/opt/node/lib/node_modules/homebridge-loxone-ws/items/DimmerItem.js:95:22) at emitMany (events.js:127:13) at emit (events.js:201:7) at Characteristic.setValue (/opt/node/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:311:10) at DimmerItem.getOtherServices (/opt/node/lib/node_modules/homebridge-loxone-ws/items/DimmerItem.js:54:10) at DimmerItem.AbstractItem.getServices (/opt/node/lib/node_modules/homebridge-loxone-ws/items/AbstractItem.js:30:30) at Server._createAccessory (/opt/node/lib/node_modules/homebridge/lib/server.js:388:36)`
I've added the same fix to the setItemState function, you might want to pull the latest version and try again.
Now it throws:
[2018-02-08 11:29:05] [Loxone] [dimmer] iOS - send brightness message to Master-Helligkeit of Lichtsteuerung in Kinderzimmer: 0 /opt/node/lib/node_modules/homebridge-loxone-ws/items/DimmerItem.js:95 if (this.platform.ws.is_connected()) { ^
TypeError: this.platform.ws.is_connected is not a function
at DimmerItem.setItemState (/opt/node/lib/node_modules/homebridge-loxone-ws/items/DimmerItem.js:95:26)
at emitMany (events.js:127:13)
at emit (events.js:201:7)
at Characteristic.setValue (/opt/node/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:311:10)
at DimmerItem.getOtherServices (/opt/node/lib/node_modules/homebridge-loxone-ws/items/DimmerItem.js:54:10)
at DimmerItem.AbstractItem.getServices (/opt/node/lib/node_modules/homebridge-loxone-ws/items/AbstractItem.js:30:30)
at Server._createAccessory (/opt/node/lib/node_modules/homebridge/lib/server.js:388:36)
at Server.
Hmmm... Very strange, sounds like the WebSocket is not connected at this point. I added another check for that. I do however currently expect that the login credentials are wrong.
it throws again the same error, but I think the credentials are right because it connects and see everything
in WSListener.js I found var WSListener = function(platform) { this.ws = undefined;
I could solve the problem by setting if (this.connection !== undefined) { this.platform.ws.sendCommand(this.uuidAction, command); } I can control now from Home in iOS the color and brightness, but always show the old state, after I click on it, it changes to the new one. I hope you can help me with that.
this.connection will always be undefined as it doesn't exist, the idea is to check if the this.platform.ws object is already assigned which indicates that it's connected.
How to achieve that? Because for now I can control over HomeKit the color and so.
if (this.platform.ws !== undefined) {
this.platform.ws.sendCommand(this.uuidAction, command);
}
might work
This throws the error from the beginning:
/opt/node/lib/node_modules/homebridge-loxone-ws/node_modules/node-lox-ws-api/lib/API.js:190 this.connection.send(this._auth.prepare_control_command(control, command)); ^
TypeError: Cannot read property 'prepare_control_command' of undefined at API.send_control_command (/opt/node/lib/node_modules/homebridge-loxone-ws/node_modules/node-lox-ws-api/lib/API.js:190:36) at API.send_cmd (/opt/node/lib/node_modules/homebridge-loxone-ws/node_modules/node-lox-ws-api/lib/API.js:203:10) at WSListener.sendCommand (/opt/node/lib/node_modules/homebridge-loxone-ws/libs/WSListener.js:113:13) at DimmerItem.setItemState (/opt/node/lib/node_modules/homebridge-loxone-ws/items/DimmerItem.js:96:24) at emitMany (events.js:127:13) at emit (events.js:201:7) at Characteristic.setValue (/opt/node/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:311:10) at DimmerItem.getOtherServices (/opt/node/lib/node_modules/homebridge-loxone-ws/items/DimmerItem.js:54:10) at DimmerItem.AbstractItem.getServices (/opt/node/lib/node_modules/homebridge-loxone-ws/items/AbstractItem.js:30:30) at Server._createAccessory (/opt/node/lib/node_modules/homebridge/lib/server.js:388:36)
Hey, Do you have now Andy idea? How to fix the problem? Shall i try a new and Fresh Installation?
I have the same problem - I guess. When adding one (or more) "light controller(s)" with at least one dimmer the loxone-plugin forces the homebridge to stop.
Thats what the terminal shows:
[2018-2-24 13:58:27] Homebridge is running on port 51826. /usr/lib/node_modules/homebridge-loxone-ws/libs/WSListener.js:44 throw new Error("LOXONE WS: connection error"); ^
Error: LOXONE WS: connection error
at API.
When I hide all light controllers with dimmers from my homebridge user within Loxone all works great. Hope somebody can help.
Cheers Jay
Plus update to latest node-lox-ws-api and switch to Token-Enc Auth.