This automation script monitors when Philip leaves the home zone. When the device tracker for Philip’s iPhone detects that he has left home, a series of actions are executed to notify the relevant mobile devices and to turn off lights, climate, and his PC. 🏡
The automation triggers when the device device_tracker.iphone_von_phili
leaves the zone zone.home
. Immediately after this event, notifications are sent to mobile applications—and additionally, automation actions disable selected devices in Philip’s area.
📲
The script starts with a clear alias and minimal description, focusing on the "leave" event of Philip’s iPhone. Once Philip leaves home (trigger event), multiple notifications are sent to both Randy’s and Jessica’s iPhone apps. 🔔
Additionally, the automation turns off the lights and climate control for the area assigned to Philip, and switches off his PC (using the entity switch.pc_philip
). This streamlines energy saving tasks when Philip is not at home.
💡❄️💻
Copy the YAML code below and add it to your Home Assistant configuration file (for example, /config/automations.yaml
) to activate the automation.
alias: "Philip hat zu Hause verlassen"
description: ""
trigger:
- trigger: zone
entity_id: device_tracker.iphone_von_phili
zone: zone.home
event: leave
condition: [] # No additional conditions.
action:
- action: notify.mobile_app_iphone_randy
metadata: {}
data:
message: Philip hat zu Hause verlassen
- action: notify.mobile_app_iphone_von_jessica
metadata: {}
data:
message: Philip hat zu Hause verlassen
- action: light.turn_off
metadata: {}
data: {}
target:
area_id: philip
- action: climate.turn_off
metadata: {}
data: {}
target:
area_id: philip
- action: switch.turn_off
metadata: {}
data: {}
target:
entity_id: switch.pc_philip
mode: single
The code above defines the complete automation sequence. You can further customize the "condition" and "action" sections if needed. 🔧
This detailed explanation and organized layout make it easy for both beginners and experienced Home Assistant users to understand and implement the automation. 👍