Automation to dynamic on or off switch

hi , this automation is work manualy , i want make it dynamicy

- id: '1709162103674'
  alias: off boiler
  description: ''
  trigger:
  - platform: device
    type: turned_on
    device_id: 82ba1491ac50a3ba8288aa59582e57f7
    entity_id: 63761457c24140355711dd40b4e3292f
    domain: switch
  condition:
  - condition: device
    type: is_on
    device_id: 82ba1491ac50a3ba8288aa59582e57f7
    entity_id: 63761457c24140355711dd40b4e3292f
    domain: switch
    for:
      hours: 0
      minutes: 2
      seconds: 0
  action:
  - type: turn_off
    device_id: 5f1cd4a8200523da5e6cff8d91f6a32f
    entity_id: ec0f4515416d8b84ef0a5f831415fb81
    domain: switch
  mode: single

Hello there,

What do you understand by manually and dynamically?

Switch 2 turns on if switch 1 is on for 2 minutes.
Sounds dynamic to me.

I see what you are doing, but to actually help you it would be good to know what you are trying to accomplish.

What I want is that when the first switch is on and stays on for 2 minutes, the second switch should turn off within 2 minutes. I set the time to 2 minutes because when the electricity goes off and then comes back on, the first switch, which is Sonoff Basic, connects quickly to the Internet, but the second switch, which is Sonoff Mini3. There is a little delay in connecting to the Internet