#Templating problem
1 messages ยท Page 1 of 1 (latest)
Problens are here:
value_template: "{{('states.'~weightsensor~'.state' | float(0) - input_number.weightdiff
| float(0)) < ('states.'~okoksensor~'.state' | float(0)) < ('states.'~weightsensor~'.state')
| float(0) + input_number.weightdiff | float(0)) }}"
Among then where did those tilde's come from?
float - float < float < float + float is a heck of a mess as well.
I'd be tempted to create variables out of the code creating the floats, then the actual value template would be readable.
Bottom line, look for examples on how to build your tempate statement. The BP is basically correct.
Template questions may get a better answer here: #templates-archived
if you read the full BP it is to decide who is on the weight scale. Hence the calculations. The tildes are to join strings. Look for examples is what I have been doing for the last 24 hrs.
Thanks for your comments , however waist of time ๐ฆ You could have done with the last one.
You are welcome
BTW, this works just fine. Snipped from one of my BP's where humidity is a sensor entity.
# Convert !input to variable
humidity_now_var: !input 'humidity'
# Get current Humidity from Sensor
humidity_now_val: '{{ states(humidity_now_var) | float(set_val) }}'
I see the string concat ~ in the jinga2 docs now, but have never used it... Sorry to offend you.
Not offended, but bit pissed off ๐ As you can see from my code , I am not here to be lazy, spent a lot of time reading and trying and even found the ~ . Hence I was not so happy with all your comments and finnally no solve. But by getting back to me , I forgot it again. ๐
Let me try if I can convert/ammend your snip into my code.
There examples of just about everything possible in the exchange.
https://community.home-assistant.io/c/blueprints-exchange/53/l/latest