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