The split works well, but the comparison operation ‘==’ didn’t work. I’ve tried differents ways:
{% if states('{{ value_json["SerialReceived"].split(":")[1] }}', 'Print time') %}
{% if '{{ value_json[SerialReceived].split(:)["1"] }}', 'Print time' %}
{% if '{{ value_json[SerialReceived].split(:)["1"] }}' == 'Print time' %}
And any one work properly, I supose it’s a typologi issue, or it’s gramatical?
I mean, in the else answer, when I put just N/A the answer was N/A; but if you put {{ N/A }} the answer is nothing, the old value stay. At least in my settup
Putting things in {{ }} will force them to be evaluated as a template. {{ N/A }} is actually calculating the division of non existent string N by non existent string A. I would be very surprised if this has not generated an error in your log.
is it possible to only trigger a value change if the if statement is fulfiled?
if i remove “else” it resets the value to an empty value. is there an option to discard the change and just trigger the values if there are any matching?