Create Sensor to Total Daily Energy from Plug (which resets a number of times a day)

I have a Smart Plug that controls heating my van when the temperature gets low. However for that plug to work, the electric to the van must be on; which is off by default; so I have an automation that turns the van electrics on, then the heater plug when the temperature is too low (and off when the temperature is warmer). Given this the heater plug can be powered down/up multiple times in a day.

What I need to create is a sensor that takes the plug Energy Sensor (sensor.plug_van_heating_energy_today) and add it to a template sensor for total_van_heating_energy_today.

The problem is (I think) when the plug is powered down, the sensor.plug_van_heating_energy_today is reset to zero, so I don’t think I can use total_increasing for the template sensor as lower values will be passed in :thinking:

Can someone point me in the right direction please - or correct my thinking ?

Thanks

Use the Utility meter helper with a daily cycle. Resetting to 0 will not affect its daily total. It only counts the increases.