Helper template number use set value in action

I set up a helper template number to check my led’s white channel.
the state is {{ state_attr(“light.shellyplusrgbwpm_kitchenbottomright”, “rgbw_color”)[3] }} which works fine.

I tried adding an action to change the led’s value

action: light.turn_on
metadata: {}
data:
  rgbw_color:
    - 0
    - 0
    - 0
    - "{{ states('number.kitchenbottomrightwhite') | int }}"
target:
  entity_id: light.shellyplusrgbwpm_kitchenbottomright

This does not change my led because the state of my helper is not updated with the value set.
How can I use the value set in the helper, instead of the state which is always representing my current led white value?

Try This:

action: light.turn_on
metadata: {}
data:
  rgbw_color: >
    {{ [0,0,0,states('number.kitchenbottomrightwhite') | int] }}
target:
  entity_id: light.shellyplusrgbwpm_kitchenbottomright

Thanks for the fast reply, unfortunately the result is the same.

states('number.kitchenbottomrightwhite') | int always represents the value of my state {{ state_attr(“light.shellyplusrgbwpm_kitchenbottomright”, “rgbw_color”)[3] }}

It seems not to take the users input for the numeric helper.
The input is recognized, for testing purpose I just toggle some other light to see if the input is triggered.

Are you expecting your light to change when the number changes?

It will only change when the action is run.

What is the trigger for this automation?

It is not an automation it is a Helper.

I used Create Helper → Template → Template a number
For State template* I use {{ state_attr(“light.shellyplusrgbwpm_kitchenbottomright”, “rgbw_color”)[3] }} to extract the white value from my led

Then I added an action →

action: light.turn_on
metadata: {}
data:
  rgbw_color: >
    {{ [0,0,0,states('number.kitchenbottomrightwhite') | int] }}
target:
  entity_id: light.shellyplusrgbwpm_kitchenbottomright

Whenever I change the value of the helper the action is triggered, but the value of the helper is whatever is used in State template*

Is there any way to get the numeric value I set the Helper to?
Like this.value or something similar?

1 Like

It’s just value.

From Home Assistant - Integrations - Template - Number

action: light.turn_on
metadata: {}
data:
  rgbw_color: >
    {{ [0,0,0,value] }}
target:
  entity_id: light.shellyplusrgbwpm_kitchenbottomright

You may need to use a tuple instead of a list for the rgbw value… I don’t have any, so I can’t test it. If the above doesn’t work use parentheses instead of square brackets i.e. (0,0,0,value)

That works fine, thank you.
What confused me was that the Run action always says value is undefined.
And the slider on the bottom does not work.

If saved and tested everything works.

Edit:
I have the parentheses around the value variable.

action: light.turn_on
metadata: {}
data:
  rgbw_color: |
    [0, 0, 0, {{ value }} ]
target:
  entity_id: light.shellyplusrgbwpm_kitchenbottomright

Apologies for misunderstanding.

No worries, I should have given a better explanation.

1 Like

Nah, my fault. I have not used that helper for a long time and forgot it had an action option.