Still generate a “Error in parsing YAML: missed comma between flow collection entries (line: 29, column: 8)” error … i can’t see why …!
I’m in an Automation and want the color to be selefted depending on the state of charge value.
This will be passed to a script for display to an Awtrix screen.
If i remove the whole “{% set … endif %}”, error disepear.
The line 29 is the “{% set …” line
Right now we cannot see what is up with the code as the forum already changed it since you did not use code tags.
Plz edit the post to use code tags (paste in the code again with code tags)
One issue is that elseif is not supported, Jinja uses elif… though that may not be the cause of the error.
Also, States are always strings. So your if/elif statements will fail since they are essentially asking “Is this string greater than that integer?” That question is nonsense as far as the template engine is concerned, so it will throw a different error. You need to use the int filter where you are setting the value of the variable Progress.
The hell … just for that, i though i tried many indentation wnd still your is obviously the right one …
And the error is gone !!!
Well … i feel stupid to have wasted your time for a so simple problem…
Thanks a lot … !