Switch Delay

Hello

I have an switch that turns my lights of, but i when i press it, i want it to activate a delay for 2min en then shut off. how can i do that?

greetz Amaury

- alias: Turn off light after 2 minutes
  trigger:
    platform: state
    entity_id: switch.your_switch
    to: 'off’
    for:
      minutes: 2
  action:
    service: homeassistant.turn_off
    entity_id: light.your_light

you could do something like this.
- delay: '00:02:00'
automation.yaml

- id: tv_on_samsung
  alias: Turn on Samsung
  trigger: 
    - platform: state
      entity_id: input_boolean.samsung_tv
      to: 'on'
  action:
    - service: script.turn_on
      entity_id: script.samsung_tv
    - delay: '00:02:00'  
    - service: script.turn_on
      entity_id: script.samsung_tv_off