Problem with automations not triggering

I have numerous automations that fail to trigger in .91.0 and .91.1. I do see the state being reflected in states.

Here is one that fails:


Also, I am manually editing in automations.yaml, I’m careful and have checked my ID: numbers are unique. I just use the next number, i.e. increment by one, is that ok?

Thank you

May I suggest adding the line initial_state: true at the beginning of your automation (right after the id line).

That did not make any difference, is that needed?

I don’t know if it is necessary. I only know it has solved a lot of my automation triggering issues. :slight_smile:

Entered in wrong place, retried, works. Thanks !!!

Have maybe 25 automations that worked just fine for a month, then suddenly broke. Will check the rest out next…

Thank you again!

Fixed them all, thank you. Now, why did they work and then stopped ?

These issues started popping up with me around the upgrade to v 0.82.x. I dunno if that helps or not.

Explanation here:

Before adding initial_state: true, did you check the States page to confirm the affected automations were on and not off?

After a restart, Home Assistant restores all automations to their previous state. If they were on, they will be restored to on. If they were off, they will be restored to off.

If Home Assistant encounters an error during its startup, it may fail to restore automations to their previous state. When it finally does restart successfully, it may set (not restore) all automations to off.

initial_state: true is an option that overrides the restore function. The option instructs Home Assistant to always set the automation to on even if it was previously off. In other words, if you choose to temporarily turn off an automation, it will be automatically turned back on after a restart.

FWIW, I don’t have restart failures so none of my automations use initial_state: true. They all get restored to their correct state (whether on or off) after a restart.

I did not check the States page. I’ve been getting into HA for 3 months and never encountered, or was aware, of the automations on/off aspect.

Got maybe 100 scripts and automations, they always worked fine. I’m sure there is more to learn…

Yer special. :slight_smile:

To help others here, I experiment with numerous automations, entities, and templates on my test system (Docker version of Home Assistant on a notebook PC). The experimentation process can subject the test system to several restarts in just one day. I’ve yet to encounter the situation where some or all automations fail to be restored correctly. It works as advertised and that’s why I don’t use initial_state: true.

So when I read reports that the restore feature fails and sets automations to 'off` I think “Well now, that’s special.” :slight_smile: