I would like to connect/control some non-zwave-devices that I can already access via websockets.
Now I am wondering, what's the easiest way to define a virtual-websocket-device in the UI to control a dimmer/light via Websocket connections?
zwave ui ---> virtual device (e.g. light bathroom) ---> websocket connection ---> third party non-zwave-websocket server
Is this possible, without having to write a new zwave-me-app ?
Connection from Zwave UI to other websocket server
-
- Posts: 126
- Joined: 30 Sep 2016 23:49
Re: Connection from Zwave UI to other websocket server
This is possible with code device
-
- Posts: 126
- Joined: 30 Sep 2016 23:49
Re: Connection from Zwave UI to other websocket server
Just to make sure, I am trying the right way:
a.) Zwave is able actively opening a websocket connection against another websocket server?
and
b.) So I can write the whole Javascript (opening connection, send websocket command, close websocket connection) just into one line ?
a.) Zwave is able actively opening a websocket connection against another websocket server?
and
b.) So I can write the whole Javascript (opening connection, send websocket command, close websocket connection) just into one line ?
-
- Posts: 126
- Joined: 30 Sep 2016 23:49
Re: Connection from Zwave UI to other websocket server
I tried a little example, entering something like this into a code device, which didn't work...
function WebSocketKnaus() { var ws = new WebSocket("ws://192.168.0.1:9000/","toptron-protocol"); ws.onopen = function() { ws.send("set:LIGHT_OUT1=$$"); }; }
Having the feeling that websocket is not really implemented as a server-side client...
function WebSocketKnaus() { var ws = new WebSocket("ws://192.168.0.1:9000/","toptron-protocol"); ws.onopen = function() { ws.send("set:LIGHT_OUT1=$$"); }; }
Having the feeling that websocket is not really implemented as a server-side client...
-
- Posts: 126
- Joined: 30 Sep 2016 23:49
Re: Connection from Zwave UI to other websocket server
Finally got it working somewhat. Will do some final testing and let the community know if it's interesting enough for others...
-
- Posts: 126
- Joined: 30 Sep 2016 23:49
Re: Connection from Zwave UI to other websocket server
I placed comments into this thread, as it's actually similar:
https://forum.z-wave.me/viewtopic.php?f ... 858#p69858
https://forum.z-wave.me/viewtopic.php?f ... 858#p69858