fix: sensor

This commit is contained in:
willem.serruys
2026-08-22 19:44:07 +02:00
parent d2ea0f16aa
commit a6d8b66b8a

View File

@@ -74,7 +74,7 @@ template:
state: >
{% set diameter = 1450 %} {# mm #}
{% set radius = diameter / 2 %}
{% set height = states('sensor.regenput_sensor_distance') | float(0) %}
{% set height = states('sensor.cistern_water_height') | float(0) %}
{% set volume_mm3 = 3.14159265 * (radius ** 2) * height %}
{{ (volume_mm3 / 1000000) | round(1) }} {# convert mm³ to liters #}
@@ -84,5 +84,5 @@ template:
state_class: measurement
state: >
{% set sensor_offset = 2090 - 290 %} {# full tank height - sensor_mount #}
{% set height = states('sensor.regenput_sensor_distance') | float(0) %}
{% set height = states('sensor.cistern_water_height') | float(0) %}
{{ (height / sensor_offset * 100) | round(1) }}