Help with Command class "get" in automation

I have figured out how to update the clock on my Zwave thermostats with Command Class 129 “set”

What I would like to do is only update them if they are on the wrong time (mostly due to power outages or daylight savings time)

Is there a way to do a "command class 129 “get” and check if the time is different then the system time (plus or minus a few minutes) and then trigger the 129 set?

Is there a way to only run an automation on a Day light savings weekends?

Right now I just update them every Sunday afternoon if they need an update or not.

Is there a way to make this more efficient?

Since Z-Wave integration services do not return any values, you can’t access the result from a Get command without using a somewhat complicated trigger-based template sensor. The effort and complication is not worth it, IMO.

Probably. Here’s the first hit in a search I found. Daylight Savings Time (DST) - Template and Automation

Here’s a simple binary sensor to indicate DST or not: Automatic shifting of some automations based on daylight savings time - #7 by tom_l

Does DST matter though? Presumably the time may be wrong during any time of the year, whether by power outage or drift.

This seems like the most reliable and efficient solution, IMO. Once a day would be fine even. Early Sunday morning would catch DST changes sooner.

Why do you think your approach is not efficient? Getting the time from the device then setting it may take twice as many commands as simply setting the current time. Unless your thermostats have some weird issue with the Set, setting them should have little impact on your z-wave network, especially if only once a week.

BTW, Z-Wave JS has a node API function to set time and date for you, which attempts to choose the best command class (there are multiple) and worry about time zones. The HA python library even supports it already, but it’s not available in HA. Might make a good feature request, there’s no reason this couldn’t be a service call.

In the condition section of your automation select device as your condition then select a Z-Wave device as your device. Once you do this you will get an option named Current Value of Z-Wave Value. This will check to see if the current value matches what you have input. If your click the 3 dots in the top right of the condition and click test it will tell you if the condition passes or not. If it passes that means then current value you have in your automation matches what your device has.

You could probably use this in your automation. I would set the automation to run at a certain time everyday then check to see if the clock is wrong |by using the condition then use the Set Value of a Z-Wave Value action to update it.

This is basically what I was suggesting in the quote here, except an automation would be much simpler than using a template sensor.

Unfortunately, both suggestions are dead in the water for this specific use case. There are no values to trigger on for CC 129 (Clock CC).

You’d still be left with polling the device to get updates (unless it happens to send periodic unsolicited updates) which is less “efficient” than just setting it blindly.

2 Likes

Unfortunate for the clock command class “CurrentValue” was not accepted by Zwave JS as an acceptable “property” for Command Class 129 (clock)

I’m going to stick with the Sunday Morning updates.

I also suspect that the only person that looks at the day/time on the thermostats is me.

I will stop over thinking this…

Thanks again.