Is it possible to erase any historical data for a given sensor (energy)?

Pretty simple scenario: Shelly EM clamp connected to a channel (e.g. whitegoods) and now connected to hvac system.
The energy dashboard is now completely messed up (as it should be :slight_smile: )

Can I somehow erase any data for this sensor? Like it has been always to 0 and starting to count from today?
I’m talking about an energy (kWh) sensor provided by Shelly EM, which has the “erase energy data” menu but:
1- I’m afraid to loose any data related to the other clamp (the main power source)
2- I suppose the energy usage for my sensor is now in HA database, so nothing will happen.

Is it possible to do what I want to do?

Very quick edit: I have access to the database, so I can perform any necessary query…

Developer Tool → Statistics. Click on the little ramp icon next to the entity.

Unfortunately the “adjust a statistic” modal seems to let you edit one or more data point. I cannot simply reset that statistic.
If I insert a “-1936” (the opposite of the current value) things get weird!

Can you set all the previous readings to zero?

There are 3-4 readings per minute, and it has been connected since mid 2021 :sweat_smile:

I think I will create a template sensor and a new integration sensor, to fool HA to have a “new” channel…

Hi Tom,
I am having a sensor measuring temperature in our HVAC system. After it was powered off it made an entry to the history database with a reading of -350 degree celcius which prevents making a graph from the last period.
I am not having the ramp icon next to the sensor recorder, only a ramp icon for the cleated helpers. Do you know how to edit the database for the recorded sensor data or is it possible to create a helper that records the temperature which I then can edit? I am new to HA so if there is a tutorial please point me in that direction :slight_smile:

I also wanted to remove all the history of a single entity only. It can be done by calling the service Recorder: Purge Entities. You can call it via the lovely web interface, reachable under Developer Tools → Services. For completeness, here’s the documentation:

Now, I would be interested in an easy way to purge only a certain time-span, but that’s a different question.

1 Like