Subtracting energy sensor hourly

I have built a sensor that subtracts the electricity used to charge my car from the house’s total energy consumption as shown below, this is to get an idea of how much electricity the house uses excluding the charging of the car. Works perfectly except that the energy dashboard shows negative electricity consumption when I charge the car. However, the statistics seen to be correct over a day, but wrong occasional hours when the car is charging.

According to the graphs below, it seems to be because the electric car charger (Easee) reports consumption once per hour. Maybe someone has encountered the same or has some clever trick to make it look correct even on an hourly basis? :slightly_smiling_face: The bright bar in the Energy Dashboard is household electricity. What confuses me is the high consumption between 01.00-02.00 for the house consumption.

Really hoping to egt this in place before new year so that this looks good in 2023 rght from the start so all help is welcome :slight_smile:

template:
  - sensor:
      - name: "Elförbrukning hushåll"
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        state: "{{ states('sensor.last_meter_consumption_total') | float - states('sensor.easee_laddbox_lifetime_energy') | float }}"

Household consumption (total - car charger):

Car charger consumption:

Light blue is household consumption (house total - car charger), dark blue is car charger