Bj
je vous partage une automatisation interactive qui va affiché un popup sur votre votre téléphone en cas d’absence .
Pour commence crée un binary_sensor du style:
- platform: template
sensors:
presence_domicile:
unique_id: presence_domicile_tracker
friendly_name: " Présence Domicile Tracker "
value_template: >-
{{is_state('device_tracker.phone_XXXX', 'home') or is_state('device_tracker.phone_XXXX', 'home')}}
Ensuite aller dans automatisation et collé ceci ( pensé a modifier les jours semaine si besoin, les devices
pour mes chauffages quand tout le monde est absent
alias: "[ INTERACTION ] Les chauffages sont restés allumés"
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.home_presence
from: "on"
to: "off"
condition:
- condition: and
conditions:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- sat
- sun
alias: Est-ce un jour de semaine ?
- condition: or
conditions:
- condition: state
entity_id: climate.thermostat_chambre
state: heat
- condition: state
entity_id: climate.thermostat_cuisine
state: heat
- condition: state
entity_id: climate.thermostat_salle_de_bain
state: heat
- condition: state
entity_id: climate.thermostat_salon
state: ""
alias: Les chauffages sont-ils allumés ?
action:
- alias: Définir des variables pour les actions
variables:
action_no: "{{ 'NO_' ~ context.id }}"
action_turnoff: "{{ 'TURNOFF_' ~ context.id }}"
- alias: Notify Mobile
service: notify.mobile_app_XXXXXXX
data:
message: Les chauffages sont toujours allumées. Éteindre ?
data:
actions:
- action: "{{ action_turnoff }}"
title: Éteindre les chauffages
- action: "{{ action_no }}"
title: Laisser Allumé
enabled: false
- alias: Notify Mobile
service: notify.mobile_app_XXXXXXX
data:
message: Les chauffages sont toujours allumées. Éteindre ?
data:
actions:
- action: "{{ action_turnoff }}"
title: Éteindre les chauffages
- action: "{{ action_no }}"
title: Laisser Allumé
- alias: Attendre la réponse
wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_no }}"
context:
user_id:
- 543e2d3b33644370ba8216600c3c965e
- 065aee2fc9284c4e9d463c1b04e8659a
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_turnoff }}"
context:
user_id:
- 543e2d3b33644370ba8216600c3c965e
- 065aee2fc9284c4e9d463c1b04e8659a
- alias: Exécuter l'action
choose:
- conditions: "{{ wait.trigger.event.data.action == action_no }}"
sequence: []
- conditions: "{{ wait.trigger.event.data.action == action_turnoff }}"
sequence:
- service: climate.turn_off
data: {}
target:
entity_id:
- climate.thermostat_chambre
- climate.thermostat_cuisine
- climate.thermostat_salle_de_bain
- climate.thermostat_salon
mode: single
Donc en cas d’absence de la famille , HA envoi ceci sur votre smartphone