Turn Off entrance light after 5 minutes

Hi there,

I am new to Home Automation, and I searched alot of hours today and tried implementing a delay for light.turn_off.

In short: I have a Automation which turns on my Entrance light when arriving home, and I want this to be turned off after 5 minutes, I dont know how to do that in the online editor?
I tried this:

Action: Call Service
Service: light.turn_off
{
“entity_id”: “light.entre”,
“delay”: “0:05:00”
}

You could just add the delay and switch off into the automation that turns it on…

  - service: light.turn_on
    data:
      entity_id: light.entre
  - delay: 0:05
  - service: light.turn_off
    data:
      entity_id: light.entre

The above may not be 100% right as I ripped it out of another automation I use and took some bits out. But it should give you the basic idea.

1 Like

I have the same automation. You can use ‘for’ in your trigger so that it triggers when something has been in the current state ‘for’ an amount of time, in my case 10 minutes:

    - alias: "Buitenlamp uit na 10 minuten"
      trigger:
        platform: state
        entity_id: light.voordeur
        from: 'off'
        to: 'on'
        for:
          hours: 0
          minutes: 10
          seconds: 0
      condition:
        condition: state
        entity_id: binary_sensor.fibaro_multisensor_hal_sensor
        state: 'off'
      action:
        service: light.turn_off
        data:
          entity_id: light.voordeur
          transition: 30

I had to do it this way because the light is also controlled by another automation and I needed the condition.

4 Likes

The solution could be done in several ways.
Instead of having specific period of time to turn off lights i rather have time after latest motion.

Thanks for Your solutions, I just tried @allan 's solution, and it worked.

@dawnlord , I guess You need a motion sensor for that to work, or am I wrong?

Ah sorry i assumed it was motion detection and not presence detection

I’m looking to do something similar.

I have Philips hue that already turns my lights on and off after a few mins already via motion sensor ,but wanted to trigger other devices to turn on and off in home assistant using the motion sensor.

Any automation examples of this?