I have 3 utility meters derived from 3 sensors, which are daily gas meters. Two of the sensors are direct readings from a gas meter, the last one is a calculated one.
sensor.gas49a = direct meter reading
sensor.gas49ab = direct meter reading
sensor.gas49b = the difference between sensor.gas49ab and sensor.gas49a
The derived utility meters should reset daily to show the daily gas usage.
Here is the template sensor for sensor.gas49b:
sensor:
- platform: template
sensors:
gas_49ab:
value_template: "{{states('sensor.p1_meter_3c39e727b94a_total_gas')}}"
unit_of_measurement: mÂł
gas_49a:
unit_of_measurement: mÂł
value_template: >-
{{ (states('sensor.huisbaasje_gas_today')|float|round(3)) }}
device_class: gas
gas_49b:
unit_of_measurement: mÂł
value_template: >-
{{ (states('sensor.gas_um_49ab')|float| round(2)) - (states('sensor.huisbaasje_gas_today')|float|round(3)) }}
device_class: gas
However, the utility meter Gas_UM_49b resets daily but not to zero! Last night for example it reset to 2.8m3 ???
(by the way i used in the calculation for sensor.gas_49b the utility meter value sensor.gas_um_49ab but get the same results when using the sensor itself…)
Here is the utility meter which doesnt reset appropriately.
For reference, the other utility meters seem to work as expected and reset to zero.