Calculate solar power being used on a sensor

Hi all,

A little context to my quest :slight_smile: : we have solar panels which produce energy, and we have some electric equipment (electric car, water boiler, jacuzzi,…) where I would like to know how much % we actually use from regular (bought) energy and how much we consume from our own produced energy.

E.g.:

  • If entity: binary_sensor.car_charging_status = “charging”
    → 4kWh (charging speed) - sensor.electricity_meter_energy_consumption_from_grid = actual grid consumption.

Example: car charges at 4kWh and the actual energy consumption is 1kWh, then I know I’m consuming 3kWh from our own production.

e.g. 2:

  • If switch.tapo_boiler = on
    → sensor.tapo_boiler_current_power - sensor.electicity_meter_energy_consumption = actual grid consumption.

I’ve looked into the “helper” templates, but via the GUI this wasn’t possible. I assume this should be done in YAML (or node-red might be an option?).

After several weeks of reading I just need a little push in the right direction. :slight_smile:

Thanks in advance!