Spikes in Calculated House Power When EV Charger Stops

I have two power sensors coming from my EV changer:

  • prism_potenza is the power provided to the car
  • prism_power_grid is the total power drawn from the grid (house+EV)

I have created a 3rd sensor to get the power used by the house (by difference)

  - platform: template
    sensors: 
      prism_potenza_casa:
       value_template: "{{(   states('sensor.prism_power_grid') | float(0) - (states('sensor.prism_potenza') | float(0)) ) | round(3) }}"
       unit_of_measurement: "W"

The EV charger is setup to hover around 6kW (total grid draw) and I noticed that every time it stops charging there is a 6kW spike on the “house power” sensor (“prism potenza casa”

This seems to be due to the fact that the 2 sensors don’t update exactly at the same time, is there a way to fix this?


If one of the sensors is always the slow one you could use a triggered template sensor to only update when the slow sensor does.