Automations not triggering

Hello,

I have a series of automation , none are being triggered. I removed everything and I kept a very simple one:

- id: ChristmasLightsOn
  alias: Turn On Christmas Lights
  trigger:
  - entity_id: switch.outside_sw_120
    platform: state
    to: 'on'
  action:
  - data:
      entity_id: light.s31_1
    service: light.turn_on
  - data:
      entity_id: switch.patio_smart_switch_150
    service: switch.turn_on

To test I start the “switch.outside_sw_120” in “off” state and turn it on. The trigger is not triggered.

I confirmed the entity_id everything looks good but the trigger is not triggered. No errors no nothing.

Try:

- id: ChristmasLightsOn
  alias: Turn On Christmas Lights
  trigger:
    - platform: state
      entity_id: switch.outside_sw_120
      to: 'on'
  action:
    - service: light.turn_on
      entity_id: light.s31_1
    - service: switch.turn_on
      entity_id: switch.patio_smart_switch_150

nope, still not working

Did you reload the automations or do a restart of HA?
Did it work before?

and without - id… ?

- alias: Turn On Christmas Lights
  trigger:
    - platform: state
      entity_id: switch.outside_sw_120
      to: 'on'
  action:
    - service: light.turn_on
      entity_id: light.s31_1
    - service: switch.turn_on
      entity_id: switch.patio_smart_switch_150

You can also use groups as your targets. I have something very similar shown below.

#Turn on other switches when great room light is turned on.
- alias: 'Rule 12 Slave outlets to GreatRoom On'
  trigger:
    platform: state
    entity_id: switch.great_room_lights_switch
    from: 'off'
    to: 'on'
  action:
    service: homeassistant.turn_on
    entity_id: group.gr_light_slaves

#Turn on other switches when great room light is turned on.
- alias: 'Rule 13 Slave outlets to GreatRoom OFF'
  trigger:
    platform: state
    entity_id: switch.great_room_lights_switch
    from: 'on'
    to: 'off'
  action:
    service: homeassistant.turn_off
    entity_id: group.gr_light_slaves

both, reload the automations - it made no difference, then I restarted HA.

It did work, but I think when I switched to 0.84 they stopped working.

Does the state of switch.outside_sw_120 update in lovelace/states when you toggle the switch?

Yes - it does change,

Tried without id as well, restarted HA.

Tried something similar to your - no help.

This was the issue, I always had them active - manually re-enabled all of them ant now I’m good. Thanks for pointing out what I already read but I disregarded.

Regarding this:

If you don’t set this the previous state is restored. If you shut Home Assistant down before it finishes starting, the automation will be stored as being off, and your automations will be disabled at the next startup.

I have some automations disabled depending on the state of an input select (automation mode: normal, guest, away, etc…).

To make sure the correct automations are enabled at start up I check the state of the input select during a startup triggered automation and call the corresponding script that sets the correct states.

99 times out of 100 this isn’t needed as I’m careful to make sure HA has fully started before shutting down.

This is absolute insanity. My wife, while cleaning, unplugged my HA system and plugged it back in twice with a minute. All of my automatons quick working including fire and security.

This is a BUG and must be fixed.

Unintended behaviour from improper shutdown is not a bug. You are lucky the SD card was not corrupted and that it stated at all.

Also there is a way to ensure an automation is always enabled on startup. I suggest you apply it to your fire and security automations at least.

1 Like