Automations - How to tell if they are broken?

Per the title, is there anyway to tell which automatons are broken?

Broken how?

If they use invalid syntax you will have warnings in the log and home assistant will probably refuse to restart.

If you use device ids and the devices are missing the automations will be marked as unavailable.

You may go to automations list and open “Traces”.
So you will find out exactly which step the automation isn’t working as expected.

They want to know which of their automations are “broken”, not why a particular automation is not working.

A good start would be to order the automations by last triggered.
The ones that never executed are good candidates that something is wrong.

2 Likes

Watchman may help too.

This is what I used.

I come from Homeseer, and when any automations are broken they are highlighted when listing. Makes it much easier to locate problems.

Spook integration can do some checks

But you still haven’t defined what you mean by “broken”. So we are left guessing.

I’m not the OP, but I do know what I don’t want HA to think. For one thing, I’d hate for an automation to be reported broken (i.e. stop working) if an entity is unavailable. e.g. the chrismas lights are “broken” 10 months out of 12, but I’d still like my go to sleep automation to try to turn everything off nonetheless. That automation is not broken.

I’d also do not want an automation to be broken if one of the trigger entities is unavailable if there are more ways the automation can be triggered. I dislike that HA disables automations when a device being used is “broken”. That is why I (and most people) stay away from device actions. I’m hoping ZHA will start using event entities asap, becasue that is what I still use device triggers for. I’d like to eliminate those, but events are a bit convoluted…

I do like watchman, because it tells me entities that are used somewhere that are unavailable unexpectedly. It also tells me where they are used. My Christas lights are on the ignore list. More often than not, it is the entities that need fixing, not the automation using it. It is a bit of a shame Watchman does not take helpers in to account though.

Then don’t use device ids.

I was looking for “same thing OP wants” (if I’m reading it right?).
I wanted something to tell me when any of my Automations are trying to read from, or send calls to, entities that are broken or deleted.
Just installed Watchman – great tool!

I use Spook for that. Posts in Repairs if any entity is missing from scenes, automations, lovelace, scripts, etc…

Spook and Watchman are complementary: Spook detects GUI configured things that Watchman doesn’t. Watchman is yaml focussed and detects things Spook doesn’t. So I use both.

1 Like