For some time I have been using the Energy Dashbord with my Home Assistant Glow and calculating the cost from a Nordpool plugin (kWh price change every hour here).
Now I got a new contract with my PEV Charger provider, so I pay flat rate for home charging. The power for the PEV charger runs through my meter so I got an Schneider Electric PowerTag sensor for the PEV charger so I get the total kWh and W from it.
Ideally I would like to subtract the power usage for the PEV charger from the total energy consumption so I somehow can calculate my real cost.
It’s not just a simple subtraction as the price change by hour.
Can I somehow, hour by hour, or “live” subtract the PEV charger from Home Assistant Glow total?
I’m not really sure what a “Home Assistant Glow” is. But sounds like you’re describing a template sensor. Probably something like this:
template:
- sensor:
- name: Total energy consumption minus charger
state: >-
{{ states('sensor.total_home_energy') | float -
states('sensor.pev_charger_total_energy') | float }}
unit_of_measurement: kWh
state_class: total
Obviously I’m kind of guessing on things. But a template sensor will recalculate its state any time any of the entities it depends on change state. So if you have two total energy sensors you can make a new one that is always equal to one minus the other this way. Or whatever formula calculates it correctly for your use case, just make it into a template.