solis-sensor icon indicating copy to clipboard operation
solis-sensor copied to clipboard

Variable sensor.solis_energy_today not updated correctly!

Open Bildhauer1963 opened this issue 1 year ago • 16 comments

The variable solis energy today (sensor.solis_energy_today) is ist not updated correctly. Starting at 12.00 am it seems that it starts updating with an initial value of the cumulated value for the day. Please look at Cursor_und_Home_Assistant_und_New_Issue_·hultenvp_solis-sensor_und_Über_dem_Nachrichtenbetrachter__Mailbutler. Solis itself show for today the following dat Wechselrichter-DetailsSolisCloud

Bildhauer1963 avatar Jul 19 '24 11:07 Bildhauer1963

Most Solis inverters reset at dawn, meaning they continue reporting energy stats from the previous day until dawn via the API. There is a filter in the code that ignores data based on inverter state during the morning. Looks like your inverter reports the wrong state via the API, meaning proper reporting only starts at noon. Please provide a screenshot of inverter state from midnight till somewhere after noon for a day that your observe this anomaly

hultenvp avatar Aug 28 '24 07:08 hultenvp

I have the same problem, is has nothing to do with inverter reset at dawn, it occurs everytime you restart home assistant, it gets value 'unknown' instead of zero (like the month and year variables do get). I think it is because we have a battery only converter so there are no energy values (never), I also have to manually change it fro munknown to zero after each HA restart

eddysteurs avatar Oct 07 '24 11:10 eddysteurs

{12FC542A-104E-4841-A0B4-01B5E48BE0B6}

I think I have the same issue, it shows a big peak of the previous day's worth of solar production.

J3G0 avatar Oct 30 '24 16:10 J3G0

Also (sorry I'm new to HA), is there any way to see a more detailed view instead of the 1 hour blocks in the energy dashboard.

J3G0 avatar Oct 30 '24 16:10 J3G0

Screenshot_20241111-230941~2 Screenshot_20241111-231747

As you can see the previous days worth of energy is added right when the inverter is initializing.

J3G0 avatar Nov 11 '24 22:11 J3G0

It looks like when the inverter is starting up the previous days total is still in the system and get pushed. However it corrects itself shortly after, on the next update it seems. This is also seen in the graph. The solis energy today also recorrects itself. Look like there needs to be a filter implemented to prevent this inverter behaviour to get stuck in the energy dashboard.

Some more screens; Screenshot_20241115-134732 Screenshot_20241115-134638 Screenshot_20241115-134645

J3G0 avatar Nov 15 '24 12:11 J3G0

Might have the same root cause as #395 .

Please try again with release 3.7.1

hultenvp avatar Nov 17 '24 16:11 hultenvp

Looks like in the changelog you defined the minimum required HA v to be v2024.9.0.

I am using the Synology HA core version, which is currently HA v2023.7.3-22.

So I can't update the integration. Any reason that requires the 2024.9 version?

J3G0 avatar Nov 24 '24 19:11 J3G0

I moved to a docker installation and V2024.9.3.

Yesterday no power really but today some.

Will update if I see that v3.7.1 fixed it :)

image

Might have the same root cause as #395 .

Please try again with release 3.7.1

J3G0 avatar Nov 28 '24 20:11 J3G0

Might have the same root cause as #395 .

Please try again with release 3.7.1

Sadly the 3.7.1 release doesn't fix this problem. This morning I got the full production of yesterday added again. Screenshot_20241129-101428

J3G0 avatar Nov 29 '24 09:11 J3G0

Still happening in 3.8.1 as well, a check should be implemented to check how long the inverter is online for. To exclude this false value from being included in the reporting. Screenshot_20250103-215117

J3G0 avatar Jan 03 '25 21:01 J3G0

Some more info: image

Inverter seemed to come online at 9:35 - 9:40 when the incorrect value (full production of previous day) is recorded. I got the logs from ~08:20 to ~09:45.

The logs:

