I am trying to convert the following working automation to a blueprint and cannot get it to work.
This automation is for a specific hardcoded light which will loop through a list of named colors:
input_select:
light_color:
options:
- Red
- Blue
- Green
automation:
- alias: 'Color Loop Test'
initial_state: 'on'
trigger:
platform: event
event_type: deconz_event
event_data:
id: light.my_hardcoded_light_name
state: 'on'
action:
- repeat:
while:
- condition: state
entity_id: light.my_hardcoded_light_name
state: 'on'
sequence:
- service: light.turn_on
data:
entity_id: light.my_hardcoded_light_name
color_name: "{{ states('input_select.light_color') }}"
transition: 5
- service: input_select.select_next
entity_id: input_select.light_color
- delay: 5
I want to convert this to a blueprint so that I can easily create the same automation for certain light(s) but adjust things like the list of colors and transition time.
But just getting the basics to work is not going well, so far I have:
blueprint:
name: Color Loop Test Blueprint
description: ''
domain: automation
input:
my_light:
name: Color Loop Light
description: Choose Light entity to Color Loop
selector:
target:
entity:
domain: light
light_colors:
name: Available Colors
description: Refer to https://htmlcolorcodes.com/color-names/ for valid colors.
selector:
select:
multiple: true
custom_value: true
options:
- Red
- Green
- Blue
trigger:
platform: state
entity_id: !input my_light
action:
- repeat:
while:
- condition: state
target: !input my_light
state: 'on'
sequence:
- service: light.turn_on
target: !input my_light
data:
color_name: "{{ states('light_colors') }}"
transition: 5
- service: input_select.select_next
target: !input 'light_colors'
- delay: 5
And when I try to save a new automation using the blueprint, I get the following in the log:
Blueprint Color Loop Test Blueprint generated invalid automation with inputs OrderedDict([('my_light', OrderedDict([('device_id', 'b4472458334d11ebb01ecd4ebbfb63a4')])), ('light_colors', ['Red', 'Green', 'Blue'])]): expected a dictionary for dictionary value @ data['action'][0]['repeat']['sequence'][1]['target']. Got None extra keys not allowed @ data['action'][0]['repeat']['while'][0]['target']. Got None required key not provided @ data['action'][0]['repeat']['while'][0]['entity_id']. Got None
Can anyone help with with how to properly populate the chosen light (and color list) into the action?