Why simple Automation doesn't trigger?

Did you quit the startup process halfway? Or didn’t you close HA entirely (meaning force closed by killing the process?). I find that when I stop the startup process at the exact moment the automations get loaded all automations will turn to the off state. (I do this because sometimes I forget to add something and it is faster to just force quit it than to wait till it is fully startup and then close again). Or if the startup process could not complete (because of any breaking changes) this could happen too. (at least that is my experience). So you could do multiple things:

  • Set initial state to ‘on’ for each automation you want to be ‘on’ at startup.
  • Create a group/button that you could turn on/off whenever you please, for example with an input boolean.
  • Create an automation with initial ‘on’ to turn on all other automations (seems a bit stupid but hey it is possible).

If there are 0 automations that need to be off at the start you could just turn all automations on/off via the group.all_automations entity (which is always present by default). Go to the dev-tools and open the services panel. Use for example the homeassistant.turn_on service and then the entire group. In my case I was lazy and just made a single button which does exactly this (so if the automations are off I just need to press this button.) not the most ideal situation, but saves some time if you have over 50 automations like I do :stuck_out_tongue:

Yes, the group functionality is a great one. Instead of setting initial_state: true for these automations (that always need to be on) one could also create a group with these automations and use that in the unfortunate situation HA didn’t restore their state, and even automate that process at startup… using the all option Group - Home Assistant

could be a nice go between, and I use it for that purpose only. (far over 50 automatons here, so it was kind of a pain to reset all of them over and over again)

I’m just going to make a group with a handful of automations that I never turn off or would want off (door alerts etc) maybe 5 or so and if those are ever all off at once I will know something is up… lol thanks for questioning it or I never would have realized it wasn’t gonna work.

something like this:

# use the `all: on` option for this group to force the group to be only on when all automations are on
- alias: 'Secure automations on at startup'
  id: 'Secure automations on at startup'
  initial_state: 'true'
  trigger:
    platform: homeassistant
    event: start
  condition: []
  action:
    - condition: template
      value_template: >
        {{states('group.automations_always_on') != 'on' }}
    #- service: homeassistant.turn_on
    #  entity_id: group.automations_always_on
    - service: notify.notify
      data:
        title: 'Check automations!'
        message: Not all automations were restored, please secure your system..

I’m not gonna have it turn them on automatically I’m just gonna have it notify me that they are all off so I can go turn on the rest that should be on… it’s only happened 2 or 3 times so I don’t mind checking and then I will be aware it messed up.

I have a start up script that enables or disables all my automations depending on the state of an ‘automation mode’ input select (all off, away, home, guest etc…). The start up script is one of the few scripts that have the initial state set to true. The others are hidden automations that work in the background (e.g. monitoring for manual change of ‘automation mode’ input select).