Any way to update light (philips hue) state without turning it on?

I would like to be able to use the flux switch to fade the color temperature of lights (hue in this case) even if they are ‘off’ (brightness 0) so that the color temperature is set when I turn them on. I haven’t used other smart lights so I don’t really know if this type of behavior (being able to update the state even if the light is ‘off’) is unusual.

I figured this would be a simple code change but as I did some digging it seems to me that there is no way to update a light’s state without also turning it on. Just wanted to see if I was missing something or this was intended behavior.

Thanks!

The Hue bridge currently does not allow any changes to a bulb’s state when it is ‘off’ (well, besides switching it on).

Sebastian

Wow, that’s embarrassing… not sure why I thought that hue states could be updated even if the light is off…

So I guess what I’m really looking for is a way to have a light get the current flux state (color temperature, brightness, etc) as it’s turned on.

I’ve never used flux before (I actually just learnt about it), but can’t you just have an automation call switch.flux_update that triggers when a light is turned on?
There might be a slight delay due to HA having to poll the hue bridge every few seconds to update the state.

Sebastian

did you ever find out a way to do this?

I’m trying to set my hue ambiance to be ‘warm’ if turned on between 6pm and 8am, and ‘white’ all other times.

seems you need to power them on - my only thought would be to add the lights as triggers, and time as conditions - but so far the lights come up as previous, then change state (seems pretty lame on Hue’s part :frowning: )

You can use the HA rest API to set states directly

Are you able to descibe how, or do you have a link for some guide to do this? I would love to be able to set the parametres without having to turn on the bulps

You can update the state of a sensor using a POST with the restful command.
Alternatively you could use a python_script, which I do here using:

hass.states.set(entity_id, data)
1 Like

Nice - wasn’t aware that was an option.

Thanks :smiley:

1 Like

I believe that flux won’t help you in this case (please correct me if I’m wrong), that’s why I built my own sensor which dynamically adapts to natural sun light kelvin/mired. Have a look here:

Quoting the Flux component’s documentation page:

The component will update your lights based on the time of day. It will only affect lights that are turned on and listed in the flux configuration.

And I can confirm, that this is the current behaviour with 0.64.3 . At most 30sec after lights turn on, the color and brightness is set. You can even shorten this delay by reducing the ‘interval’ timeout.

1 Like

Check this out it should do the trick.

Accomplishing this type of behavior is pretty easy for any customizable service call (automation, python_script, etc) by sending color/brightness in the service call or using profile as suggested.

What I haven’t found a solution for is if you turn a light on from the frontend - is there a way to set the frontend to always use a profile when turning a light on?

I set a default effect using this, may help

automation hdmi effect:
  alias: HDMI - Hyperion
  hide_entity: True
  trigger:
    platform: state
    entity_id: light.tv_lights
    to: 'on'
  action:
    - service: light.turn_on
      data:
        entity_id: light.tv_lights
        effect: HDMI

So when I turn these lights on, they automatically select the hdmi effect (hyperion). Just add some time conditions…

The problem with that type of approach is that the lights come on at their previous state and then adjust. It’s quick, and for something like your example it probably doesn’t matter. For something like circadian lighting, however, the whole point is that you have warmer dimmer lights in the morning and evening and brighter, whiter light during the day. If you turn on a light in the evening, the momentary bright white light can be disturbing. A much better solution would be to pass the color into the light during the initial ON call, which completely eliminates the momentary adjustment and overall is a much more pleasant experience.

1 Like

Did you get this working ?
I have posted asking if you can template the colour that the lights tune on, but think i solved it myself with a no, as it was a string or not a string that was being passed.
Was gonna look at rednode to turn lights on at the right colour