Time based action

Dears,
a while ago i got me a Lora Tap 4 button portable remote control (SS6400ZB) and was able to set up a automatisation to manually switch on a smart light (wich is usually controlled by a motion sensor) using the button from the remote controll.

Stupid question: How can i configure the automatisation to swith the light off again after it was on for e. g. 5 or 10 Minutes?

Thank you in advace for your support!

triggers:
  - trigger: state
    entity_id: light.my_light
    to: 'on'
    for:
      minutes: 5
actions:
  - action: switch.turn_off
    target: 
      entity_id: light.my_light
1 Like