Automation on devices not available / stay asleep

I have a number of ZigBee and ZWave devices that don’t report battery levels correctly. One of them (my hall thermostat) reports that the battery level is 39% but it’s asleep and hasn’t woken up for weeks. I didn’t notice…

Can anyone suggest automation which I can use to report on these devices going to a particular status (e.g not available) for x hours or staying asleep for y hours?

Thank you!

Thanks, @123! I’ll try that later. You mention “iridris” what’s that? I had a quick search but can’t find it.

I’m still confused about my hall thermostat though. I moved it from Smartthings (hub died…) to a Z-Wave dongle and whilst the battery levels worked perfectly in Smartthings, using “just” HA - it’s always 39% which is a royal pain. (Partner wants to turn the heating up and it doesn’t work because I don’t know the batteries are empty). I guess that’s too much for someone like me to try to fix :frowning:

It’s a community member’s moniker. They were participating in the discussion.

Ah thanks @123 - didn’t spot the reference.

So been playing with this for a bit and spotted that my Thermostats’ “last changed” value doesn’t actually change regularly. I think I can get around that by using the last_updated value which I guess changes every time the temperature in the room changes so that’s unlikely to remain the same for 24 hours.

Does that make sense?

If the value of an entity’s attribute changes (but the value of the entity’s state remains the same) last_updated will change but last_changed will not.

Reference: State Object

Thanks @123 - that’s what I figured but my assumption was that a Z-Wave device sleeps a lot, and wakes up e.g. every 15 minutes (but not sure how to check that) so when it does, its state changes and the last_changed flag changes. That doesn’t seem to happen and that surprised me.

I rebooted HA last night at about 20:00:00 and at 21:10:00 the last_changed time stamp was still set to 20:00:00 so I was surprised it hadn’t woken up by then. I then changed the set temp by a degree and the last_update value changed but the last_changed value remained the same.

I just checked and the last_changed value is still last night at 20:00:00. No idea what’s going on with this thing thermostat.