How can I change color temperature over time?

I have a Hue Ambiance bulb at my desk and I’d like to configure it so that it’s cool in the morning when I wake up, and gradually get warmer as the day goes on so I hopefully don’t stay up too late.

Has someone written an automation or script for this, or have an idea of how it would go together?

take a look at the link below.

2 Likes

Thanks! I have put that in my config. Will see how it works.

My concern is that the example config shows color temperatures in degrees Kelvin, whereas in the dev-state page, the color_temp value is a 3-digit number like 159. What’s that all about?

Got it. Can Flux be used to control Hue lights?

Hue uses color temperature units called Mireds (instead of Kelvin) So you have to change the Mode variable from ‘xy’ (whatever that is) to ‘mired’ like so.

switch:
  - platform: flux
    lights:
    - light.studio1
    name: Flux
    start_time: '7:00'
    stop_time: '23:00'
    start_colortemp: 4000
    sunset_colortemp: 3000
    stop_colortemp: 1900
    brightness: 200
    mode: mired
2 Likes

And btw, this is the first thing I’m having HA do automatically rather than by remote control and it is very cool.

1 Like

Glad you got it working. You will be amazed at everything HA can do if you learn to use the data it collects to act on the devices you have.