Need guidance regarding my lighting automation goals

Hello,

I just installed HA and am currently learning the interface and how to do the automations my goal is to have. I have a few questions regarding how to achieve my goal and will therefore describe my goal below and then add the questions at the end to give you guys the whole picture.

Daily flow:
My goal is to have certain lights slowly turn on when I disable the sleep focus mode on my iPhone provided that I’m home and it’s dark out. I then want all lights except the window lights to turn off when I leave or at sunrise depending on which comes first. I want the window lights to stay on if I leave and turn off only an hour past sunrise.

I then want the window lights to turn on again an hour before sunset. All the other lights except for the bedside lights I want to be turned on at sunset if I’m home and when I get home otherwise.

I then want the lights to turn off again when I activate the sleep focus mode.

TV usage
On top of this daily flow I want the TV to be a part of it as well. I have an LG C2 which I’ve integrated to HA. If possible I want to turn most of the lights off when I play something except Spotify on the TV, otherwise whenever the TV is turned on. I then want to turn the lights back on again when the TV is paused or turned off depending on what’s possible provided that the daily flow says that the lights should be on.

Additional information
I don’t know if this matters at all in this case but I’ll add it in case it is. I’m running HA through Proxmox on a Beelink Mini S12 Pro. All my lights are from IKEA and they’ve been integrated as HomeKit Devices using the Dirigera Hub. I’ve also added HomeKit Bridge in order to sync things with the Home app on my iPhone. I’ve also installed the HA app and set the location to always allow. Everything is connected to a Ubiquiti UCG Ultra which also has been integrated. And the TV in question is an LG C2 which has been integrated using the default LG WebOS option.

My questions
How would you guys go about creating an advanced flow like this? Would you use a small amount of advanced automations or a bunch of small ones? How would you make sure that the automations work together rather than against each other?

Is there a blueprint or guide on how to achieve something like this? Are there any articles, videos, previous topics or anything else I can use to read up on the best practices in terms of advanced automations like this?

Even though a step-by-step guide would be awesome I’m fully aware that that most likely won’t happen here but all tips, tricks, recommendations, links and more are greatly appreciated!

Do not feel you have to add all these separate triggers/conditions and actions in the one automation just because they control the same things. Separate automations are often much simpler.

First step is to identify your automations and their triggers, conditions and actions. It helps if you can split them into specific tasks e.g. This would be one automation:

Your automation trigger:

Your automation conditions:

your automation actions:

This is another automation, see if you can identify the triggers, conditions and actions:

Another automation:

Another automationn:

Another:

etc…

1 Like

Thanks for the input! That definitely sounds like the easier way to go in the sense of readability and for debugging reasons.

I’m guessing I have to add the TV as a condition to all automations that turn lights on then in order to skip if the TV is playing? Would you add the “TV is turned off” trigger to the turn the lights on automation or would you have a separate automation for that with conditions for sunset etc?

Separate automation for the TV.

You may need to add another condition to your lighting automations to not change the lights if the TV is on.

1 Like

Thanks for the help!

I’m currently trying to set this up but there’s one more thing I’m a bit unsure of. In HK I had scenes where some lights were on and others off. Different lights also had different brightness levels. One example of this is the TV “scene” where all the lights were off except for the window lights that were on at a 30% brightness. I also had a “home at night” scene that had the bedside lights off, ceiling lights at 30% and window lights at 50%.

What’s the best way to create this in HA? Should I use a script that turns on the window lights at 50%, then turns on the ceiling lights at 50% and then turns off the bedside lights or is there a better solution where I can individually set all the lights at once?

Also, what’s the best/easiest way to fade in multiple lights at the same time? They are Ikea Tråfri lights if that matters

There are scenes in HA too. You specify the entity and the state you want.

However I prefer using scripts as these give you a lot more flexibility. You can use any action rather than just specifying an entity & state.

1 Like