Hi,
I’m trying to create a script based off of a blueprint, but my changes won’t save - the validation of the script sequence failes with this message:
Message malformed: template value should be a string for dictionary value @ data['sequence'][0]['repeat']['sequence'][0]['choose'][0]['sequence'][0]['data']
I have tried all kinds of different things, but I have no idea how to resolve this issue. I really hope someone with sharp eyes can spot my (probably very simple) error!
Here’s my current config:
alias: Sunrise
fields:
light_entity:
description: Entity to use for sunlight effect
sunrise_duration:
description: How long the sunrise should take, in minutes
default: 30
start_brightness:
description: Start light brightness
default: 2
end_brightness:
description: End light brightness
default: 254
variables:
seconds: "{{float(sunrise_duration) * 60}}"
runtime: 0
tick_time: "{{float(seconds) / float(range_brightness)}}"
range_brightness: "{{float(end_brightness)-float(start_brightness)}}"
start_mired: "{{state_attr(light_entity, 'max_mireds')}}"
end_mired: "{{[state_attr(light_entity, 'min_mireds')|int(0), min_mired|int(0)]|max}}"
sequence:
- repeat:
until: "{{ state_attr(light_entity, 'brightness') >= end_brightness }}"
sequence:
- delay: "{{tick_time}}"
- choose:
- alias: "Supports minreds"
conditions: "{{state_attr(light_entity, 'min_mireds') != None}}"
sequence:
- service: light.turn_on
# I expect the error to be somewhere around here, according to the error
data:
brightness: >
{{(float(end_brightness) - (float(range_brightness) * (seconds - runtime) / float(seconds))) | int(0)}}
color_temp: >
{{(float(end_mired) + (float(start_mired) - float(end_mired)) * (seconds - runtime) / float(seconds))) | int(0)}}
target:
entity_id: "{{ light_entity }}"
default:
- service: light.turn_on
data:
brightness: >
{{(float(end_brightness) - (float(range_brightness) * (seconds - runtime) / float(seconds))) | int(0)}}
target:
entity_id: "{{ light_entity }}"
- variables:
runtime: "{{ float(runtime) + tick_time }}"
mode: single