When one sends the command to change state of a device, whether manually or via an automation, and homeassistant fails to complete that state change (for whatever reason - device unreachable, internal homeassistant error, etc) it would be good to be able to use this as a trigger for an error handling automation. To send a notification, for example.
Currently the only way I can think to do this is to watch the log file for certain errors.
Today I thought I remotely turned on my sprinkler on a 30 minute timer but the ‘off’ command at the end quietly failed and I got home 5 hours later to find my grass still being watered