Page 1 of 1

A way to push data to client side ?

Posted: 12 May 2014 22:55
by edafonseca
Hello,
I'm looking to a way to push devices metrics changes directly to client side, instead of polling information every x seconds.
I know node.js with socket.io can do that for example.
Can I integrate socket.io directly in a home automation module, adding it to node.js dependencies ? How ?

If someone has done that yet, I would be happy to know the best way.

Thanks

Re: A way to push data to client side ?

Posted: 13 May 2014 03:02
by PoltoS
Z-Way has http.request() to push data using HTTP requests. No socket.io available

Re: A way to push data to client side ?

Posted: 13 May 2014 09:22
by edafonseca
Thanks for your reply. Http.request can push data to a webserver, but no to à browser.
Should I make à node.js webserver on the raspberry on which I push data from z-way with http.request and then use socket.io on it to push data to à web browser ? Is that à good way ? Is there another solution ?

So I have to make à module on home automation for that ? Listening events and sending to my webserver ?

Thanks

Re: A way to push data to client side ?

Posted: 13 May 2014 11:57
by PoltoS
We hope to implment websockets in a few months.

Re: A way to push data to client side ?

Posted: 13 May 2014 12:58
by pz1
We hope to implment websockets in a few months
Would be great! I have been pondering for quite a while to push status updates to the UDP listener of OpenRemote instead of frequent polling on that end.

Re: A way to push data to client side ?

Posted: 13 May 2014 15:54
by edafonseca
We hope to implment websockets in a few months
In fact, that would be awesome:) You're doing a really good job, specially the last development version.

I will make a node.js application with a rest api, called by an home automation module (with http.request) who is listening metric events, and push data with socket.io, from node.js to my client interface.

Thank you for your answer.

Re: A way to push data to client side ?

Posted: 18 May 2014 16:08
by alexey.zimarev
It is not that complex to do it now. You can install something like an Apache httpd and PHP on your RPi and add socket.io page, setup http reverse proxy via Apache (good thing to do anyway) and add some pages to handle POST request that you can make from Z-Way virtual device. And your PHP page will push updates to the browser.

But in general the best solution IMHO would be to make Z-Way a Node.js module.