openhab / openhab-cloud

Cloud companion for openHAB instances
Eclipse Public License 2.0
313 stars 161 forks source link

Reconnecting to cloud #465

Closed iPavel89-work closed 1 month ago

iPavel89-work commented 1 month ago

Hello. I updated openhabcloud server and now if I restart cloud service sometimes i have error Error connecting to the openHAB Cloud instance: already connected

and i can solve problem only if restart openhab service in client. How can I solve problem? Also sometimes if I have same problem when openhab client lost internet connection

digitaldan commented 1 month ago

This is an issue with the cloud server code https://github.com/openhab/openhab-cloud, not the binding. When the server shuts down it does not gracefully disconnect sessions, we keep a 2 min keep alive lock, if we don't get a heart beat from the client in 2 mins, then redis releases the lock. So the client should connect after 2 mins. Its something i have been thinking about trying to fix as its a minor inconvenience when we deploy new versions of the code and have to restart.

iPavel89-work commented 2 weeks ago

I made script. Script send request to cloud. if response is "Openhab offline" script restart openhabcloud connector