Saving automation turns on ALL automations in UI

Hello

I have an ongoing issue. I have some automations turned on in UI and some turned off. If I edit an existing automation or create a new one ALL my automations automatically turn on in the UI.

How do I stop this from happening?

Thanks.

If you put ‘initial_state: ‘off’’ or ‘initial_state: ‘on’’ in the automation config then they will use that state when you reload your automations or restart HA.

ex:

- alias: Turn on livingroom lights when there is movement
  initial_state: 'off'
  trigger:
    platform: state
    entity_id: sensor.motion_indoor_camera_living_room
    to: 'on'
  action:
    service: homeassistant.turn_on
    entity_id: 
      - switch.west_livingroom_lights_switch
      - switch.east_livingroom_lights_switch
2 Likes

This does not seem to work for me, I have tried initial_state: ‘off’ and initial_state: ‘false’ and both times all automations are switching back on when reloading or saving a new automation or editing an existing automation.

I use customize_glob in configuration.yaml

  customize_glob:
    "automation.*":
       initial_state: on
1 Like

AOk so to follow up your solution DOES indeed work if you add the initial_state: 'off' directly to the automations.yaml. HA doesn’t seem to honor the initial_state: 'off' if placed in customisation.yaml which is where I was setting the state.

This seems like a bug?

Thanks for your help.

I did not know about that feature, many thanks.

you don’t need ’ for on or off
just initial_state: on
initial_state: off

1 Like

At least the docs here state that initial_state is possible setting to add. Who from HA side could verify?

1 Like

I don’t use the automation generator in the web front end and yet despite using the below settings in my automations they will still trigger:

initial_state: off

I’ve also tried ‘false’ etc and that doesn’t work.

I’m using include dir statements to split up my config.

try wrapping off in quotes:

initial_state: 'off'

Nope, tried that.

I’ve tried all variations I can think of:

false
‘fase’
off
‘off’
‘disabled’
disabled

I do think it’s some kind of bug because it doesn’t always happen, but I can’t pin down exactly what changes when it does/doesn’t happen…

What version of HA are you running? It very well could be a bug in the newest version because of the new state storage system.

And make sure to correct mark:

'

And not:

`, or any other pointy mark

Def using the correct mark…

I’m running 0.83.3