I’m noticing cases where an automation will fire, and there will be a logbook entry to show it, but the device didn’t change. For example, automations that change the TV volume, or set a thermostat temperature. 90% of the time they work as expected, but then there will be a time when it should have changed but didn’t.
My only thought is to rewrite all of my automations to apply device changes in a “Repeat until” loop, checking over and over (with a delay) that the setting changed, otherwise sending it again. However this will get pretty bulky and complicate my automations.
I’m curious whether this is a common problem, and if there are better ways to handle it?
I do this all the time when it’s a critical automation where I need to ensure the device actually changed its state, such as a pool automation where I don’t want to overdose it with pool acid. However, I use the Node-Red Add-On so can’t help much with the built-in automations. It’s fairly simple in Node Red to first get the state of the device (on, off or unavailable), then send the command and add a small delay, then check the status again and loop if it didn’t change as expected. You can loop for a set amount of time or a set number of loops, and send a notification message if it is unavailable of simply not changing state as expected.