Automatically turn ON lights coming back home
Emiliano Guerzoni
Project Manager / Technical Manager renewables/energy efficiency projects | Demand Manager digital energy domain at algoWatt
Welcome to another exciting tutorial of my?Tips & Tricks?newsletter on?Home Assistant.
As a home automation enthusiast, I'm always on the lookout for new ways to make my life easier as well as smarter and I'm excited to share my latest ideas with you.
So, if you're ready to take your home automation game to the next level, read on and don't forget to let me know your thoughts in the comments.
Your feedback will help me ensure that I'm providing the right content for you.
Thanks for being a valued reader! ??
In this previous article I've introduced how to get the lighting in your home a step ahead combining Home Assistant with Zigbee LED bulbs.
Today I wish to start introducing a super useful automation so that your lights at home can get automatically turned ON as soon as you come back home.
Let's dive into this!
Hardware configuration
Software configuration
领英推荐
Procedure
First of all you have to create a family group composed of all the person entities you want to track as a whole (family) entity.
To do that I've the groups.yaml file in which I've added the following lines of code:
family:
? entities:
? ? - person.A
? ? - person.B
- .....
? ? - person.N
The state of the group.familiy entity is:
The second step is to create the following super easy automation:
alias: Lights - Turn ON sofa light if whole family comes back home and sun has set since 30 minutes
description: Lights - Turn ON sofa light if whole family comes back home and sun has set since 30 minutes
trigger:
? - platform: state
? ? entity_id:
? ? ? - group.family
? ? to: home
condition:
? - condition: sun
? ? after: sunset
? ? after_offset: "+00:30"
action:
? - service: light.turn_on
? ? data:
? ? ? kelvin: 4000
? ? target:
? ? ? entity_id: light.ikea_of_sweden_tradfribulbe14wsglobeopal470lm_light
mode: single
Some specifics about the code above
I do hope this new article has been helpful, I encourage you to?subscribe?to my newsletter about?Home Assistant?so that you will be the first to know about my new tutorials!
Thanks for reading and stay powered up!