Light.set_color option or similar feature

Hello,
say I want to change the color of a hue light for a period of time, I’d use something like this:

  - data:
      brightness_pct: 40
      color_temp: 500
      entity_id: light.buro_decke_mitte
      transition: 2
    entity_id: light.buro_decke_mitte
    service: light.turn_on
  - delay: 00:45
  - data:
      brightness_pct: 40
      color_temp: 100
      entity_id: light.buro_decke_mitte
      transition: 2
    entity_id: light.buro_decke_mitte
    service: light.turn_on

Now if someone has turned the light off in the meantime, this action will always turn it on again. I was wondering if there is a possibility to change just the color (or any parameter of the light) without using the light.turn_on call.
Like a light.set_color or light.set_option call or something along those lines.

Thanks and best regards
Halest

The Lifx light has a set state service that does not require the light to be turned on. Hue does not appear to have this service though.

You can save a scene on the fly and restore it but that would have the same problem of returning to the initial ‘on’ state.

The only way I can think to do it would be to include a condition in your actions:

  - data:
      brightness_pct: 40
      color_temp: 500
      entity_id: light.buro_decke_mitte
      transition: 2
    entity_id: light.buro_decke_mitte
    service: light.turn_on
  - delay: 00:45
  - condition: state
    entity_id: light.buro_decke_mitte
    state: 'on'
  - data:
      brightness_pct: 40
      color_temp: 100
      entity_id: light.buro_decke_mitte
      transition: 2
    entity_id: light.buro_decke_mitte
    service: light.turn_on

Note that if you have other actions below this they won’t execute either if the light is off. You can usually get around this by making the condition just before the last service call in the actions.

1 Like

Hello,
thank you very much, using a condition would actually solve that specific problem, though it would be nice to get a pure set_state call, as Lifx has. Who would be adding such an option? Is that something from the integration/plugin team or would that be something hue has to make possible first?

Again, thanks, I will definitely use this in several places and have a good day
Halest

It might be a limitation of the Hue API (application programming interface), i.e. what functions are actually available from the Hue hardware. I don’t know.

The area to ask for feature requests is here:

https://community.home-assistant.io/c/feature-requests

1 Like

Thanks, I’ll add a feature request!