I’m using the Integration - Riemann sum integral to calculate the gas consumption of the boiler.
As the boiler provides its current power in percent, I first calculate the power in Watts from this (DHW mode has 29 kW, heating 24 kW for 100%):
- platform: template
sensors:
boiler_power_in_watts:
friendly_name: "Kazán teljesítmény Wattban"
value_template: >
{% if is_state('binary_sensor.boiler_ww_charging', 'on') %}
{{ ((states('sensor.boiler_burner_current_power')|float(0)) * 29000 / 100) | round(0) }}
{% else %}
{{ ((states('sensor.boiler_burner_current_power')|float(0)) * 24000 / 100) | round(0) }}
{% endif %}
then I convert this to Wh with this integral:
- platform: integration
source: sensor.boiler_power_in_watts
name: boiler_energy2
round: 0
method: left
and finally convert this to m³, which can be used in the Energy panel:
template:
sensor:
- name: "Kazán saccolt összfogyasztása"
unit_of_measurement: "m³"
state: >
{{ ((states('sensor.boiler_energy2')|float(0)) / 9444) | round(3) }}
state_class: total_increasing
device_class: gas
This more or less works fine with a small problem: these values gets recalculated only when the power of the boiler has changed… which often remains constant for long, sometimes for hours.
Of course the daily consumption is OK, but the Energy panel has hourly resolution, which in this case results an hour with zero gas use, and then the next hour with double value, like here at 06-07 hours:
because the boiler power was at constant 14% for that period:
Is there a way to force the recalculation of the integral sensor somehow?