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.
I have exactly the same issue. Only for me it’s on Friday, and it started December 17th.
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
Is that correct or should I select another metric for this input? I don’t find what else to choose here.
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.
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!
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?
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: