I’ve tried to find solution for years because my MCOHOME Zwave thermostats drift heavily. Can’t be bothered to click ‘set time and date’ in zwave-js UI every bloody day.
Had an idea long time ago, now implemented it. I suspect there are others who might find this useful.
In Zwave JS UI (Settings → General) add a Scheduled Job (Enabled, but not On Init). Cron string can be like 0 3 * * * for once every night 3 AM. And code:
Oh nice! I haven’t tried the scheduler…learn something new everyday
For what it’s worth, I used the following a year or so ago just to try and set the clock on a device using an Action from HA (haven’t played much with it since):
where the 129 command class is the CLOCK_COMMAND
17 is the hour,
12 is the minute and
6 is day (Saturday).
It seemed to work.
Here is the corresponding GET:
Fantastic, thank you so much for this. I can’t use command class 129 with my zwave heaters, they don’t support it, so this is the closest I can get. The clocks drift horribly.
I’m trying to use your example but running into difficulty. Z-Wave JS v15.15.3 and Z-Wave JS UI 11.5.2 running on HaOS. I’ve pasted your code into the Scheduled Job section and set the crontab to run and hit save. The job runs at the correct time but I’m getting the following error:
ERROR GATEWAY: Error executing scheduled job Time Sync: require is not defined
I’m not sure how to proceed. Any guidance is greatly appreciated. Thanks!
It’s been a couple of weeks, anyone have an idea on why it’s failing for me? googling just leads me in circles about missing dependencies and such, all of which didn’t appear to be applicable to the HA environment. Any and all assistance is appreciated.
@BenCranston I don’t think it is the fault of this code, it appears to be a problem in the addon itself. Not even the ping snippet given as an example is working. I’m having the same issue after updating recently.