2025-01-14 08:19:30.399 INFO (MainThread) [custom_components.solis.soliscloud_api] Login successful 2025-01-14 08:19:30.399 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Found inverters: ['XX'] 2025-01-14 08:19:30.399 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 08:19:32.522 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 08:19:32.523 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 08:19:34.640 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 08:19:34.646 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:05:00, at 2025-01-14 07:24:34.646419+00:00 2025-01-14 08:24:34.648 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 08:24:36.866 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 08:24:36.867 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:05:00, at 2025-01-14 07:29:36.867344+00:00 2025-01-14 08:29:36.870 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 08:29:39.023 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 08:29:39.024 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:05:00, at 2025-01-14 07:34:39.024827+00:00 2025-01-14 08:34:39.027 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 08:34:41.242 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 08:34:41.243 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:05:00, at 2025-01-14 07:39:41.243875+00:00 2025-01-14 08:39:41.245 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 08:39:43.387 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 08:39:43.388 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:05:00, at 2025-01-14 07:44:43.388179+00:00 2025-01-14 08:44:43.390 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 08:44:45.536 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 08:44:45.537 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:05:00, at 2025-01-14 07:49:45.537700+00:00 2025-01-14 08:49:45.539 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 08:49:47.769 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 08:49:47.770 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:05:00, at 2025-01-14 07:54:47.770235+00:00 2025-01-14 08:54:47.772 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 08:54:49.969 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 08:54:49.970 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:05:00, at 2025-01-14 07:59:49.970316+00:00 2025-01-14 08:59:49.972 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 08:59:52.197 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 08:59:52.198 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:05:00, at 2025-01-14 08:04:52.198711+00:00 2025-01-14 09:04:52.200 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 09:04:54.353 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 09:04:54.355 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:02:45.600704, at 2025-01-14 08:07:39.955976+00:00 2025-01-14 09:07:39.957 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 09:07:42.107 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 09:07:42.108 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:05:00, at 2025-01-14 08:12:42.108029+00:00 2025-01-14 09:12:42.109 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 09:12:44.252 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 09:12:44.254 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:05:00, at 2025-01-14 08:17:44.254367+00:00 2025-01-14 09:17:44.257 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 09:17:46.497 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 09:17:46.500 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:05:00, at 2025-01-14 08:22:46.500605+00:00 2025-01-14 09:22:46.502 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 09:22:48.737 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 09:22:48.738 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:05:00, at 2025-01-14 08:27:48.738421+00:00 2025-01-14 09:27:48.740 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 09:27:50.897 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 09:27:50.898 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:05:00, at 2025-01-14 08:32:50.898521+00:00 2025-01-14 09:32:50.899 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 09:32:53.056 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 09:32:53.058 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:04:40.430284, at 2025-01-14 08:37:33.489107+00:00 2025-01-14 09:37:33.490 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 09:37:35.637 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 09:37:35.639 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:04:57.663820, at 2025-01-14 08:42:33.303092+00:00 2025-01-14 09:42:33.304 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 09:42:35.469 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 09:42:35.471 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:04:57.917801, at 2025-01-14 08:47:33.389076+00:00 2025-01-14 09:47:33.392 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Fetching data for serial: XX 2025-01-14 09:47:35.565 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetailList for energy_today 2025-01-14 09:47:35.566 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:04:57.843144, at 2025-01-14 08:52:33.409851+00:00

J3G0 avatar Jan 14 '25 14:01 J3G0

Update from my side.

I looked at the problem from a mathematical side. Solis cloud gives you an update of the actual power delivered every 5 minutes. The solis power today entity has the glitch but the current power is accurate.

So instead of giving the energy integration the solis power today entity I decided to provide it with an integral that sums the actual power generated to have an overview of the kWh that were delivered.

This has a couple benefits, the glitch where yesterday's power is counted at the initialisation of the inverter is not carried over. Secondly since we use the actual power, even low amounts of power are also counted. Where normally you don't see any graph updates if there is less than 0.1 kWh generated.

I'm my case I used 3 decimal precision. Now I get kWh numbers with a precision of 0.005 kWh. So far the accuracy seems to hold up.

How?

  • Riemann integral with Solis AC output as input. This then provides a kWh metric (left oriented integral, this underestimates a bit but better than over estimating.)
  • Secondly you need the utility helper to make it a daily counter.

This utility helper you then add as the solar production in the energy dashboard.

It's not a fix but a containment that has some advantages, at least in precision.

See also the screens below 👇 Hope this helps people facing the same problem 🤗

Image Image Image Image

J3G0 avatar Jan 25 '25 11:01 J3G0

Thanks, how does this work when HA is restarted during the day? The integration is stateless, so would lose all history for the part of the day before getting back online. Or does the riemann integration jst continue where it left (but then still you could have a gap if the system was down for a longer time)?

hultenvp avatar Feb 08 '25 15:02 hultenvp

Thanks, how does this work when HA is restarted during the day? The integration is stateless, so would lose all history for the part of the day before getting back online. Or does the riemann integration jst continue where it left (but then still you could have a gap if the system was down for a longer time)?

I assume that it stops counting your production as it uses the 5 minuten intervals of the actual power production in W to count the kWh. So it would cause a zero production during the off time. As soon as it is back online it resumes counting. It doesn't reset to zero.

But having restarted often throughout the last week's to do updates I've found it to be more reliable than the actual kWh solis information.

Why? Well the solis integration only gives you 0.1 kWh intervals for the day and only full kWh for the month. As an example I have also made a month counter to count the production per month. So the solis on day basis alway has +-0.1 kW deviation. The monthly production always has a +- 1 kWh deviation.

Image Image

Todays overview;

Image

The prediction function also is very close to actual production.

Off course, this is an interpolation running on 5 minute data intervals. But it seems that is accurate enough on 5 minute intervals. The Riemann approximation is always within the deviation of the solis anyway. That at least gives me enough confidence to use this method. And I like that you get a smooth graph compared to the blocky 0.1 kWh updates from solis.

I tried contacting solis to increase the data push to 1 minute, they told me they could not provide this anymore due to server limitations. That would have made it more accurate.

J3G0 avatar Feb 08 '25 16:02 J3G0

Today overview solis;

Image

Today overview Riemann ;

Image

J3G0 avatar Feb 08 '25 16:02 J3G0