Turn lights off after 10 minutes

Okay, so maybe it’s a noob question.
I park my car in the garden and i want to turn the garden lights on when i enter home zone between 00:30 am and 02:00 am for only 10 minutes and then they have to go off.

Can i do this in 1 automation?

Sure, the easiest way is with a trigger for entering the home zone, a condition that the time is between those two times, and turn on, delay, turn off in the action.

trigger:
  platform: state
  entity_id: person.whoever
  to: 'home'
condition:
  condition: time
  after: '00:30:00'
  before: '02:00:00'
action:
  - service: light.turn_on
    entity_id: light.whatever
  - delay: '00:10:00'
  - service: light.turn_off
    entity_id: light.whatever
2 Likes