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

Logitech Harmony integration stopped working #57542

Closed rjkruit closed 3 years ago

rjkruit commented 3 years ago

The problem

Upgraded core and OS to the latest versions and now the harmony entities are unavailable. It turns out that home assistant can't connect to the XMPP server on the harmony hub. Connecting to the XMPP port 5222 with telnet from another host confirms the service is up and running. It may also have to do with the OS version as that was also updated. Perhaps some firewall rule?

supervisor-2021.10.0 core-2021.10.4 Home Assistant OS 6.5

What is version of Home Assistant Core has the issue?

core-2021.10.4

What was the last working version of Home Assistant Core?

core-2021.10.2

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Logitech Harmony

Link to integration documentation on our website

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2021-10-12 13:08:23 ERROR (MainThread) [aioharmony.harmonyclient] 172.16.5.100: Unable to determine if XMPP is enabled: [Errno 113] Connect call failed ('172.16.5.100', 5222)
2021-10-12 13:08:23 WARNING (MainThread) [homeassistant.components.harmony.data] LivingRoomRemote: Unable to connect to HUB
2021-10-12 13:08:23 WARNING (MainThread) [homeassistant.config_entries] Config entry 'LivingRoomRemote' for harmony integration not ready yet: None; Retrying in background
2021-10-12 13:08:25 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Air Purifier Woonkamer' for xiaomi_miio integration not ready yet: Unable to discover the device 172.16.5.102; Retrying in background
2021-10-12 13:08:34 ERROR (MainThread) [aioharmony.harmonyclient] 172.16.5.100: Unable to determine if XMPP is enabled: [Errno 113] Connect call failed ('172.16.5.100', 5222)
2021-10-12 13:08:34 WARNING (MainThread) [homeassistant.components.harmony.data] LivingRoomRemote: Unable to connect to HUB
2021-10-12 13:08:47 ERROR (MainThread) [aioharmony.harmonyclient] 172.16.5.100: Unable to determine if XMPP is enabled: [Errno 113] Connect call failed ('172.16.5.100', 5222)
2021-10-12 13:08:47 WARNING (MainThread) [homeassistant.components.harmony.data] LivingRoomRemote: Unable to connect to HUB
2021-10-12 13:09:10 ERROR (MainThread) [aioharmony.harmonyclient] 172.16.5.100: Unable to determine if XMPP is enabled: [Errno 113] Connect call failed ('172.16.5.100', 5222)
2021-10-12 13:09:10 WARNING (MainThread) [homeassistant.components.harmony.data] LivingRoomRemote: Unable to connect to HUB
2021-10-12 13:09:17 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities switch.livingroomremote_cctv, switch.livingroomremote_kodi, switch.livingroomremote_nintendo_switch, switch.livingroomremote_phono, switch.livingroomremote_ps5, switch.livingroomremote_tube_amp, switch.livingroomremote_watch_apple_tv, switch.livingroomremote_watch_tv_srnd, switch.livingroomremote_x_box_one
2021-10-12 13:09:53 ERROR (MainThread) [aioharmony.harmonyclient] 172.16.5.100: Unable to determine if XMPP is enabled: [Errno 113] Connect call failed ('172.16.5.100', 5222)
2021-10-12 13:09:53 WARNING (MainThread) [homeassistant.components.harmony.data] LivingRoomRemote: Unable to connect to HUB
2021-10-12 13:11:16 ERROR (MainThread) [aioharmony.harmonyclient] 172.16.5.100: Unable to determine if XMPP is enabled: [Errno 113] Connect call failed ('172.16.5.100', 5222)
2021-10-12 13:11:16 WARNING (MainThread) [homeassistant.components.harmony.data] LivingRoomRemote: Unable to connect to HUB
2021-10-12 13:12:40 ERROR (MainThread) [aioharmony.harmonyclient] 172.16.5.100: Unable to determine if XMPP is enabled: [Errno 113] Connect call failed ('172.16.5.100', 5222)
2021-10-12 13:12:40 WARNING (MainThread) [homeassistant.components.harmony.data] LivingRoomRemote: Unable to connect to HUB
2021-10-12 13:14:03 ERROR (MainThread) [aioharmony.harmonyclient] 172.16.5.100: Unable to determine if XMPP is enabled: [Errno 113] Connect call failed ('172.16.5.100', 5222)
2021-10-12 13:14:03 WARNING (MainThread) [homeassistant.components.harmony.data] LivingRoomRemote: Unable to connect to HUB
2021-10-12 13:15:23 WARNING (MainThread) [slixmpp.stringprep] Using slower stringprep, consider compiling the faster cython/libidn one.
2021-10-12 13:15:24 WARNING (MainThread) [slixmpp.basexmpp] Legacy XMPP 0.9 protocol detected.
2021-10-12 13:15:54 ERROR (MainThread) [aioharmony.harmonyclient] LivingRoomRemote: Second Timeout trying to retrieve current activity.

Additional information

No response

hdurdle commented 3 years ago

Just to note that I've just upgrade to the same versions, and don't see this error. My two Harmony Hubs are both responding as expected. This a VM running under Hyper-V.

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

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


harmony documentation harmony source (message by IssueLinks)

bdraco commented 3 years ago

I've seen some instability on recent versions as well. I think it's actually related to discovery happening more frequently. It seems to overwhelm the devices.

bdraco commented 3 years ago

Currently we fetch the device ID/unique ID When the Devices discovered so we can tell if it's already been set up and abort.

Unfortunately it doesn't look like there's a way with aioharmony to just fetch the id without connecting the websocket so we end up overloading the device

bdraco commented 3 years ago

Can you try this patch? https://github.com/home-assistant/core/pull/57589

rjkruit commented 3 years ago

Can you try this patch? #57589

I just noticed that it started to work again overnight as this morning it was suddenly present again. The problem started after updating the core several times and then the OS again as I was some versions behind. You might be right that the hub was overloaded. However, unplugging it and plugging it back in had no effect.

apmillen commented 3 years ago

I'm having the same problem. When it wasn't working I removed the integration and tried to add again but now keeps failing. How do I go about trying that patch? I'm running HA OS.

apmillen commented 3 years ago

Is there an update to this issue? I've tried rolling back, removing 'discovery:' from my config.YAML and restarting HA multiple times. None have stopped the issue and it seems to be slowing down my system response and automations

chrismanivong commented 3 years ago

I confirm the patch is working in my installation with 3 harmony hubs.

apmillen commented 3 years ago

Is there any instructions on how to use this patch?