Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with ws-api? #24

Open
avdz opened this issue Nov 24, 2017 · 7 comments
Open

Error with ws-api? #24

avdz opened this issue Nov 24, 2017 · 7 comments

Comments

@avdz
Copy link

avdz commented Nov 24, 2017

I'm not really sure what is happening and I do not understand javascript enough to really be able to situate the problem but whenever I try to start homebridge (with the loon plugin) I get one of the following two errors:
I think it might have something to do with the ws-api you're using but maybe it's best if you create a new issue there if that's the case.

/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:37)
    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:147:13)
    at Characteristic.Brightness.emit (events.js:224:7)
    at Characteristic.Brightness.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 DimmerItem.AbstractItem.getServices (/usr/local/lib/node_modules/homebridge-loxone-ws/items/AbstractItem.js:30:30)
    at Server._createAccessory (/usr/local/lib/node_modules/homebridge/lib/server.js:388:36)
       throw new Error("LOXONE WS: connection error");
       ^

Error: LOXONE WS: connection error
    at API.<anonymous> (/usr/local/lib/node_modules/homebridge-loxone-ws/libs/WSListener.js:44:14)
    at emitNone (events.js:106:13)
    at API.emit (events.js:208:7)
    at Connection.<anonymous> (/usr/local/lib/node_modules/homebridge-loxone-ws/node_modules/node-lox-ws-api/lib/API.js:98:14)
    at emitOne (events.js:116:13)
    at Connection.emit (events.js:211:7)
    at WebSocketConnection.<anonymous> (/usr/local/lib/node_modules/homebridge-loxone-ws/node_modules/node-lox-ws-api/lib/Connection.js:99:14)
    at emitOne (events.js:116:13)
    at WebSocketConnection.emit (events.js:211:7)
    at WebSocketConnection.handleSocketError (/usr/local/lib/node_modules/homebridge-loxone-ws/node_modules/websocket/lib/WebSocketConnection.js:347:14)```
@koraysels
Copy link

I have the same! anybody got a fix ?

@koraysels
Copy link

koraysels commented Dec 5, 2017

I downgraded to v 1.0.2 and the error is gone...

$ sudo npm install -g [email protected]

@thomasgodon
Copy link

also got the same error. should we update ws api?

@Nexus2k
Copy link
Contributor

Nexus2k commented Dec 31, 2017

+1, have the same error. Downgrade to 1.0.2 works...

EDIT: 1.0.2 doesn't work, the mini server doesn't accept the commands (doesn't process them): I'm on Firmware 9.0.9.26

The DimmerItem has a bug that tries to set the State before the connection is established. #28 for the fix

@Sroose
Copy link
Owner

Sroose commented Apr 2, 2018

Should be solved in release 1.0.5.

@rtrompier
Copy link

Hello,

I confirm, it's solved for me in 1.0.5 ;)

@madito
Copy link

madito commented Mar 17, 2019

Hi!

I have the similar problem;

homebridge-loxone-ws: 1.0.5
Loxone Miniserver: 10.0.9.24

[2019-3-17 18:47:27] [Loxone] [blinds] iOS - send message to Cortina in Cocina: ManualPosition/0
/usr/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 'send' of undefined
at API.send_control_command (/usr/lib/node_modules/homebridge-loxone-ws/node_modules/node-lox-ws-api/lib/API.js:190:21)
at API.send_cmd (/usr/lib/node_modules/homebridge-loxone-ws/node_modules/node-lox-ws-api/lib/API.js:203:10)
at WSListener.sendCommand (/usr/lib/node_modules/homebridge-loxone-ws/libs/WSListener.js:140:13)
at BlindsItem.setItem (/usr/lib/node_modules/homebridge-loxone-ws/items/BlindsItem.js:127:22)
at emitMany (events.js:147:13)
at Characteristic.TargetPosition.emit (events.js:224:7)
at Characteristic.TargetPosition.Characteristic.setValue (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:321:10)
at Bridge. (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:873:22)
at Array.forEach ()
at Bridge.Accessory._handleSetCharacteristics (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:813:8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants