Hello,
I’m trying go to make a scene where each light will use one of four RGB color arrays. I have tried various combinations of double quotes, single quotes, curly braces and such but I can’t see to get the syntax right. The code validates, but when I try to activate the scene, I get this error:
Failed to call service scene/turn_on. None for dictionary value @ data[‘rgb_color’]
Here’s my code:
- id: 'scene_Sunrise_Random'
name: 'Sunrise Random'
entities:
light.kitchen_1:
state: 'on'
brightness: 123
rgb_color: >
"{{ [ [255,144,44], [255,0,60], [255, 138, 0], [250, 190,40] ] | random }}"
light.kitchen_2:
state: 'on'
brightness: 123
rgb_color: >
"{{ [ [255,144,44], [255,0,60], [255, 138, 0], [250, 190,40] ] | random }}"
light.kitchen_3:
state: 'on'
brightness: 123
rgb_color: >
"{{ [ [255,144,44], [255,0,60], [255, 138, 0], [250, 190,40] ] | random }}"
light.kitchen_4:
state: 'on'
brightness: 123
rgb_color: >
"{{ [ [255,144,44], [255,0,60], [255, 138, 0], [250, 190,40] ] | random }}"
light.kitchen_5:
state: 'on'
brightness: 123
rgb_color: >
"{{ [ [255,144,44], [255,0,60], [255, 138, 0], [250, 190,40] ] | random }}"
light.kitchen_6:
state: 'on'
brightness: 123
rgb_color: >
"{{ [ [255,144,44], [255,0,60], [255, 138, 0], [250, 190,40] ] | random }}"
light.livingroom_lamp:
state: 'on'
brightness: 123
rgb_color: >
"{{ [ [255,144,44], [255,0,60], [255, 138, 0], [250, 190,40] ] | random }}"
Update: I have now also tried round brackets with both double and single quotes for the RGB combos (same error):
rgb_color: >
'{{ [ (255,144,44), (255,0,60), (255, 138, 0), (250, 190,40) ] | random }}'
rgb_color: >
"{{ [ (255,144,44), (255,0,60), (255, 138, 0), (250, 190,40) ] | random }}"
…and this:
rgb_color: >
{% set combos = [ (255,144,44), (255,0,60), (255, 138, 0), (250, 190,40) ] %}
"{{ combos|random }}"
Suggestions welcome, thanks!