Failing automation

Good evening,

I have an automation which i tried to made a little more simple but now it is not turning off the light every time, what did I do wrong.

  - service: homeassistant.turn_on
    entity_id: switch.fibaro_system_fgs223_double_relay_switch
  id: '1518782294120'
  alias: Garageverlichting aan
  trigger:
  - entity_id: sensor.aeotec_zw100_multisensor_6_burglar
    from: '0'
    platform: state
    to: '8'
- action:
  - service: homeassistant.turn_off
    entity_id: switch.fibaro_system_fgs223_double_relay_switch
  id: '1518782294120'
  alias: Garageverlichting uit
  trigger:
  - entity_id: sensor.aeotec_zw100_multisensor_6_burglar
    from: '8'
    platform: state
    to: '0'
    for:
      minutes: 1

Thanks in advance,

André

The way it is configured the sensor has to see continuous movement for 1 minute to trigger the automation. Is this what you wanted and is it actually happening?

No Tom, I would like it to turn off the light after the sensor status become 0

Hey Tom,

i have the same issue with this automation:

- action:
  - service: homeassistant.turn_on
    entity_id: switch.fibaro_system_fgwpef_wall_plug_gen5_switch
  id: '72057594178191522'
  alias: Garageverlichting aan
  initial_state: true
  trigger:
  - entity_id: sun.sun
    from: above_horizon
    platform: state
    to: below_horizon
- action:
  - service: homeassistant.turn_off
    entity_id: switch.fibaro_system_fgwpef_wall_plug_gen5_switch
  id: '1518782294120'
  alias: Garageverlichting uit
  trigger:
    platform: time
    at: '22:30:00'

Can it be related to the fact that I merged two automations to one and that both id’s are in the automations?

I thought the id was only used for the automation editor. It certainly wouldn’t hurt to comment out the duplicate or change it and see if that helps.

More importantly your aliases are the same. I think that’s bad. Change them so there are no duplicates.

Also I think aliases with spaces in the name should be in single quotes.

Someone may correct me if I am wrong, still learning this myself.

1 Like

Thank you Tom for your effort. I will try and let you know.

Your ID’s inside automations.yaml must be unique for every automation. You have used the same id: ‘1518782294120’ more than once.
Simply change at least 1 digit (and make sure that the id isn’t used elsewhere), and you should be fine.

3 Likes

It worked, feeling such a noob :smirk:

Finally it works, thanks a lot