Door automatisation

I think it should be very easy, but I cannot figure it out. I want the lights (switch) go on when the door is opened. Then the light should go off when the door is closed or when the door is open voor 5 minutes. How can this be done?

I now have the simple automation:

  • alias: door open
    trigger:
    platform: state
    entity_id: binary_sensor.door_window_sensor_158d0001a65ccc
    to: ‘on’
    action:
    service: switch.turn_on
    entity_id: switch.wall_switch_ln_158d00014ab06b
  • alias: door close
    trigger:
    platform: state
    entity_id: binary_sensor.door_window_sensor_158d0001a65ccc
    to: ‘off’
    action:
    service: switch.turn_off
    entity_id: switch.wall_switch_ln_158d00014ab06b

I assume the problem is that you don’t have the 5 minute timer part working?

I recommend adding a second trigger to the “door close” automation, make it a state trigger on the sensor going open for 5 minutes as shown in the example in the docs.

See example here for “State trigger”

And syntax how to add multiple triggers (same page at the bottom)

1 Like

I thought it was easy, thanks. I think I looked over this option.