openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.88k stars 3.59k forks source link

[omnikinverter] Disconnect after retrieve #10123

Closed drksavant closed 3 weeks ago

drksavant commented 3 years ago

Hi there, Great work on adding this into openhab. Issue im facing is, I am also retrieving the data on a little rasbian node and feeding it to the database. The Rasbian node connects every 10 minutes, polls the data and disconnects, This Connection Seems to be persistent or polling to hard, Whenever I start this connection I cannot pull data from my other devices, could you add a variable for polling interval and disconnect (after data has been retrieved ?)

thanks

hansbogert commented 3 years ago

Hi, I'm the writer of the binding. I'll put it on my todo list. I'd like to reproduce this first. Can you tell me the exact model of your inverter, and the first 3 digits of your serial?

drksavant commented 3 years ago

Sweet i almost gave up on the thing ive reinstalled a new version of openhab and could not find the binding at all.

Info id nlbn4020155b2048

The issue mainly is that openhab connects and does not let go whereas the python script connects and resets the port by disconnecting. Inuse both and once the port is open nothing else can interface

Sonbasiy it is awesome stuff

Sonthe worst part is that its no longer in addons for openhab2

On Sun, 1 Aug 2021 at 13:58, Hans van den Bogert @.***> wrote:

Hi, I'm the writer of the binding. I'll put it on my todo list. I'd like to reproduce this first. Can you tell me the exact model of your inverter, and the first 3 digits of your serial?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/openhab/openhab-addons/issues/10123#issuecomment-890506385, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKHAJ26O2CC6ZKXOGUQES2LT2UZGNANCNFSM4XN5MDVA .

drksavant commented 3 years ago

Aan je naam te zien kunnen we ook in nederlands af 👌

On Sun, 1 Aug 2021 at 17:16, Dark Savant @.***> wrote:

Sweet i almost gave up on the thing ive reinstalled a new version of openhab and could not find the binding at all.

Info id nlbn4020155b2048

The issue mainly is that openhab connects and does not let go whereas the python script connects and resets the port by disconnecting. Inuse both and once the port is open nothing else can interface

Sonbasiy it is awesome stuff

Sonthe worst part is that its no longer in addons for openhab2

On Sun, 1 Aug 2021 at 13:58, Hans van den Bogert @.***> wrote:

Hi, I'm the writer of the binding. I'll put it on my todo list. I'd like to reproduce this first. Can you tell me the exact model of your inverter, and the first 3 digits of your serial?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/openhab/openhab-addons/issues/10123#issuecomment-890506385, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKHAJ26O2CC6ZKXOGUQES2LT2UZGNANCNFSM4XN5MDVA .

hansbogert commented 3 years ago

Let's keep it in english for the benefit of others.

openhab and could not find the binding at all.

This worries me, this is the 2nd time I'm hearing this. Which version of OpenHAB are you running?

hansbogert commented 3 years ago

The issue mainly is that openhab connects and does not let go whereas the

How did you conclude this? The socket is closed, as per the 'try-with-resources' construct in java, in the implementation here

drksavant commented 3 years ago

I concluded this because when my bindings whwre connected in the old openhab i could not connect withy the puthon script. After removing it it was reenablee

On Sun, 1 Aug 2021 at 22:48, Hans van den Bogert @.***> wrote:

The issue mainly is that openhab connects and does not let go whereas the How did you conclude this? The socket is closed, as per the 'try-with-resources' construct in java, in the implementation at: https://github.com/openhab/openhab-addons/blame/main/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverter.java#L46

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/openhab/openhab-addons/issues/10123#issuecomment-890584306, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKHAJ22ROGL7256BKBO3HGTT2WXKXANCNFSM4XN5MDVA .

hansbogert commented 3 years ago

If you can provide the python script I should be able to reproduce this fairly quickly (right?)

drksavant commented 3 years ago

Sure , its the default python script that everybody uses but ill download it and attach it. Sorry for my slowness planning the holiday

On Thu, 5 Aug 2021 at 08:56, Hans van den Bogert @.***> wrote:

If you can provide the python script I should be able to reproduce this fairly quickly (right?)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/openhab/openhab-addons/issues/10123#issuecomment-893214429, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKHAJ2ZUXIT3XWAFEGE5YEDT3IY3PANCNFSM4XN5MDVA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

hansbogert commented 3 years ago

Not sure if you intended to have attached it with your email, but it's not showing here in Github.

hk0017 commented 3 years ago

