Dear team,
I have battery
full = 27 V
Empty = 24 V.
i wan convert it to SOC (%).
please help me.
big thanks.
regards.
Dear team,
I have battery
full = 27 V
Empty = 24 V.
i wan convert it to SOC (%).
please help me.
big thanks.
regards.
You can do it like this, for example
{% if states('sensor.voltage') | float(0) > 27 %}
100
{% else %}
{{ ((states('sensor.voltage') | float(0)-24) / 0.03) | round(0) }}
{% endif %}
This will limit the output to 0 to 100%.
"{{ ([0, ((states('sensor.voltage')|float(0) - 24) / 0.03)|round(0), 100]|sort)[1] }}"
Just want to say you (OP) must keep in mind that the relationship might not be linear and that how it discharges will depend on the type of battery. That said, you might not be able to do better than this.
Have a look at: Compensation - Home Assistant