Automatisation portail/lumière

alors grace a vos différents conseils, j’ai peaufiné le script et ca fonctionne aussi ce matin…yes! merci a tous !!!
voici mon script ( enfin votre script grace a vous)

alias: Gate and parking
description: Switch ON park light for 9 minutes if gate is opened.
trigger:
  - platform: state
    entity_id: switch.sonoff_10014cb802
    from: 'off'
    to: 'on'
condition:
  - condition: template
    value_template: '{{ is_state(''switch.sonoff_100102cc2f_2'', ''off'') }}'
  - condition: template
    value_template: '{{ is_state(''sun.sun'', ''below_horizon'') }}'
action:
  - service: switch.turn_on
    target:
      entity_id: switch.sonoff_100102cc2f_2
    data: {}
  - delay: '00:09:00'
  - service: switch.turn_off
    target:
      entity_id: switch.sonoff_100102cc2f_2
    data: {}
mode: single

Salut
Au sens ha c’est une automatisation. Un script ça existe aussi ça ne serait que la partie action de ton automatisation
En tout cas, bravo

ha ok, je vois…merci :slight_smile:
bon je vais clore le post alors avec celui qui donne la solution.
merci encore !:slight_smile: