Controlling Color of Philips Hue Lights

I’ve searched the forums and rather surprisingly haven’t found an answer to this. I know I can get the attributes of the light:

brightness: 51
color_temp: 366
min_mireds: 154
max_mireds: 500
xy_color: 0.4575,0.4101
effect_list: colorloop,random
rgb_color: 144,116,64
friendly_name: Front Door
supported_features: 127
custom_ui_state_card: state-card-custom-ui
state_card_mode: break-slider
stretch_slider: true
hide_control: false
theme: happy
slider_theme: {
  "min": 10,
  "max": 100,
  "pin": true,
  "off_when_min": false,
  "report_when_not_changed": false
}

So I can set the color by using the rgb_color or xy_color but I haven’t found a good UI to do this. Am I missing some built-in component that does this? I’m really surprised that since there is a dedicated component that there isn’t instructions on how to control the light color in a UI.

1 Like

OK, figures as soon as I posted something I would find a partial answer myself. So if the light is OFF and you click on the light name the color control does not show as an option. Perhaps there’s a setting to override that so you can experiment or set colors even if the light is currently off?

So if the light is ON I can see the color controls when I click on the light name. How can I “dock” those so they can be accessed directly without having the click on the light and get the pop up?

As far as I know you can’t ‘dock’ them because as you said they are pop-ups :wink:

@GeorgeIoak did you manage to find a solution ?
I’m looking for a similar feature for the UI in my configuration.
It has been suggested that the ‘input select’ feature might be the way to go.

link :

I did get something working but I can’t seem to find the reference to how I got it. Looking at my configurations I now have:

in Input_select.yaml

front_light_color:
  name: Change Colors of Lights
  options:
    - "Normal"
    - "Red"
    - "Orange"
    - "Yellow"
    - "Green"
    - "Blue"
    - "Indigo"
    - "Violet"
    - "Purple"
  icon: mdi:lightbulb
  initial: Normal

and then in groups.yaml I have:

Outside:
  view: yes
  entities:
    - group.front_yard
    - group.choose_front_lights_color
    - sun.sun

choose_front_lights_color:
  name: Pick Front Lights Color
  control: hidden
  entities:
    - input_select.front_light_color

and finally in front_lights.yaml (which is an automation) I have:

- alias: Set Front Lights Color
  trigger:
    platform: state
    entity_id: input_select.front_light_color
  condition:
    condition: template
    value_template: "{{ states('input_select.front_light_color') != 'Normal' }}"
  action:
    service: light.turn_on
    data_template:
      entity_id: group.front_yard_lights
      color_name: "{{ states.input_select.front_light_color.state }}"

- alias: Set Garage Bulb Color to Normal
  trigger:
    platform: state
    entity_id: input_select.front_light_color
  condition:
    condition: template
    value_template: "{{ is_state('input_select.front_light_color', 'Normal') }}"
  action:
    - service: light.turn_on
      data:
        entity_id: group.front_yard_lights
        color_temp: 245
        brightness: 64
#    - service: light.turn_on
#      data:
#        entity_id: light.front_porch_light
#        brightness: 64

If you search the forums you should be able to find the original author of this

1 Like

Probably mine…

link removed

:stuck_out_tongue_winking_eye:

Yes, @anon43302295 is the source of this so many thanks to his work

1 Like

@anon43302295 Where did your config go? :confused:

It’s been split up a bit since then - which bit are you looking for specifically?

IM just looking for a way to get my scenes and effects from Hue to my home Assistant in an easy way.
I just read the preview of your code and saw effect lite inputs.

OK, if you have a look at this file…

link removed

You want the input_select near the top, the automation about halfway down called “Lighting - Trigger scene (Bedroom)” and the script.

Then you just need to put the exact names of your scenes in the input_select and put that input_select on your interface somewhere :slight_smile:

Does anyone have a new link to this?