websocket client
websocket client
Does the z-way device api support websockets or anything else that would let me listen to changes without hammering the server with poll requests?
Re: websocket client
yes, please try rc17 with sockets.websocket. See https://github.com/Z-Wave-Me/Z-Way-Manu ... wayDev.pdf for more info
This is a bit experimental for now, but works so far. Would be cool to have some feedback too.
This is a bit experimental for now, but works so far. Would be cool to have some feedback too.
Re: websocket client
Ok, that's great. I already tried connecting to z-way via web sockets, but couldn't figure on which url/path this is exposed by z-way. I cannot find this in the pdf you are referring to either, the example is just generic and connects to "ws://echo.websocket.org" instead of the z-way server.
What would be the correct url for connecting to z-way over a websocket?
What would be the correct url for connecting to z-way over a websocket?
Re: websocket client
Looks like there is client only sockets. That sad.
-
- Posts: 3
- Joined: 21 Nov 2015 14:27
Re: websocket client
@PoltoS:
Could you please provide a working example how to connect to Z-Way using websockets? The documentation really is too generic
Could you please provide a working example how to connect to Z-Way using websockets? The documentation really is too generic
Re: websocket client
Z-way currently supports just websocket client (well, it also has built-in websocket server, but it is intended for push notifications only, and is not scriptable).
Even if we add full websocket server later (but I still doubt its usefulness), it will be there only for integration with other services. Z-way itself will never be controllable via websockets.
Even if we add full websocket server later (but I still doubt its usefulness), it will be there only for integration with other services. Z-way itself will never be controllable via websockets.
-
- Posts: 3
- Joined: 21 Nov 2015 14:27
Re: websocket client
Thanks for your reply. What kind of push notification do you mean? Is it possible to receive device updates - and if yes, how can I use it? Because this is the only use case I really need.
Re: websocket client
push notifications would be sufficient for my use, no problem using the normal rest api for control. I just want to be notified about device updates as soon as they happen, yet avoid hammering the server with GET requests..
Re: websocket client
Just connect to ws://razberry-ip:8083 from client-side js, and you'll receive everything pushed with ws.push() call from server-side js (ws is a global instance of WebServer object, which serves 8083 port).
-
- Posts: 3
- Joined: 21 Nov 2015 14:27
Re: websocket client
I didn't looked very deep inside the code of the home automation part of Z-Way on GitHub. But I guess have to code a server side module which listens to any kind of update and makes a ws.push(), right?