rm3379
1
Hi
I don’t succeed to get my script working. I don’t get any error message but nothing happen when I execute the script (no brightness change…)
'1581069600295':
alias: Dim up
sequence:
- entity_id: light.0xec1bbdfffeacdcba_light
service: light.turn_on
- data_template:
brightness: >
{states.light.0xec1bbdfffeacdcba_light.attributes.brightness + 100}
I don’t know where I’m wrong… Any idea ?
Tinkerer
(aka DubhAd on GitHub)
2
Simple, you’ve got two “actions” there
- entity_id: light.0xec1bbdfffeacdcba_light
service: light.turn_on
and then
- data_template:
brightness: >
{states.light.0xec1bbdfffeacdcba_light.attributes.brightness + 100}
Oh, and that template isn’t valid anyway, since you’re only using {
and not {{
. Try this
- service: light.turn_on
data_template:
entity_id: light.0xec1bbdfffeacdcba_light
brightness: >
{{ states_attr('light.0xec1bbdfffeacdcba_light','brightness') + 100}}
1 Like
rm3379
3
Thanks
Indeed, I had a lot of errors here
However, it still doesnt works nothing happen even after restarting HA
I’ve got this message into the log :
“Error rendering data template: UndefinedError: ‘states_attr’ is undefined”
EDIT: the problem was “states_attr”, it must be “state_attr” instead
Thanks