Hi Hans, I have the same issue with an omnik5000tl2. It looks like the Wifi-module is overwhelmed with request from the binding, so that it didn't responded anymore to another host or sended info to the website from Omnik. After resetting the Omnik-module (power off/On) it got back, but I didn't dare to use the binding anymore. So, is it possible for you to add a timer for how often the binding requests for info? I want, for exemple, get info every 5 minutes.

hk0017 commented 3 years ago

@hansbogert see comment above. Forgot to select your name.

hansbogert commented 3 years ago

so that it didn't responded anymore to another host

What did you use to conclude that? Because I never got a script to reproduce this from @drksavant

I really like to reproduce this first, as I doubt this is merely a "too small interval" issue.

hk0017 commented 3 years ago

I concluded it because the collection of the data, by a Raspberry Pi with the scripts of Wouterrr, stocked and also the website of Omnik didn't received no more data. And in the log of OH2.5 I saw a lot of requests per second. But it is more than a year ago I faced that, so no more logfiles. If you want, I will test it again with OH3.1. Using the binding instead of the Pi with the Wouterrr-scripts (producing csv-files) is much better I hope.

hansbogert commented 3 years ago

OH2.5 I saw a lot of requests per second.

There was an oversight on my part that in some cases caused multiple threads to start polling. That should've been fixed by someone else. Could you indeed test with the latest version?

hk0017 commented 3 years ago

OK. I started some items. I'll let it go for some days.

Looks like every 10,5 seconds there is a change in power logged (when there is a change). So that's a lot more than the poll every 300 seconds with the Wouterrr-scripts that I configured. Is the binding polling the inverter continuously or every 10 seconds?

hansbogert commented 3 years ago

~10s seems correct.

It's polling every 10s. It's UDP iirc, so there's no concept of continuously with UDP. (i might be wrong there.)

hk0017 commented 3 years ago

So it works as designed :-)

My Wouterr-script is still working, but the Omnik-site (solarmanpv,com) is not getting information after 11:00 CET. And the webpage on the inverter says: Last updated 66 Min Ago (at 12:06 CET)

I don't know how bindings are made - so it's marvelous what you made ! - , but is there a possibility to add a polling frequentie? Just like for example in the network binding where you can define in the things file the 'refreshInterval'. This helps also to minimize the entries in Influxdb.

hk0017 commented 3 years ago

got an error also:

2021-11-02 12:02:55.351 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'omnikinverter:omnik:omnik5000tl2' changed from ONLINE to OFFLINE: Unknown error: Read timed out

2021-11-02 12:03:08.454 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'omnikinverter:omnik:omnik5000tl2' changed from OFFLINE: Unknown error: Read timed out to ONLINE

Pauzed the binding and inverter is pushing info again to website now.

hansbogert commented 3 years ago

My Wouterr-script is still working

So both the omnikinverter binding and the Wouterr-script are working at that point?

And the webpage on the inverter says: Last updated 66 Min Ago (at 12:06 CET)

You really mean on the 'local' webserver of the inverter? or the cloud environment of omnik?

If it's the former, can you add a screenshot so, because this might be a good way to see if I can reproduce this.

Otherwise I'll just try to run the Wouterr-script as well.

hansbogert commented 3 years ago

2021-11-02 12:02:55.351 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'omnikinverter:omnik:omnik5000tl2' changed from ONLINE to OFFLINE: Unknown error: Read timed out

2021-11-02 12:03:08.454 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'omnikinverter:omnik:omnik5000tl2' changed from OFFLINE: Unknown error: Read timed out to ONLINE

After these errors, do you now see more than 1 request per 10 seconds?

hk0017 commented 3 years ago

Omnik-20211102-15h27m I've restarted the binding at 12:49. At 15:27 the inverter says 63 minutes not sended updates. Apparently the inverter manages to send an update very occasionally. See also the graph on the Solarman-site: Solarman-graph-20211102-16h20m

The binding is still polling every 10 seconds after the errors. And the Wouterrr-script is receiving data every 300 seconds without drops. This looks fine. The Wifi-module in the inverter is not crashed up till now.

hk0017 commented 3 years ago

I Think my inverter crashed at 20:15. Wouterscript gives a: File "/home/pi/Omnik-Data-Logger/OmnikExport.py", line 73, in run data = inverter_socket.recv(1024) socket.timeout: timed out

The OH3.1 gives OFFLINE But the webpage on the inverter is working (gives "Last updated 140 Min Ago" at 22:53) and the inverter is pingable on his IP-adddress.

hk0017 commented 3 years ago

after pauzing the binding, the polling by script and pushing data to Omnik-site came back.

hansbogert commented 1 year ago

@hk0017 sorry for not picking this up, would you still like a config parameter in the binding which sets the timeout duration?