Page 1 of 1

Connection from Zwave UI to other websocket server

Posted: 31 Jul 2017 15:44
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 ?

Re: Connection from Zwave UI to other websocket server

Posted: 02 Aug 2017 14:05
by PoltoS
This is possible with code device

Re: Connection from Zwave UI to other websocket server

Posted: 04 Aug 2017 11:28
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 ?

Re: Connection from Zwave UI to other websocket server

Posted: 08 Aug 2017 17:56
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...

Re: Connection from Zwave UI to other websocket server

Posted: 09 Aug 2017 18:33
by klaasjoerg
Finally got it working somewhat. Will do some final testing and let the community know if it's interesting enough for others...

Re: Connection from Zwave UI to other websocket server

Posted: 10 Aug 2017 15:38
by klaasjoerg
I placed comments into this thread, as it's actually similar:
https://forum.z-wave.me/viewtopic.php?f ... 858#p69858