seaside1 / unifiprotect

openHAB UniFi Protect Addon
Eclipse Public License 2.0
22 stars 6 forks source link

Handle nvr disconnects #3

Closed kvannotten closed 1 year ago

kvannotten commented 3 years ago

First of all: thank you so much for making this!!!

My issue: When the nvr disconnects, the items no longer update appropriately. For example: nvr gets updated, disconnects from network due to reboot. Now all motion events or image captures are no longer updated.

Hardware: running in a VM

OpenHAB Version: OpenHAB 3.0

UnifiProtect version: 1.17.3

Tested on the latest version of your software

seaside1 commented 3 years ago

Hi! Thanks for reporting this. It should be easy to reproduce. I've made changes to the event listener in the last version for reconnection, but ill take a look again.

Regards s

seaside1 commented 3 years ago

This should be fixed in alpha10, please reopen if it is not working for you.

ThaDaVos commented 2 years ago

I may be running into the same issue - we have a Unifi Protect Doorbell and after working for days it just suddenly stopped working today, probably due the same reasons - after disabling and re-enabling the NVR's binding it works again

seaside1 commented 2 years ago

Can you reproduce this? Please use the latest release and see if you can reproduce, if that is the case I might be able to fix it. My doorbell seems quite stable with the latest beta firmware and latest binding-release.

ThaDaVos commented 2 years ago

I'll try and do my best - I'll have to wait for the scenario to occur again

ThaDaVos commented 2 years ago

I am running the latest version and sadly the disconnects still happen - btw, it's not only the doorbell, it's the whole Unifi Protect system - seems like the websocket or something get disconnected and the events are no longer received - even though the Thing still shows as online - disabling the NVR Thing and enabling it again seems to fix it - sadly haven't found a way to trigger this from a Rule so I can trigger it every night at a certain time

seaside1 commented 2 years ago

I don't see disconnects. But I see missed events from time to time. I will see what I can do about disconnects, If it is possible to see if the connection is alive and otherwise reinitialize it.

ThaDaVos commented 2 years ago

Thank you! - I call them disconnects as when it happens, I see no events in the logs anymore, but after disabling and re-enabling the NVR thing I see them in the logs again

seaside1 commented 1 year ago

I have added a watch dog that will restart the binding after 15 minutes if no events are recieved https://github.com/seaside1/unifiprotect/commit/0cfe15a786743c453746e74f7ce8191440bd3ac8 I'll build a pre release if you could help me and test.

seaside1 commented 1 year ago

https://github.com/seaside1/unifiprotect/releases/tag/unifiprotect-4.x.x-BETA12

seaside1 commented 1 year ago

Fixed in v1.0, reopen if the issue persists.