Connection from Zwave UI to other websocket server

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
klaasjoerg
Posts: 126
Joined: 30 Sep 2016 23:49

Connection from Zwave UI to other websocket server

Post by klaasjoerg »

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 ?
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: Connection from Zwave UI to other websocket server

Post by PoltoS »

This is possible with code device
klaasjoerg
Posts: 126
Joined: 30 Sep 2016 23:49

Re: Connection from Zwave UI to other websocket server

Post by klaasjoerg »

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 ?
klaasjoerg
Posts: 126
Joined: 30 Sep 2016 23:49

Re: Connection from Zwave UI to other websocket server

Post by klaasjoerg »

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...
klaasjoerg
Posts: 126
Joined: 30 Sep 2016 23:49

Re: Connection from Zwave UI to other websocket server

Post by klaasjoerg »

Finally got it working somewhat. Will do some final testing and let the community know if it's interesting enough for others...
klaasjoerg
Posts: 126
Joined: 30 Sep 2016 23:49

Re: Connection from Zwave UI to other websocket server

Post by klaasjoerg »

I placed comments into this thread, as it's actually similar:
https://forum.z-wave.me/viewtopic.php?f ... 858#p69858
Post Reply