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
A way to push data to client side ?
Re: A way to push data to client side ?
Z-Way has http.request() to push data using HTTP requests. No socket.io available
-
- Posts: 13
- Joined: 12 May 2014 22:48
Re: A way to push data to client side ?
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
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 ?
We hope to implment websockets in a few months.
Re: A way to push data to client side ?
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.We hope to implment websockets in a few months
Since 29-12-2016 I am no longer a moderator for this forum
-
- Posts: 13
- Joined: 12 May 2014 22:48
Re: A way to push data to client side ?
In fact, that would be awesome:) You're doing a really good job, specially the last development version.We hope to implment websockets in a few months
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.
- alexey.zimarev
- Posts: 24
- Joined: 16 Oct 2012 17:54
Re: A way to push data to client side ?
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.
But in general the best solution IMHO would be to make Z-Way a Node.js module.