Voilà, j’avais pas tout dit, mais tu as compris ^^
Have fun
1 « J'aime »
Encore un grand merci à toi. Maintenant je vais m’attaquer aux automatisation.
Bonjour à tous, voici de multiples réveils avec un calendrier contextuel. Je vous partage les codes et suis très preneur d’améliorations.
Configuration YAML :
input_datetime:
wake_up_datetime_1:
name: "Réveil 1 (Date et Heure)"
has_date: true
has_time: true
wake_up_datetime_2:
name: "Réveil 2 (Date et Heure)"
has_date: true
has_time: true
wake_up_datetime_3:
name: "Réveil 3 (Date et Heure)"
has_date: true
has_time: true
wake_up_datetime_4:
name: "Réveil 4 (Date et Heure)"
has_date: true
has_time: true
**Programmation de l’automatisation : (vous pouvez remplacer toutes les actions par vos besoins) **
alias: Réveil 1
triggers:
- value_template: >
{% set wake_up_1 = states('input_datetime.wake_up_datetime_1') %} {% set
wake_up_2 = states('input_datetime.wake_up_datetime_2') %} {% set
wake_up_3 = states('input_datetime.wake_up_datetime_3') %} {% set
current_time = now().strftime('%Y-%m-%d %H:%M:%S') %} {{ wake_up_1 ==
current_time or wake_up_2 == current_time or wake_up_3 == current_time }}
trigger: template
actions:
- target:
entity_id: media_player.chambre_2
data:
media_content_id: PIAF
media_content_type: music
action: media_player.play_media
- delay:
hours: 0
minutes: 0
seconds: 2
- action: script.turn_on
metadata: {}
data: {}
target:
entity_id: script.test
- action: light.turn_on
metadata: {}
data:
rgb_color:
- 178
- 72
- 1
brightness_pct: 15
target:
entity_id: light.chambre
- delay:
hours: 0
minutes: 3
seconds: 0
- action: light.turn_on
metadata: {}
data:
rgb_color:
- 249
- 137
- 62
brightness_pct: 25
target:
entity_id: light.chambre
- delay:
hours: 0
minutes: 3
seconds: 0
- action: light.turn_on
metadata: {}
data:
rgb_color:
- 244
- 199
- 169
brightness_pct: 35
target:
entity_id: light.chambre
- delay:
hours: 0
minutes: 3
seconds: 0
- action: light.turn_on
metadata: {}
data:
rgb_color:
- 255
- 255
- 255
brightness_pct: 50
target:
entity_id: light.chambre
**Programmation de l’intégration LOVELACE **
type: entities
title: Réveil
entities:
- input_datetime.wake_up_datetime_1
- input_datetime.wake_up_datetime_2
- input_datetime.wake_up_datetime_3