Energy data gone?

I checked just now and found no energy data available to me from pre Saturday October 1 2022.
Home Assistant 2022.9.7
Supervisor 2022.09.1
Operating System 9.0
Frontend 20220907.2 - latest

Did daylight saving somehow do this? Although I am unlikely to believe this is the problem as the change to clocks did not occur until 3am this morning 02/10/2022. I see no errors in the logs for emhass or sma energy meter. HA core was last updated nearly 5 days ago.

Any ideas?

Not likely, it’s still working here and we started daylight savings last night. I’m using the SMA meter integration too (at least until my IoTaWatt arrives - the SMA meter is not accurate).

Second troubleshooting step (first was check the logs, which you have done) is to check the actual data coming from the sensors you use for the energy dashboard.

Tom
It’s weird - the actual data from the sensors is coming in fine.

  1. I haven’t played with any entity
  2. I haven’t entered any new info in the energy dashboard
  3. The data seems consistent with what i can see from the SMA inverters through sunnyportal
    ?

Yes but you’re not using data from Sunny Portal. You’re using the Home Assistant integration. What does the history of those sensors look like?

Tom
the history of all of these sensors have zero info before date 01/10/2022.

Sounds like database corruption, but that would have left errors in your log - unless you have restarted after the issue happened.

Are there any “FIX ISSUE” buttons in Developer Tools → Statistics?

Tom
yes there are multiple fix issues in this area. A sample of the error is

Unsupported unit
The unit of your entity is not a supported unit for the device class of the entity, energy.
Statistics can not be generated until this entity has a supported unit.
If this unit was provided by an integration, this is a bug. Please report an issue.
If you have set this unit yourself, and want to have statistics generated, make sure the unit matches the device class. The supported units are documented in the developer documentation.s.

I have a sneaking suspicion that my installation of a HACS build - battery sim which also pulled on the data from these sensors may have something to do with it.
If this is the case is there any way of reverting to a database from last week?

Pat

Or should i try an uninstall of the sma energy meter integration and reinstall?

What are the unit_of_measurement for the sensors you are using in the energy dashboard?

Be aware these are case sensitive. So e.g. kWh is good. Kwh is not.

i’ll check but that is certainly something I haven’t played with.

Tom,
here is a snip showing the units it’s looking for. The dashboard has units kWh only. It really looks like the battery sim thing has stuffed around with the data. Where do I go about changing these back?

i just checked in developer tools - states - and looked at the relevant sensors. The unit_of _measurement is set to the expected kWh.

i did find another set of similar sensors and their values are the stated error ones being Var. How do i change them?

Press the FIX ISSUE button. Does it give you an option to fix it?

tom
no - it provides the error message i posted as an image earlier.
pretty weird huh

Tom
I tried rebuilding the sma energy-meter. When i checked the debug logs in that a number of the ‘unit_of _measurement’ values varied from accepted W, kWh, and had values Var and VA.
This may be the issue? the batterysim integration may have changed them in the database? If so how do i change them back. All should be in form kWh???
pat

Well this sucks… just a couple days ago I was browsing months back of my energy data.
did the latest updates for HA and now it is all GONE!

Not the first time this has happened… sure wish the GURU’s would create a workflow to preserve the energy data on updates.

1 Like

I had this happen to me about 3 months ago. Never found a solution. I had hoped that more people experienced it and then we could find some way to access the data (which I am sure is locked away somewhere in the database)

Pat

2 Likes

Well, this happened to me yesterday. I did update in the afternoon to 2023.9.0 but I not 100% sure if energy history was still available before the update. I remember looking at it a couple of days ago and it was fine. When I browse through my history it says “There is no data for this period”

Is there a way to query the database and see if there is still some history?

image

3 Likes

Yup, same here, lost Energy Usage data from September 2023.

Home Assistant 2023.10.1
Supervisor 2023.10.0
Operating System 10.5
Frontend 20231005.0 - latest

1 Like