Tracking gas and water usage for Hot tapwater (daily/montly/yearly)

Hi Everyone,

I’m looking for some help with my challange.
My current HA installation (HA Yellow, Latest update) finally has a water meter (Homewizard). :star_struck:

So to get some insight in our hot water usage (for a future E-boiler with heat pump) I’d like to create daily, monthly and yearly counters that count my hot water usage in m³ in both gas and water.
My central heating (Nefit Easy) is also integrated in HA and provides status updates (0H- system standby, =H:Hot water active, -H: Central heating active).

So if nefit.status = “=H:Hot water active” then:
Add usage of sensor.watermeter_total_water_usage to daily hot water counter;
Add usage of sensor.Gas_Delivered to daily hot water gas counter;

But I can’t figure out how to create it :slight_smile:

Any help would really be appreciated

I was thinking about something similar, but never bothered to build it.

I can see this working in two ways.

  1. create two new sensors (hot_water_water_usage and hot_water_gas_usage for example) and add two automations where the trigger is a change in the total water usage or the total gas usage and the condition is the nefit.status == “=H:Hot water active”.
    The automation then updates the newly created sensors with the difference between the previous status and the new status of the total water usage or the total gas usage.
    (you can’t update the value with just the latest value of the total sensor, cause then you wouldn’t count only the hot water usage.)

  2. whenever the nefit.status updates to “=H:Hot water active”, grab the values of total water and total gas usage and store them somewhere. When the nefit.status changes back to 0H or -H, grab the values again and subtract. That should be the total hot water usage, so update your sensors with those values.

Both may be slightly inacurate. My DSMR 5 smart meter only updates gas usage once a minute for example.

I haven’t tested any of this, so I’m not sure if it will work.