Harmony Hub reported as offline?

I guess (!) after the remotes are discontinued since years and Logitech is starting to drop support, nobody is willing to invest in a dead horse :sob:

I’m sorry its not working for you, but the binding is not broken for everyone and is still actively used and maintained, i have 5 hubs and its been working fine at least for me (except if i radically change my network, then i need to restart some of the hubs themselves). There have been no changes to binding in a while, but then again there have been no changes to the logitech eco system either for obvious reasons.

DEBUG or TRACE logs would be helpful. I would pause the Hub thing then unpause it so the logs clearly show whats failing when connecting. For even more logs, i would also turn on TRACE logging for com.digitaldan.harmony , so in the openHAB cli that command would be

log:set TRACE com.digitaldan.harmony

This is a fresh restart log. Will report back when it fails in a few hours.

logfile.txt (56.9 KB)

Now it goes offline after a disabling the hub and re-enabling.

logfile2.txt (51.1 KB)

The issue from the logs in the second log file is that we get a websocket disconnect error “1006” almost immediately after talking to the hub. The error code 1006 means the underlying network connection was closed abruptly, which almost always indicates a poor network connection somewhere along the path. It could also be the hub itself is having issues, but thats hard to know for sure. I can take a look at our retry policy and see if we can be more aggressive about reconnecting, i don’t remember what it looks like at the moment as its been a while since i worked on it.

I don’t believe it is a network issue, as of right now the Hub is connected with a -64dBm signal. Also the official app dose not have any issues communicating and controlling the hub so I don’t think it is a network issue. Also overnight the binding has got to the point where it will no longer reconnect after a disable and re-enable.

Can you also enable TRACE logging for the binding, so log:set TRACE org.openhab.binding.harmonyhub , also can you give more of the logs? The binding should try and connect after 60 seconds so i need at least 2 mins of the logs after a disconnect, but looking at the code i can see a possible issue where it will stop trying to reconnect if it gets that disconnect error earlier in the handshake process, so thats a bug.

As far as root cause, i don’t know what to tell you, there are a ton of reasons why the underlying TCP stack can be flakey, its not always related to signal strengh, it could be the host openHAB is running, or CPU/IO contention. It could also be something strange with the Hub too, but i don’t know how to trouble shoot that from the message in the logs which look ok.

The error is far below the Java code in the binding, so unless there’s something with the interaction (like its going offline after a command or something we are sending to the hub) that causes the hub to abruptly close the connection, its probably not something i’ll be able to fix. If you can identify a pattern of when it disconnects, that might give a hint (like after a command). The best i can do right now is make sure it reconnects, and speed up that process.

Here is a log showing me disable, then re-enable the Hub. It then go’s online for 40 seconds or so then go offline again.

logfile3.txt (52.9 KB)

Did you see my message above? About turning on logging for the binding, and then getting a couple of mins of logs after it disconnects? I think there is an issue with the reconnect logic there.

Yeah I just checked. Only typed log:set TRACE org.openhab.binding.harmony not log:set TRACE org.openhab.binding.harmonyhub

Give me a bit to re-run it. Sorry.

Here is the log with the settings logging mode where you wanted it. Sorry again.

logfile4.txt (93.8 KB)