Why will not this simple automation trigger?

I made this 100% by the web gui, but it don’t trigger it seems like.
It is for turning kitchen light on when movement and off after 5min else.

- id: '1558207527936'
  alias: 'Kjøkken: Slå på lys ved bevegelse'
  trigger:
  - entity_id: binary_sensor.zwave_2_sensor
    platform: state
    to: 'On'
  condition: []
  action:
  - alias: ''
    data:
      entity_id: light.zwave_21
    service: light.turn_on
- id: '1558207722841'
  alias: 'Kjøkken: Slå av lys ved ingen bevegelse'
  trigger:
  - entity_id: binary_sensor.zwave_2_sensor
    for: '5'
    platform: state
    to: 'Off'
  condition: []
  action:
  - data:
      entity_id: light.zwave_21
    service: light.turn_off

I can see the sensor entity is triggerd in entities . And this is a little conflicting:

2 things -

  • The state should be lowercase. You have “On” and it should be “on”, for instance.
  • Make sure that the automation is enabled. You can forced that by adding initial_state: true, and check it in dev-state
1 Like

You also have a line

  - alias: ''

after action: in the first automation that shouldn’t be there.

Yeah, that too :slight_smile: Missed that one.

The upper-case was the issue.
Thanks :slight_smile: work now

Must be a bug in the web editor then.

Good to hear. When in doubt, check what the actual string is in dev-state to make sure you’re checking for the right thing. Spaces and case count.

1 Like