Set clock of z wave device

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
sailmich
Posts: 245
Joined: Wednesday 17 February 2016 22:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Germany
Contact:

Set clock of z wave device

Post by sailmich »

Rpi3/domoticz beta/Zwave stick
Hello, I have two devices MH7H WH up and running. The devices displays also date and time. Unfortunately is the clock very inaccurate after a while. When in ozwcp selecting the device under information Set Date/Time and submit, the device will get the actual real time. I tried to analysed the network traffic but couldn't get a http command for use in dzvents. Is there a possibility for a script in dzvents?
Any help appreciated!
mgugu
Posts: 226
Joined: Friday 04 November 2016 12:33
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

Re: Set clock of z wave device

Post by mgugu »

May be a hint: I got a similar problem with a Qubino temperature sensor which was not automatically updated. It was possible to update manually via the refresh command in ozwcp/information.
Chrome dev tool shows that the issued command is:

Code: Select all

http://<domoticzIP>:8080/ozwcp/refreshpost.html with:
method : POST
data : fun=racp&node=<nodeID>
Content-Type': 'application/x-www-form-urlencoded'
That you can reproduce via curl:

Code: Select all

curl -d "fun=racp&node=<nodeID>" -X POST "http://<domoticzIP>:8080/ozwcp/refreshpost.html"
I made a dzvents script to generate this command periodically.
This worked, but only for a few hours...
I found that to remake it working I had to manually open before the hardware page at http://<domoticzIP>:8080/#/Hardware/<hwid>
I tried to automate that but it did not work.
I thought about an authentication problem so I included cookies management in the process: Not better.
In fact the hardware page has to be opened in a real browser, may be that linked javascript initialize something, don't know.
Finally the solution I found is to use a virtual browser (definitely not elegant !). I used Selenium with nodejs but you can find it with Python.
It worked
sailmich
Posts: 245
Joined: Wednesday 17 February 2016 22:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Germany
Contact:

Re: Set clock of z wave device

Post by sailmich »

Thanks for your answer. The time is not that important when I know that I can't trust the clock I just ignore it. I will stay with wrong time as long as I don't get an easy solution.
Cheers
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest