Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimal "minimum time between entity updates" #100

Open
ianfretwell opened this issue Feb 16, 2022 · 29 comments
Open

Optimal "minimum time between entity updates" #100

ianfretwell opened this issue Feb 16, 2022 · 29 comments
Labels
no-stale This issue or PR is exempted from the stable bot.

Comments

@ianfretwell
Copy link

Hi - not an issue as such, more a request for assistance.

Is there an optimal setting for the "minimum time between entity updates" in the Configure settings ?

I have tried 4 and 5 minutes and on either I see the following type of results - notice the frequent inability to get any results. The wifi doesn't seem to be dropping to the inverter so I just thought there might be a 'better' value to be using for more consistent results.

image

Thanks.

@robbinjanssen
Copy link
Owner

Hi @ianfretwell,

Can you tell us a bit more about your setup? Like what inverter do you use?

Although you don't say that the wifi drops, it seems like a connection issue. Maybe add a binary_sensor and ping your inverter for a while? See if the connection drops?

Add this to your configuration.yaml

binary_sensor:
  - platform: ping
    host: x.x.x.x
    name: "My Inverter"
    count: 2
    scan_interval: 60

@ianfretwell
Copy link
Author

@robbinjanssen Thanks - I'll give that a go and see what it shows up...

@HartmutHartmann
Copy link

Hi,
just wanted to add that I had a similar experience since installing the integration on sunday. I've also had a ping sensor(checking every 5min) with clear times when the inverter was asleep.
mi600production
mi600ping

@ianfretwell
Copy link
Author

Apologies @robbinjanssen - I completely ignored part of your original response, here are the details -

Inverter - Omniksol-4k-TL

@HartmutHartmann Thanks for posting at least it shows I'm not alone.

@Step-han
Copy link

Hello!

I have the same problem. Previously I used Hein Oldenhuis's HA integration (https://github.com/heinoldenhuis/home_assistant_omnik_solar).

That integration updates neatly every 60 seconds, this cannot be shorter with that integration.

I now use this integration as Hein's integration no longer gets updates.

However, it now updates completely randomly and not stable. Not every 60 seconds, even when I set it. By default it was 4 minutes for me.

The WiFi connection is stable, there is an access point less than 5 meters from the 3 inverters.

I'm using: omnik1000tl, omnik2000tl and an omnik2500tl2.

Any idea what's going wrong?

Stephan

@MarijnS95
Copy link
Collaborator

MarijnS95 commented Feb 19, 2022

@Step-han Hein's integration uses a TCP connection, which is probably more stable and also provides more statistics while at it. I've liked this integration more with a config flow and all sensor entities bundled under a device, and now that Hein's plugin is deprecated I'm working on porting TCP connection support to python-omnikinverter and this integration, stay tuned!

@klaasnicolaas
Copy link
Collaborator

Which version of the integration are you using? Since the last version we have abandoned the reuse of session, which could result in inverters no longer blocking a connection.

As for the interval time, it is set to 4 minutes by default because the inverter in their web interface often only updates once every 5 minutes.

@ianfretwell
Copy link
Author

In my case the version is v2.3.0.

@MarijnS95
Copy link
Collaborator

@klaasnicolaas It seems that python-omnikinverter does a separate network request for the "device" and "inverter" information, even if both network requests are the same. If this HASS plugin consumes both bits of information it may hit a rate limit (if there is one) twice as quickly?

@klaasnicolaas
Copy link
Collaborator

This only happens if you don't pass a session otherwise it will reuse the old session to make another request. As far as we know there is no rate limit and I have never run into it during testing (which is stress testing) so I don't expect this to be the problem either.

We have just removed the session because certain inverters do not like it when you reuse a session. You could always use wireshark to see what is happening with requests in your network.

@MarijnS95
Copy link
Collaborator

MarijnS95 commented Feb 21, 2022

Keeping the session/connection alive is one thing, resending an identical request for the same data (which likely also happens to be identical) - while not the end of the world (and probably not the source for this issue either) - just seems rather wasteful:

SERVICE_INVERTER: await self.omnikinverter.inverter(),
SERVICE_DEVICE: await self.omnikinverter.device(),

@klaasnicolaas
Copy link
Collaborator

We might merge that in the future, but let's save that for another issue 😉

@Step-han
Copy link

In my case also v2.3.0.

I ran this version and Hein's version side by side for a while and Hein's always updates every 60 seconds and never misses a pull. This integration misses alot of pulls when configured with 1 minute interval, sometimes no data for more then 15 minutes.

For now I'll stick with Hein's as long as it continues to work with HomeAssistant

@robbinjanssen
Copy link
Owner

Does this also occur with a previous version? v2.2.0?
v2.3.0 introduced some changes into handling sessions as klaas mentioned, maybe this has something to do with the "broken" graph

@robbinjanssen
Copy link
Owner

@HartmutHartmann @ianfretwell @Step-han you could try using the TCP backend now, just reinstall the configuration and select TCP :-)

@ianfretwell
Copy link
Author

Thanks - I'd already uploaded to the new version and seen all the new sensors - none of which worked for me even after enabling them.

I've now reconfigured with TCP and they are now working, but I've lost two that worked previously (IP address & Signal Quality).

Is that just because of differences in what my inverter is returning depending on whether it's setup for JS or TCP?

@MarijnS95
Copy link
Collaborator

#110

Note that device information (firmware, IP address and WiFi signal strength) is unavailable through this API.

This is something that we might want to add later, by querying the device over both JS and TCP. That should also allow the Serial Number setup to be automated by first doing a JS request and parsing the number from it.

However, in my testing the Serial Number seemed to be sort-of irrelevant. The inverter still replies with data even if it's "wrong" (e.g. just set it to 0). If you can, please test with a serial number of 0 and notice if there are any timeouts (@robbinjanssen found that his inverter seemed slower to respond, and my initial testing did show signs of that as well).

In the end we'll probably rework this after turning the TCP backend into local_push instead of local_polling; but that requires some refactoring on both the python package and its usage here.

@ianfretwell
Copy link
Author

Just an update then - after two days of using TCP rather than JS - the gaps in reporting remain pretty much the same - no better, no worse.

@MarijnS95
Copy link
Collaborator

@ianfretwell As far as I've understood the code these requests for updates are driven by home assistant itself (local_polling) which may be affecting this odd poll rate somehow. If I make some progress on a little redesign to make pushing possible over the TCP backend I'll let you know for testing purposes :)

@ianfretwell
Copy link
Author

ianfretwell commented Jun 9, 2022

Out of interest - today the integration hasn't managed to connect even the once successfully.

Yet at the same time I use this project

https://github.com/jbouwh/omnikdatalogger

in a dedicated docker instance, also configured to use a TCP connection, and it's been absolutely fine all day. I've been using them alongside each other all along. So if one works and the other doesn't surely they're making their connections differently somehow ?

@Step-han
Copy link

Still using Hein Oldenhuis's HA integration, its not broken (yet).

Anyone tested this intergration with a omnik inverter? How is the update frequency? And is it stable now?

If nobody tested it I can test it in the future..

@ianfretwell
Copy link
Author

ianfretwell commented Dec 13, 2022

For me it's no better or worse than it was when I originally posted back in February.

@robbinjanssen
Copy link
Owner

robbinjanssen commented Dec 15, 2022

I haven't had any drops, but the code hasn't been updated in a while so probably nothing has changed. Im not sure how we can approach/debug this..

Personally im using the JS source and I don't think my inverter actually powers down at night.

1-15 dec:
Screenshot 2022-12-15 at 12 18 20

14 dec:
Screenshot 2022-12-15 at 12 18 46

@klaasnicolaas
Copy link
Collaborator

it would be interesting to find out how it is possible that an inverter can sometimes not be reached during the day 🤔

@Step-han
Copy link

@robbinjanssen

What is the interval from the data?

Hein's intergration every 60s a data record:
image

@klaasnicolaas
Copy link
Collaborator

Default is every 4 minutes, but you can adjust it in the options flow to at least 1 minute.

@github-actions
Copy link

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

@github-actions github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Mar 16, 2023
@robbinjanssen robbinjanssen added no-stale This issue or PR is exempted from the stable bot. and removed stale There has not been activity on this issue or PR for quite some time. labels Mar 16, 2023
@Maarten69
Copy link

You could try my integration, I continued the work of hultenvp and heinoldenhuis.
It updates every 10 seconds.
Link: https://github.com/Maarten69/home_assistant_omnik_solar

@Step-han
Copy link

Step-han commented Jan 10, 2025

Every 10 sec? Thats nice!

I'm now using @robbinjanssen intergration with de TCP mode, now it updates every 60 seconds, can't get it faster then that.

This is today, with 4 omnik inverters:
image

@Maarten69: I'll check youre intergration soon, will compare with the intergration of @robbinjanssen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-stale This issue or PR is exempted from the stable bot.
Projects
None yet
Development

No branches or pull requests

7 participants