Also, if the previous âGOOD COLORSâ script did not work for you, it may also be possible that some of the named colors are not supported by your bulb?
If you manually add an unsupported color (eg Qwerty
) it ends up being white because it doesnât know what to do with it. I doubt is this your issue as I assume that HA converts the named colors to RGB/HSL/XY before sending the command (your logs seem to back this up).
I made a quick alteration of my script to use the XY colors of your script. This should end up working the same as your old automation with the only difference being how it does the looping.
Blueprint (homeassistant/blueprints/mdolnik/color_loop_xy.yaml
):
blueprint:
name: Color Loop XY
description: 'TESTING XY COLORS'
domain: script
input:
light:
name: Light
selector:
entity:
domain: light
multiple: false
light_colors:
name: Colors
selector:
select:
multiple: true
custom_value: true
options:
- '[ 0.217,0.077 ]'
- '[ 0.157,0.05 ]'
- '[ 0.136,0.04 ]'
- '[ 0.137,0.065 ]'
- '[ 0.141,0.137 ]'
- '[ 0.146,0.238 ]'
- '[ 0.151,0.343 ]'
- '[ 0.157,0.457 ]'
- '[ 0.164,0.591 ]'
- '[ 0.17,0.703 ]'
- '[ 0.172,0.747 ]'
- '[ 0.199,0.724 ]'
- '[ 0.269,0.665 ]'
- '[ 0.36,0.588 ]'
- '[ 0.444,0.517 ]'
- '[ 0.527,0.447 ]'
- '[ 0.612,0.374 ]'
- '[ 0.677,0.319 ]'
- '[ 0.701,0.299 ]'
- '[ 0.667,0.284 ]'
- '[ 0.581,0.245 ]'
- '[ 0.477,0.196 ]'
- '[ 0.385,0.155 ]'
- '[ 0.301,0.116 ]'
- '[ 0.217,0.077 ]'
transition:
name: Transition Time
selector:
duration: {}
default:
hours: 0
minutes: 0
seconds: 1
sequence:
- alias: Set up variables
variables:
light_colors: !input 'light_colors'
color_count: '{{ light_colors|length }}'
transition: !input 'transition'
transition_seconds: '{{ ((transition.hours)*60*60) + ((transition.minutes)*60)
+ transition.seconds }}'
- alias: LOOP!
repeat:
while:
- condition: state
entity_id: !input 'light'
state: 'on'
sequence:
- variables:
i_total: '{{ repeat.index }}'
i_cur: '{{ i_total % color_count }}'
- service: light.turn_on
target:
entity_id: !input 'light'
data:
xy_color: '{{ light_colors[i_cur] }}'
transition: '{{ transition_seconds }}'
- delay: '{{ transition_seconds }}'
Script:
color_loop_xy_test:
alias: Color Loop Lightstrip XY
use_blueprint:
path: mdolnik/color_loop_xy.yaml
input:
light: light.color_lamp_tall_entry_way
light_colors:
- '[ 0.217,0.077 ]'
- '[ 0.157,0.05 ]'
- '[ 0.136,0.04 ]'
- '[ 0.137,0.065 ]'
- '[ 0.141,0.137 ]'
- '[ 0.146,0.238 ]'
- '[ 0.151,0.343 ]'
- '[ 0.157,0.457 ]'
- '[ 0.164,0.591 ]'
- '[ 0.17,0.703 ]'
- '[ 0.172,0.747 ]'
- '[ 0.199,0.724 ]'
- '[ 0.269,0.665 ]'
- '[ 0.36,0.588 ]'
- '[ 0.444,0.517 ]'
- '[ 0.527,0.447 ]'
- '[ 0.612,0.374 ]'
- '[ 0.677,0.319 ]'
- '[ 0.701,0.299 ]'
- '[ 0.667,0.284 ]'
- '[ 0.581,0.245 ]'
- '[ 0.477,0.196 ]'
- '[ 0.385,0.155 ]'
- '[ 0.301,0.116 ]'
- '[ 0.217,0.077 ]'
transition:
hours: 0
minutes: 0
seconds: 1
mode: single
Maybe see if this works for you.
That-said if using XY works for you and the âgoodâ color order does not work then that is a bummer.
That would mean the color loop would have to have a different means of setting the color on a per-light basis