#Hi Guys I have an automation im

1 messages · Page 1 of 1 (latest)

sweet pond
#

This is the template (its repeated atleast 20 times in the automation with variations)

stone shoal
#

@sweet pond You can't use !input inside a Jinja template. First declare a variables: in your action block, pass the !input to the variable, then reference that variable in your template.

austere valley
#

@stone shoal That is true, but I don't believe I see any !inputs in his templates....

austere valley
#

A BP is basically an automation with presettable variables.

#

(Unless it's a script BP, then it's a script.)

stone shoal
austere valley
#

I looked at the BP, not there. He just has the syntax wrong.

austere valley
#
value: {{ states('number.ohmega_charging_amps') | int(0) ) + 1 }}

Try that...
Don't forget to add some default value for int, float, etc...
@sweet pond

sweet pond
#

Thanks guys.

#

My problem however is that I need the variable to always reflect the "number.ohmega_charging_amps" does the variable get updated whenever the entity is updated ? Or will I have to update the variable myself ? Do you know I can update it to call the input variable again ?

sweet pond
sweet pond
#

guys, you rock. I got the variable working.

#

I just define the variable right after the repeat function. That way, when one cycles ends after reading the intity into variable, the variable is updated in the beginning of the next cycle. Perfect 🙂 Thank you so much.