Automatically turn ON lights coming back home

Automatically turn ON lights coming back home

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:

  • not_home: if all the members are outside home
  • home: if just one member is at home

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

  1. The trigger section is based on the group.family entity described above
  2. The condition checks if the sun has set since 30 minutes
  3. The action is in charge to call the service light.turn_on for the entity you want to turn ON passing the color's temperature to have the right environment you want

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!

要查看或添加评论,请登录

社区洞察

其他会员也浏览了