Reset the value on an energy sensor

Hi there,

I have a situation where one energy sensor was being used on one place and now its been repurposed to fit another place. The device is a Shelly Plus 1PM.
So I removed the device from the Shelly integration, changed its name, the channel name etc, but when I re-added the device it showed the energy reading for the sensor with a value (397kWh) that belonged to the previous use case.

I have been looking around trying to figure out how to reset this reading back to ZERO.

I’ve come across this topic Reset energy sensor however I get the same error as the user in the last comment:
“service not found”.

How can I proceed with reseting the energy sensor? Thanks

That service is for utility meters only, not your Shelly device.

Try this.

  1. Delete the device again.

  2. Restart HA (may not be necessary but best to be sure)

  3. Go to Settings → Devices & Services then navigate to the Entities page using the tab at the top of the page. Click on the far right “Status” column to sort by this. Select and delete the “Restored” entities with this icon in the status column: 467eaa45300e347ea72a4e69c77201932f71bbf4 if there are any. Not the ones with this icon though
    Screenshot 2024-04-03 at 12-22-08 Settings – Home Assistant

  4. Go to Developer Tools → Statistics. Click on any FIX ISSUE buttons and follw the instructions to delete the statistics if offered.

  5. Try adding your device again.

Hi @tom_l thank you for your reply.

So I’ve followed the steps you provided without success:

  1. Deleted the device
  2. Restarted HA just in case
  3. Went to Settings → Devices > Entities, there was no Shelly entity with the symbol
  4. Went to Developer Tools → Statistics and pressed on FIX ISSUE until there were none left
  5. Restarted HA just in case again
  6. Re-added the device

Same reading on the energy sensor.

Is the value coming from the device perhaps?

I haven’t used a Shelly device for ages, they used not to have permanent memory, cut power and it would forget its total energy. Perhaps that has changed?

If you open the device’s IP address in a web browser what do you see?

Hi @tom_l ok so I figured this one out.

But first let me tell you I’ve been using Shellies for maybe 4 years now and I really don’t recall going over that experience of cutting the power and the values going away. I’ve seen people talking about it, but not my experience.

Anyway, I solved this by going to
Developer Tools > States
searched for the entity
there’s a field called “State” it should show the actual value, just erase that and type 0
press the button “Set State”

and … well it goes to zero and then goes back to the previous value. (just noticed this while typing the answer)
I think I’ll just do a factory reset on the thing and see how it goes.

2 Likes

Yeah that set state option in Developer Tools States is for testing only. It won’t permanently change the state.

1 Like

Yup a good ol’ factory setup solved the issue. Maybe the value is being held by the Shelly. Well, solved. Thanks for your support!

You don’t need to factory reset the Shelly. Reset of the total energy value (aenergy:total) can be done via API call.
First, get the actual values with:
http://>IP-Shelly</rpc/Shelly.GetStatus

The reset of aenergy is done by (e. g. for Shelly Plus 1pm):
http://>IP-Shelly</rpc/Switch.ResetCounters?id=0&type=[“aenergy”]

Reference: Switch | Shelly Technical Documentation