Energy: Cost for the individual devices

If I understand correctly, one of the challenges with this request is that while it seems straightforward. It is only straightforward for those without solar or home-batteries. If you have solar and/or batteries then the cost of electricity in any time period is more difficult to determine - when an individual device consumes electricity, what is the cost of that combination of grid/solar/battery at that moment?

However, “difficult” is not the same as “impossible”. Having thought this through, here’s how it can be done.

3 sources of electricity:

  • Grid (cost given by electrical supplier - can often change every half hour)
  • Solar (cost is “free”, similarly for Wind, etc)
  • Battery storage (cost depends on the cost of electricity used to charge the battery, with a round-trip efficiency factor applied).

For any short period of time (e.g. every 5 minutes), we can observe and measure:

  • EP_grid (the kWh provided by the grid) (zero if off-grid or exporting…)
  • EP_solar (the kWh provided by solar) (zero at night, etc)
  • EP_battery (the kWh provided by the battery) (zero if we are charging the battery)

Here ‘EP’ = Energy Provided. And then EP_total is the sum of all 3: EP_grid + EP_solar + EP_battery

And similarly when charging the battery, there is a

  • EP_solar_charging (the kWh used from solar to charge the battery)
  • EP_grid_charging (the kWh used from the grid to charge the battery).

At any moment in time we have electricity being consumed and electricity being provided. Grid can provide and consume (if you are exporting). Solar panels only provide. Battery can provide and consume.

The cost of electricity in any interval of time is the weighted cost of the electricity from each provider. So the real-time cost per kWh for any device consuming electricity then, is:

Cost of electricity in any interval ‘C_elec’ = C_grid * EP_grid/EP_total + C_solar * EP_solar/EP_total + C_battery * EP_battery/EP_total. (where, as above, EP_xxx is zero if that provider is not currently providing electricity, so if the battery is not discharging, EP_battery is zero).

How do we calculate each of C_grid, C_solar, C_battery? C_solar is easy (it is zero). C_grid is also easy - it is the cost per kWh charged by the grid in that time period. C_battery needs to be calculated.

To do that we must maintain a total cost (money) that has been stored in the battery. This is updated any time that the grid is used to charge the battery at all:

  • Total_cost_in_battery = Last_period_total_cost_in_battery + EP_grid_charging * C_grid + EP_solar_charging * C_solar.
    Again C_solar is zero.

C_battery is then Total_cost_in_battery/Total_kWh_in_battery - in units of money/kWh obviously. Note that the kWh in battery is required here - it will presumably be slightly less than the kWh used to charge the battery (since that process is not 100% efficient). So need to have battery monitoring to tell you the kWh stored. If the battery has been mostly charged with solar and/or cheap overnight electricity, then the C_battery will be low. We may also need to directly apply an inefficiency factor to C_battery to account for the outbound inefficiency. i.e. when our battery drops from 20kWh to 15kWh, we may only have consumer 4.95kWh of electricity - the final 0.05kWh is lost. We should account for that by adjusting C_battery. Or we could separately measure accumulated “battery losses” and attribute a cost to that. But I think better to adjust C_battery so that the consumers of the electricity are more accurately costed.

So, using the above we can calculate ‘C_elec’, and hence know the cost of electricity in our system in the current time interval. That is the cost that should be applied to any consumer of electricity in this time interval: mostly that is all of your household devices. If you are exporting to the grid, then it is also your supply cost for that export (so the grid should be paying you more than C_elec if you are choosing to export!).

[Note: edited to correct power/energy confusion]