fix citern
This commit is contained in:
@@ -60,10 +60,11 @@ template:
|
|||||||
unit_of_measurement: "mm"
|
unit_of_measurement: "mm"
|
||||||
state_class: measurement
|
state_class: measurement
|
||||||
state: >
|
state: >
|
||||||
{% set sensor_offset = 2090 %} {# distance (mm) from sensor to tank bottom #}
|
{% set mount_gap = 290 %} {# mm from sensor down to the "full" water line #}
|
||||||
{% set distance = states('sensor.regenput_sensor_distance') | float(0) %}
|
{% set max_water_height = 2090 %} {# mm, tank depth from full line to bottom #}
|
||||||
{% set height = sensor_offset - distance %}
|
{% set distance = states('sensor.cistern_distance') | float(0) %}
|
||||||
{{ [ [height, 0] | max, sensor_offset] | min | round(1) }}
|
{% set height = max_water_height - (distance - mount_gap) %}
|
||||||
|
{{ [ [height, 0] | max, max_water_height] | min | round(1) }}
|
||||||
|
|
||||||
- name: "Cistern Volume"
|
- name: "Cistern Volume"
|
||||||
unique_id: cistern_volume
|
unique_id: cistern_volume
|
||||||
@@ -82,6 +83,6 @@ template:
|
|||||||
unit_of_measurement: "%"
|
unit_of_measurement: "%"
|
||||||
state_class: measurement
|
state_class: measurement
|
||||||
state: >
|
state: >
|
||||||
{% set sensor_offset = 2090 %} {# same as above, = full tank height #}
|
{% set sensor_offset = 2090 - 290 %} {# full tank height - sensor_mount #}
|
||||||
{% set height = states('sensor.cistern_water_height') | float(0) %}
|
{% set height = states('sensor.cistern_water_height') | float(0) %}
|
||||||
{{ (height / sensor_offset * 100) | round(1) }}
|
{{ (height / sensor_offset * 100) | round(1) }}
|
||||||
|
|||||||
Reference in New Issue
Block a user