How It Works
The automation leverages Home Assistant’s zone feature to detect when I leave the school zone after dropping off my kids. The espresso machine is connected to a smart switch, allowing me to control it through Home Assistant. The machine is turned on only during the morning drop-off times, ensuring it doesn’t activate in the afternoon or evening. If I don’t return home within 20 minutes, the machine is automatically turned off to save energy. ๐๐ก
Here’s a step-by-step breakdown of the automation:
- Trigger: The automation is triggered when my device leaves the school zone. ๐ฑ
- Condition: It checks if the current time is between 08:15 and 08:40. โฐ
- Action: The espresso machine, connected to a smart switch, is turned on. โ๐
- Delay: A 20-minute delay is set. โณ
- Condition: After the delay, it checks if I’m home. If not, the machine is turned off. ๐ โ
Automation Code (YAML)
alias: Turn on espresso when kids are at school
description: "Turn on espresso when kids are at school. When leaving school zone after kids drop off, turn on espresso. If not home in 20 minutes, turn off the espresso machine"
triggers:
- trigger: zone
entity_id: device_tracker.peter
zone: zone.school
event: leave
conditions:
- condition: time
after: "08:15:00"
before: "08:40:00"
actions:
- action: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.espresso_machine
- delay:
hours: 0
minutes: 20
seconds: 0
- if:
- condition: not
conditions:
- condition: zone
entity_id: device_tracker.peter
zone: zone.home
then:
- action: switch.turn_off
metadata: {}
data: {}
target:
entity_id: switch.espresso_machine
mode: single
Conclusion
With this simple automation, you can ensure that your espresso machine is ready to brew your favorite coffee just when you need it. No more waiting for the machine to heat up or worrying about leaving it on all day. Just imagine the joy of walking into your home, knowing that your espresso machine is prepped and ready for you to start brewing. After all, the process of making a perfect cup of coffee is part of the fun, especially if you’re a coffee enthusiast. Now, if only it could make the coffee for you too! ๐โโจ