# Calculating power provided by boiler (using OTGW data)

Hi all,

As part of my quest to map and visualize our energy consumption (reduction always starts with transparency and awareness IMHO), I’ve been building a view on our electricity use using the awesome Sankey chart. Now, I’d like to extend that view adding also our gas consumption.
To do so, I was hoping to use the data from OTGW (using hot water temp, return temp and water flow) to calculate this. Has anyone done this before?

To calculate, I’d start from the basic formula Q = m * c * deltaT. (Q is heat in Joule, m is mass in gram, c is a constant which is 4.18 kJ/(kg*K) and delta T is the temperature difference (in Kelvin or degrees Celsius). This starts from the units that are used in Europe, equivalents exist of course for other regions.
So Q/t is Power (Joule / seconds = Watt) = m/t (flow in g/second) * c * deltaT .

In practice, I’ve set up a sensor to play around with:

``````sensor:
- platform: template
sensors:
heating_power:
friendly_name: "Heating Power"
unit_of_measurement: "W"
icon_template: mdi:fire-circle
value_template: >-
# outgoing temp of boiler from OTGW
{% set hot_out = states('sensor.dhw_temp_boiler_otgw') | float %}
# temp of returning water from OTGW
{% set hot_in = states('sensor.return_water_temp_boiler_otgw') | float %}
{% set flow_rate = states('sensor.dhw_flow_rate_boiler_otgw') | float %}
{{ (hot_out - hot_in) * flow_rate * 209/3 | round(1, default=0) }}
``````

(this includes conversion from minutes to seconds etc.)
Based on that, I am considering adding Utility Meters to get to the energy consumption.

Would love to hear how you’re doing this!

My OTGW will arrive somewhere coming week. Do you still use this formula and do you know whether or not it is correct in practice? I am thinking of running the same setup, but comparing it to the gas usage (substracting some for cooking and hot water)

Hi Frank,

Don’t think it is correct… It was more of an experiment.
In my case, it seems to work for the shower, as I have a flow there, but for the heating, I haven’t found a flow sensor in OTGW. So I’m going to be patient and wait for when a smart meter is installed, and will use that then…

Sorry to budge in, but what is this OTGW?

I’m looking a way to find out energy-flows in and out of our hot water tank.

I’m quite new to Home Assistant, but what I didn’t find was any integration of flow-meter to it…

OTGW stands for Open Therm GateWay. Most of the central heaters support Opentherm to a certain extent. With the OTGW you can read some or all of that data and in some cases also push settings.

Data you can get are things like water temperature, flow back temperature, efficiency, pressure etc.

I now have a waterpump for my floor heating that shows the flow of water. I decided to add 2 temperature sensors so I can calculate the capacity of my floor heating. Usually ΔT is about 12 degrees and flow is around 440 liters per hour. Logically that means that my floor is about 6 kW.

Now if I do the calculation myself with the below sensors:

sensor.vloerverwarming_alpha3_flow (in M3/H)
sensor.wemosd1_vloerverwarming_aanvoer (in degrees)
sensor.wemosd1_vloerverwarming_retour (in degrees)
c = 1,163 Wh/kg ,K

Q (in kWh) = m . c . ΔT =>

{{ ((states(‘sensor.vloerverwarming_alpha3_flow’)|float * 1000) * 1.163 * (states(‘sensor.wemosd1_vloerverwarming_aanvoer’)|float - states(‘sensor.wemosd1_vloerverwarming_retour’)|float) / 1000) | round(2) }}

And presto: 4.2kWh which sounds logical

As a next step I will relate that that to my gas consumption (1 M3 gas equates to approximately 9,769 kWh) and thus see what the efficiency of my boiler is

1 Like