How to set lights to maximum brightness with RGBW from blueprint

I have the following script to cycle the colours of a light on the push of a button:

alias: Cycle Colours
sequence:
  - action: script.inc_bedroom_light
    data: {}
  - target:
      device_id: edebb52659ae648e248d8ec7bde63252
    data:
      transition: 1
      rgbww_color: >
        {% set foo = (  '[255,255,255,255,255]', '[150,150,50,128,128]', '[255,0,0,0,0]',
        '[255,50,252,50,50]' ) %} {{
        foo[states("input_number.bedroomlightsettings") | round(0) ]  }}
    action: light.turn_on

This does not give max brightness for [255,255,255,255,255] and is only slightly brighter than the next value. How do I get max brightness?

The builb is a ZB-CL01 by eWeLight. I think it’s RGBWW but I have tried RGBW and it’s the same.

Please let me know what I am doing wrong. Thank you.

How do you know you’re not getting the max brightness? What values are the light reporting back? Can you set a higher brightness elsewhere, i.e. manufacturers own app? If so, what values does the light report back to HASS at that time?

Thanks for the response. I can make it brighter using the built-in light control from Home Assistant (bulb with the arc slider round it).

How can I tell what it’s reporting back? The light icon and slider don’t tell me much.

Thanks.

That’s a useful page which I did not know about so thanks.

I can see that when I set the light from the control panel and it’s bright, the light reports, among other things:
color_mode: color_temp
color_temp_kelvin: 6535
color_temp: 153

When I am setting it through the script, it’s this:
color_mode: xy
color_temp_kelvin: null
color_temp: null

I think I need to send the light color_mode and/or color_temp_kelvin. I do not yet know how to do that with the above script while also allowing for the RGB values for the other settings, but I will try to figure it out.

Thank you.

You don’t set the color mode, it gets set automatically depending on what parameters you send through the light.turn_on action. The parameter you should send is color_temp_kelvin, the other color_temp is the same just in a different unit (mireds instead of Kelvin) but is deprecated and should no longer be used (will throw a warning in the logs and eventually stop working altogether).

According to the documentation there is a parameter white that can be used with RGBW and RGBWW lights but it is kind of cryptic. Could never quite understand what it does, and have no such lights to test with.

1 Like

Thanks Mayhem. I have got it working with the following code:

alias: Cycle Colours
sequence:
  - action: script.inc_bedroom_light
    data: {}
  - if:
      - condition: numeric_state
        entity_id: input_number.bedroomlightsettings
        below: 1
    then:
      - target:
          device_id: edebb52659ae648e248d8ec7bde63252
        action: light.turn_on
        data:
          transition: 1
          color_temp_kelvin: 6535
    else:
      - target:
          device_id: edebb52659ae648e248d8ec7bde63252
        action: light.turn_on
        data:
          transition: 1
          rgbww_color: >
            {% set foo = (  '[255,255,255,255,255]', '[150,150,50,128,128]',
            '[255,0,0,0,0]', '[255,50,252,50,50]' ) %} {{
            foo[states("input_number.bedroomlightsettings") | round(0) ]  }}
1 Like