Hi I am trying to compare a sensor state value against a helper input value.
The issue I am having is that the value I see in the helper slider and in the Developer states, is different to what the yaml states syntax is reporting:
The ‘input_number.charge_to_soc’ float value is being reported by the template syntax as 5 units lower than whatever I acually set it too using the slider?
Here is my code:
{% if float(states(‘sensor.victron_battery_soc’)) == float(states(‘input_number.charge_to_soc’)) %}
Yes
{% else %} No
{% endif %}
{{states(‘sensor.victron_battery_soc’) |float - 5}}
{{states(‘input_number.charge_to_soc’) |float - 5}}
The If statement is doing the comparison and the single state lines are simply printing the values I am testing so I can see if the comparitors are working as expected.
Can anyone explain whats going on and if i need to correct anything in my code to have the desired values being reported in my code?
Kind regards
Duncan