From d2ea0f16aa3679bd0f5c6e6a4467728aa87b30f6 Mon Sep 17 00:00:00 2001 From: "willem.serruys" Date: Sat, 22 Aug 2026 19:41:03 +0200 Subject: [PATCH] fix: sensor --- configurations/home-assistant/configuration.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configurations/home-assistant/configuration.yaml b/configurations/home-assistant/configuration.yaml index 014af9e..fa6e5dd 100644 --- a/configurations/home-assistant/configuration.yaml +++ b/configurations/home-assistant/configuration.yaml @@ -62,7 +62,7 @@ template: state: > {% set mount_gap = 290 %} {# mm from sensor down to the "full" water line #} {% set max_water_height = 2090 %} {# mm, tank depth from full line to bottom #} - {% set distance = states('sensor.cistern_distance') | float(0) %} + {% set distance = states('sensor.regenput_sensor_distance') | float(0) %} {% set height = max_water_height - (distance - mount_gap) %} {{ [ [height, 0] | max, max_water_height] | min | round(1) }} @@ -74,7 +74,7 @@ template: state: > {% set diameter = 1450 %} {# mm #} {% set radius = diameter / 2 %} - {% set height = states('sensor.cistern_water_height') | float(0) %} + {% set height = states('sensor.regenput_sensor_distance') | 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.cistern_water_height') | float(0) %} + {% set height = states('sensor.regenput_sensor_distance') | float(0) %} {{ (height / sensor_offset * 100) | round(1) }}