Sroose / homebridge-loxone-ws

Websocket based Loxone plugin for homebridge
MIT License
39 stars 26 forks source link

Error on initializing accessory #23

Closed vsolov closed 6 years ago

vsolov commented 7 years ago

Hello, when i added in Loxone, "Lighting Controller V2 - https://www.loxone.com/enen/kb/lighting-controller-v2/ " , I've started receive error's like this, can u help to fix this?

[11/22/2017, 2:35:44 PM] [TL office] [dimmer] iOS - send brightness message to Главная яркость of Light control in Офис Tech Living: 0 /usr/local/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 (/usr/local/lib/node_modules/homebridge-loxone-ws/node_modules/node-lox-ws-api/lib/API.js:190:36) at API.send_cmd (/usr/local/lib/node_modules/homebridge-loxone-ws/node_modules/node-lox-ws-api/lib/API.js:203:10) at WSListener.sendCommand (/usr/local/lib/node_modules/homebridge-loxone-ws/libs/WSListener.js:113:13) at DimmerItem.setItemState (/usr/local/lib/node_modules/homebridge-loxone-ws/items/DimmerItem.js:95:22) at emitMany (events.js:108:13) at emit (events.js:182:7) at Characteristic.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:292:10) at DimmerItem.getOtherServices (/usr/local/lib/node_modules/homebridge-loxone-ws/items/DimmerItem.js:54:10) at AbstractItem.getServices (/usr/local/lib/node_modules/homebridge-loxone-ws/items/AbstractItem.js:30:30) at Server.str.replace.Server._createAccessory (/usr/local/lib/node_modules/homebridge/lib/server.js:388:36)

avdz commented 7 years ago

I have more or less the same issue when I try starting homebridge after adding the loon plugin.

Nexus2k commented 6 years ago

https://github.com/Sroose/homebridge-loxone-ws/pull/28 has the fix for this. DimmerItem tries to call setItemState before the Loxone connection is established for some reason.

Sroose commented 6 years ago

28 included in release 1.0.5