home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.67k stars 30.43k forks source link

Consistent Drops In Harmony Hub Connectivity #38936

Closed wormuths closed 3 years ago

wormuths commented 4 years ago

The problem

Since upgrading to Home Assistant Core 113.0, my Harmony Hub is constantly changing its state to unavailable, then back to on or off. It does this consistently, and floods the logbook all day. The history tab also shows it continuously dropping to unavailable, even though the Hub is functioning perfectly.

Environment

Currently running HA Core v114.1 on a FreeNAS (FreeBSD) jail environment.

Problem-relevant configuration.yaml

Not using YAML, configured via UI.

Traceback/Error logs

Logger: aioharmony.hubconnector_websocket Source: deps/lib/python3.7/site-packages/aioharmony/hubconnector_websocket.py:156 First occurred: August 15, 2020, 10:56:25 PM (233 occurrences) Last logged: 3:05:19 AM



## Additional information
![harmony](https://user-images.githubusercontent.com/47436307/90336207-31217f00-dfa8-11ea-8302-c6bddcfcdb41.png)
pergolafabio commented 4 years ago

are you using websockets or xmpp ?

probot-home-assistant[bot] commented 4 years ago

harmony documentation harmony source (message by IssueLinks)

probot-home-assistant[bot] commented 4 years ago

Hey there @ehendrix23, @bramkragten, @bdraco, mind taking a look at this issue as its been labeled with an integration (harmony) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

McGiverGim commented 4 years ago

I'm not too sure if this is related. My Harmony hub seems to be working ok, but I see several messages like this in the log:

2020-08-17 09:31:11 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.100.4: Connection timed out for hub XXXXXXXX
jonathanbower commented 4 years ago

are you using websockets or xmpp ?

I'm using websockets.

jonathanbower commented 4 years ago

Could be related https://www.reddit.com/r/homeassistant/comments/iapiz5/philips_android_tv_spamming_hassio_logs_anybody/

ehendrix23 commented 4 years ago

How do you run Home Assistant, what platform? Do you use HASS.IO? Based also on the reddit it seems something else might have been broken related to network connectivity somewhere and Harmony integration is another victim of this.

jonathanbower commented 4 years ago

I use Hass Core in docker. I've now switched over to XMPP it it seems to be working fine.

McGiverGim commented 4 years ago

In my case is Hass.io. How do you switch to XMPP? Only enabling it in the phone app or do I need to change something in the Home Assistant integration?

pergolafabio commented 4 years ago

Only in app on your phone

wormuths commented 4 years ago

I too seem to have web sockets. I’ve seen XMPP mentioned before, but have never seen that setting in the iOS app to change it...

jonathanbower commented 4 years ago

On Android it can be found under Harmony Setup -> Add/Edit Devices & Activities -> Remote & HUB -> Enable XMPP

wormuths commented 4 years ago

Thanks! Same on iOS.

I got lots of warnings about how dangerously insecure it was though.

github-actions[bot] commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

sagitt commented 3 years ago

i have this problems with with 0.118 Every startup i see these logs:

Logger: slixmpp.stringprep Source: /usr/local/lib/python3.8/site-packages/slixmpp/stringprep.py:120 First occurred: 2:40:32 (1 occurrences) Last logged: 2:40:32

Using slower stringprep, consider compiling the faster cython/libidn one.


Logger: slixmpp.basexmpp Source: /usr/local/lib/python3.8/site-packages/slixmpp/basexmpp.py:210 First occurred: 2:40:34 (3 occurrences) Last logged: 2:40:34

Legacy XMPP 0.9 protocol detected.

bdraco commented 3 years ago

Disable XMPP on the device. Websockets don't suffer from the same issues.

sagitt commented 3 years ago

Disable XMPP on the device. Websockets don't suffer from the same issues.

Thanks I enabled it since requested in the integration months ago.. so i think now is not requested.

ehendrix23 commented 3 years ago

FYI,

The integration defaults to XMPP if XMPP is enabled on the hub, otherwise it will default back to Web Sockets. Why XMPP if enabled?

  1. It has to be enabled specifically by the user on the hub hence idea here is if enabled on the Hub then clearly that is what user would prefer, otherwise why have it enabled?
  2. Logitech has stated they will leave XMPP as is and open for any other integrations be able to work. The same was not stated for Web Sockets hence any future firmware update on the hub might break web sockets. Note that this came after LogiTech has stopped XMPP resulting in bit of an uproar (for example see: https://www.theverge.com/circuitbreaker/2018/12/20/18150011/logitech-harmony-hub-remote-setup-security-update-broken-third-party-local-api or google Logitech and XMPP). This happened in December 2018.
  3. Why support both? Certain users have reported issues with Web Sockets (dropping connections) and others with XMPP. Hence both are being supported.
  4. Why do connections sometimes drop? This is a Hub or networking issue. Other's have reported issues with the hub dropping from the network for a few seconds especially with Mesh networking (for example see: https://community.netgear.com/t5/Orbi/Harmony-Hub-Issues/td-p/1613601) or do some more Googling related to Harmony and mesh networking.
  5. Can I choose between XMPP and Web Sockets? The aioharmony integration itself allows to select XMPP or Web Sockets when called. Home Assistant configuration does currently not have this option integrated.

Note, here I have 2 Hub's running with 1 using XMPP and the other one using Web Sockets. I do not have an issue where it regularly drops off from the network (I currently also do not have Mesh). Anytime you see your hub flashing red or showing a red light it means it dropped it's network connection. When this happens the integration looses is connection and next time needs to re-establish it.

Hope this helps in explaining a bit.

scyto commented 3 years ago

Thanks, I disabled XMPP on the only 1 of 4 hubs that had it enabled and the "Using slower stringprep, consider compiling the faster cython/libidn one." message no longer occurs. I am not seeing the consistent drops the OP sees. I am unclear if the op has the original problem, if not i guess this issue came be closed. @wormuths ?

wormuths commented 3 years ago

I have since changed to a Raspberry Pi platform due to all the complications of running in a jail. I haven’t had any issues with the harmony since. Not able to comment on my original configuration anymore, but I’d say it’s ironed out.

Thanks for all the hard work! Steve