[Solved] Negative values of energy?

Same here, on april it was okay, I changed nothing in settings…

Was someone able to solve this? I’m using “Power sensor” With left riemann integration to create an energy entity, and I randomly have negative values on the energy dashboard.

1 Like

@FollonSaxBass

This was supposedly fixed in 6.0 or 6.1 (introduced in 5.0)…no one has confirmed it’s actually fixed (yet). Are you seeing it on 6.1 or 6.2?

Just had the same issue happen.

I have four identical Gosund Smart plugs, same version of ESPHome and yaml config.

Home Assistant 2023.9.2
Supervisor 2023.09.2
Operating System 10.5
Frontend 20230911.0 - latest

All using Total Daily Energy sensor in kWh.
Two are showing properly, two are not. No idea what is causing this… any tips would be appreciated. Thanks

Same issue this month.
I’ve got negative values in energy dashboard, but ever-increasing values in the history of the sensors.
However, I’ve got missing history data (due to offline devices) on the day the dashboard shows negative values.
Maybe this is correlated ?

1 Like

This seems to be the case. I connected a power monitor today that had been unplugged for a little while. It had a small heater running at 800W attached. Consumption began reporting at 5.42kWh which is obviously impossible. So a negative value looks to have been created in order to make it match the HEM total reading.

I actually don’t understand why the summation history jumped from 0 to 4. That doesn’t seem to make sense.

1 Like

I’m having a similar issue. 2 Tuya BSD29_1 socket plugs show a drop in Energy (kWh) just after 12am, but not resetting to zero. Resulting in a negative power consumption.




same issue here I have 3 values calculated with riemann sum integral originating from mqtt W meters. as soon as the value drops to zero the energydashboard shows the whole e.g. 11.5kWh as positive and negative value for the same timeperiod :frowning:

Did you eventually fixed it? I have the issue with EV-charger that was offline for a month. I now used it and I have a negative use of 20kWh and untraceable use of the same amount.

I just find out that in dev. tools → statistics you can correct values. You can even find all spiker / outliers (in dutch uitschieters) and just change them to zero.

There is a close bug report for the offline energy issue: Disable Negative Energy values · Issue #95154 · home-assistant/core · GitHub.
Maybe another option is to make a helper based on the device. Not sure if this is expected behavior.

Hi there, this still seems to be an issue.

Regarding to the energy dashboard, my fridge (“Kühlschrank” in german) “produces” energy every now and then. Of course i use an accumulating sensor entity, it shows daily consumption in “kWh”. How can an accumulating energy decreasing? I mean, a fridge usually doesn’t “produce” energy.

I have not a single energy production entity in my environment yet. Except the fridge of course! ;-))

In case that matters: my frigde is connected with a Tasmota smart plug “Nous A1T”. Maybe the issue isn’t caused by HA, it could be also caused by some weird readings from that plug? When you buy that device, you need to calibrate it befrore using it. I’ve done that of course. Most of the time the readings seem okay, but then this happens every now and then…

The plug provides this data:

For the energy dashboard i use the “energy total” entity.

This is from today:

For comparison yesterday:

Regards
Sven

I have the same issue with the Nous A1T. The reason is simple and very annoying: The A1T forgets all counters on power loss and restarts with zero. Not good for a meter.

EDIT:
The state_class of the counter must be total_increasing. With this state_class a counter reset is handled correctly.

Replacing the “ENERGY Total” counters by “ENERGY Today” solves the issue for me.