[SOLVED] Unable to get script working

Hi :slight_smile:

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 ? :thinking:

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

Thanks :slight_smile:

Indeed, I had a lot of errors here :smiley:

However, it still doesnt works :frowning: 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 :wink:

Thanks