Solar Energy is logged incorrect

For several weeks now, I have been experiencing a strange phenomenon. Every Monday the energy monitor adds the total solar production to that day’s production. This has completely ruined my registration.

I use the SMA integration for recording solar production and until a few weeks ago it worked fine. It always happens on a Monday and it always is at 8:00.

Does anyone also have this experience?

Next picture shows the past weeks:

Next picture shows Monday 11 Jan:

Next picture shows Tuesday 12 Jan (a normal day):

Check the source sensor chart

I don’t know what it is you pointing at.

The next screenshot shows that this behavior (adding total production to the total every Monday) starts somewhere mid December.

I have exactly the same issue. Only for me it’s on Friday, and it started December 17th. pv_pieken
It’s the same week that I installed 2021.12.1. It’s very annoying, since I can’t seen anything else in the month/week overview due to those large peaks.
What additional information can I give that would help resolve this? The value in the graph (on the peaks) is the total yield (since installation) reported by my SMA PV inverter. Somehow HA thinks that this is the weekly yield (I guess).
My Energy configuration is pv_pieken2
Is that correct or should I select another metric for this input? I don’t find what else to choose here.

Inverter auto restart?

Do you have another counters? Like monthly?

If energy get value 0 and after the correct, it will sum all week

100kwh, 101kwh = 1 kwh

100kwh, 0kwh, 101kwh = 101 kwh

You may need a template sensor to do some filtering. At least x>0

I’m not sure if I agree. It worked perfectly fine until somewhere around mid December. You can see that in the graph. Since I’m no longer the only one with this issue and time of occurrence is the same I think something else got kicked over.

Luuk, same problem here. Every Friday at 2:20 am no value from SMA inverter. Then at inverter start in the morning, total yield spike.

According this tread:

I added a template sensor last Sunday. Unfortunately I cannot check it, because since I updated to core-2021-12-10 today, I cannot connect to my SMA inverter anymore.

OK got the SMA inverter up and running again in HA.

Now we wait till Friday.

I don’t think the template sensor will solve our problem. It assumes you have this ‘drop’ and the following spike when no solar is available. Where I live the sun is gone every night so every night I have zero’s but only a spike on Mondays and always on Mondays and Mondays only.

I’m afraid it has something to do with the Energy Monitor and we our self can not solve it.

I noticed on GitHub that the sources for the SMA integration are recently updated. Just to be sure I removed the SMA integration, rebooted HA and reinstalled the SMA integration. Waiting for the next Monday now! :thinking: :crossed_fingers:

I really would like to know if this solves this problem. So please let me know!

Same issue here. Spike every Monday around 7. Flyby15, will you let us know if your problem is solved?

i found this: PR #59848 for SMA solar breaks energy dashboard · Issue #62723 · home-assistant/core · GitHub
so, if i understand correctly, it should be solved with updating home assistant core.
just updated to 2021.12.10. I’ll have to wait till monday to see if this solves the spikes issue.

I did not know that my SMA does a reboot every week. That explains why I have spikes on Monday and jgeo on Friday.

I do not read that the problem is solved in 2021.12.10. I can read that they request to solve it in the next update, and that would be 2021.12.10.

Now I also understand why the work around with the zero’s makes sense. I wait a while before implementing that workaround and see if HA solves it for us in a future update.

Maybe we can start the discussion on how to get rid of the spikes. Can I adjust de database for these false registrations?

Can you confirm that the template sensor work around worked?

Updates did not solve the problem yet!

That would be the next step, indeed, otherwise my history of the past year would be near to useless to view.

I have this same problem also. However with a fronius inverter via MODBUS. Have been trying to play with work arounds but yet to solve it. :frowning:

Solved with 2022.2 release :slightly_smiling_face:

I’ll be able to check if it works after this Friday (my weekly inverter reboot day).
Then the next question is: can we somehow sanitize the database such that the past week, month, and year view are not totally messed up by the faulty spikes?
Or should the code that generates the Energy view take care of that?

Based on flyby15’s post that the problem is fixed in the 2202.2 release, I decided to try to sanitise my data.

To do this, I installed DB Browser for SQLite on my laptop and pulled the HA database from a downloaded backup. This way I could easily explore the database. In the DB, I looked up the metadata_id of the contaminated dataset (in my case, 28) in statistics_meta.

In HA, I installed SQLite Web. With several formulas on the query tab, I was able to look up and change the data.

I started adjusting the data in statistics (this contains all the data for each hour) but I found out later that you first have to adjust the data in statistics_short_term (data per 5 minutes) because HA calculates a value in statistics_short_term every 5 minutes and writes this value to statistics every hour. So start with statistics_short_term and preferably just after the whole hour. This gives you a whole hour to finish your work on statistics_short_term before HA writes a value to statistics.

Below some of my used formulas. Check for your own values and preconditions you need in order to change the proper data set.

Lookup example:

SELECT * FROM "statistics_short_term" WHERE metadata_id =28

Change examples:
Change just one row:

Update "statistics" SET state = 8266,236 WHERE id = 287064

Changing multiple rows on preconditions

Update "statistics_short_term" SET sum = (sum - 8396.68) WHERE ( metadata_id = 28 and sum > 50000 )

It takes some time to figure out what value to subtract from what value and which zeros to replace with what value, but in an hour I was done. Actually, I don’t think adjusting the zeros is really necessary! The result:

Now fingers crossed that the update really has fixed the problem!

I can confirm that I do not have any new spikes today (usually did on Monday’s) since the last update! Problem solved for me!