Pour des choses simples, j’utilise l’interface. Quand c’est plus compliqué, j’utilise un mixte des deux.
Finalement, j’ai fais ça (j’ai un peu melangé les switchs et les booleans… mais bon !!)
alias: Chauffage ON Temporaire Salon
description: ''
trigger:
- platform: state
entity_id: input_boolean.switch_timer_on_chauffage_salon
from: 'off'
to: 'on'
condition: []
action:
- service: input_text.set_value
target:
entity_id: input_text.text1
data:
value: '{{ states(''input_select.chauffage'') }}'
- service: input_select.select_option
target:
entity_id: input_select.chauffage
data:
option: '{{ states(''input_select.chauffage5'') }}'
- service: switch.turn_on
target:
entity_id: switch.etat_timer_salon
- service: timer.start
data_template:
entity_id: timer.temps_chauffage_temporaire_salon
duration: '{{ states(''input_number.chauffage_timer_salon_minutes'') | int }}'
mode: single
alias: Chauffage OFF Temporaire Salon
description: ''
trigger:
- event_data:
entity_id: timer.temps_chauffage_temporaire_salon
event_type: timer.finished
platform: event
- platform: state
entity_id: input_boolean.switch_timer_off_chauffage_salon
from: 'off'
to: 'on'
condition: []
action:
- service: input_select.select_option
target:
entity_id: input_select.chauffage
data:
option: '{{ states(''input_text.text1'') }}'
- service: switch.turn_off
target:
entity_id: switch.etat_timer_salon
mode: single
chauffage_timer_salon_minutes:
name: "Timer Chauffage Salon"
min: 0
max: 10
step: 1
unit_of_measurement: "hrs"
icon: mdi:timer-sand
switch_timer_on_chauffage_salon:
name: "Départ Timer Chauffage Salon"
initial: off
icon: mdi:timelapse
switch_timer_off_chauffage_salon:
name: "Arrêt Timer Chauffage Salon"
initial: off
icon: mdi:timelapse