# Newbie - tracking electricity cost - 3ph meter and utility meters (smartplugs)

Hi

I have the TotalPowerIn reading from my electricity meter (total_increasing), and a number of smart plugs with power monitoring (which also has total_increasing sensors).
I would like to be able to track the cost of the consumption for each smart-plug using the energy dashboard- and the only way to do this is probably through some kind of template sensor, where the consumption from the smartplugs are subtracted from the 3ph electricity meter. But this will not make sense when the smartplugs sensors are total_increasing as well .- or will it ?

The plan would then be to add the smartplugs - and then subtract the smartplug consumption from the TotalPowerIn - and add that as the template sensor for the power meter…

Any suggestions how to handle this ?

Or is it straightforward - just to sum the total_increasing from all smartplugs - and subtract that result from the TotalPowerIn from my electricity meter ?

NB: Just foudn a catch - two plugs are Sheely Plug S - which have their kWh counter reset on power loss… I gues sthis requires some sort of extra work (perhaps Riemann Sum Integral), which I have no clue how to configure …

Hi

Just to illustrate the issue:

The scenario: I have a sensor for power consumption on my electricity meter.
In order to track costs for the individual devices, I will have to add them to the energy dashboard as well.
But in order to avoid “double consumption”, I need to subtract the consumption from the smartplugs from the meter reading…

Eg.: Before power cycle, the electricity meter reads 120.000 kWh
Shelly Plug 1 reports 13 kWh
Shelly Plug 2 reports 12 kWh

The “reading” to be used by the energy dashboard should then be 120.000 - 13 -12 = 119.975 kWh

If power if cycled on the Shelly plugs, the consumption will suddenly be:

Shelly Plug 1: 0 kWh
Shelly Plug 2 0 kWh

Reading for the energy dashboard = 120.000 - 0 -0 = 120.000 kWh

Example:

Resulting in a sudden jump of 25 kWh - which is underiseable if you want to track the economics via the dashboard…

Can anyone enlighten me?

Regards
Brian