How do I create Buttons with time based automation?

Hello, I’m trying to setup a couple of buttons that will automatically set the colour and brightness of a light based around the time of day/night.

I want an automation that will trigger at the start of the time ranges in the Automation Script block sending the settings to a Dummy Light. When Button 1 is pressed the settings in Dummy Light are sent to the Wiz Light.

My thoughts around using a Dummy Light is to minimise lag or any transition delays from either running scripts to figure out current time and what settings to use.

Button 2 should be easy enough it’s just a standard button I think I can manage that.

I think detecting if the light was turned on with its remote might be tricky unless there is a way to either log or set another variable to say that the light was turned on by one of the buttons and if not it was via the remote.

Does anyone know how I can do this, I’ve tried looking at the documentation but I’m having trouble wrapping my head around it.

Just write it normally.

Use a scene to store your lighting settings.

This whole store something in a light is just over complicating a problem that doesn’t really exist. HA can handle more calculations a second than you can and caching settings in a light is just more work. It’s more likely any ‘lag’ will come from network comms to the lights themselves… Not your computation. Spend your time optimizing that time instead.

Once you make that change it becomes relatively simple - at time pop scene x, unless it was a manual trigger. (that’s the hardest part but - Tom has posted replies that tell how to differentiate from a manual or HA triggered lamp a few times in the last month. I’m not where I can search atm but they should be easy to locate with a quick search.

2 Likes

Scenes where the ingredient I was missing, thank you!