core icon indicating copy to clipboard operation
core copied to clipboard

HomePod constantly disconnects which require manual "reload" of Integration

Open edmondss opened this issue 2 years ago • 28 comments

The problem

Homepods constantly disconnects which require manual reloading of Apple TV integration .

Sometimes HA detects the issue and ask me to reload the integration. Sometimes it doesn't and when I notice my automation doesn't work as the device went completely to OFF (instead of standby). Cannot wake up the device unless manual reloading the integration.

What version of Home Assistant Core has the issue?

core-2024.3.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Apple TV

Link to integration documentation on our website

https://www.home-assistant.io/integrations/apple_tv

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

edmondss avatar Apr 04 '24 10:04 edmondss

Hey there @postlund, mind taking a look at this issue as it has been labeled with an integration (apple_tv) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of apple_tv can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign apple_tv Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


apple_tv documentation apple_tv source (message by IssueLinks)

home-assistant[bot] avatar Apr 04 '24 10:04 home-assistant[bot]

Unfortunately I ran into the same issue!

nmiller-engineering avatar Apr 04 '24 10:04 nmiller-engineering

I have the same issue but with an Apple TV 4K

Jaco1990 avatar Apr 11 '24 17:04 Jaco1990

I have the same issue but with an Apple TV 4K

Yes, sometimes it happens to my ATV too.

edmondss avatar Apr 12 '24 08:04 edmondss

Same for me with apple TV. I always have to manually reconfigure the integration.

echavet avatar Apr 15 '24 11:04 echavet

Even if the devices is NOT disconnected, it changed to OFF even it's actually in standby. You have to reload integration to make it work.

edmondss avatar Apr 15 '24 11:04 edmondss

Experiencing the same on multiple systems all using AppleTV gen 4's. Seems to occur often when AppleTV is rebooted or goes offline. Integration has to be reloaded to resurrect.

scottshanafelt avatar Apr 19 '24 04:04 scottshanafelt

I had the same issue with my AppleTV. Reloaded integration and its working again. Its been very stable until just recently, not sure whats changed.

jum0n avatar Apr 20 '24 21:04 jum0n

Same problem here. I have to reload the integration at least daily. Is it possible to reload an integration from an automation? I know that it is a work-around, but what is the alternative?

F-HALD avatar May 06 '24 18:05 F-HALD

Appreciate if there's some feedback from integration owner. Thanks.

edmondss avatar May 07 '24 07:05 edmondss

I am having the same issue.

bobbergen avatar May 13 '24 02:05 bobbergen

For now I've mitigated this with the following automation:

alias: Shed - Reload HomePod Config
description: ""
trigger:
  - platform: device
    type: turned_off
    device_id: af26fc2929912a7ed13c45ad61e3978b
    entity_id: 324f4059551f8f1247ddd097fdd1592e
    domain: remote
condition: []
action:
  - service: homeassistant.reload_config_entry
    metadata: {}
    data: {}
    target:
      device_id: af26fc2929912a7ed13c45ad61e3978b
mode: single

cpressland avatar May 14 '24 16:05 cpressland

I came up with the same workaround automation two days ago, I have 16 HomePod Minis and 7 AppleTVs so it added a few automations to my stable.

bobbergen avatar May 14 '24 16:05 bobbergen

`alias: Reload-AppleTV-Living Room description: "" trigger:

  • platform: state entity_id:
    • remote.living_room_atv to: "off" condition: [] action:
  • service: homeassistant.reload_config_entry data: {} target: entity_id: - media_player.living_room_atv mode: single `

bobbergen avatar May 14 '24 16:05 bobbergen

I have the disconnection problem with ATV. The state becomes stale. Reloading sometimes doesn't refresh the state

zipzagster avatar May 23 '24 14:05 zipzagster

same issue, i have to reload the integration almost daily

tomdh76 avatar May 23 '24 19:05 tomdh76

Same here

Royal911 avatar Jun 26 '24 14:06 Royal911

Same here…

KapUttyy avatar Aug 10 '24 14:08 KapUttyy

Same issue. The automation workaround from @cpressland seems to be working for now.

meminens avatar Sep 01 '24 21:09 meminens

I suspect the AppleTV integration, at least for HomePods, is broken after the update along with iOS 18. It was unstable before, now it's completely dead.

I've tried restarting HomePods, restarting Apple integration, devices and restarting HA. I've connected Apple Music directly to HomePods and played music, and tried streaming from mobile. I have pairs in stereo but tried all this without grouping.

But no... state forever off.

Has anyone experienced the same, or is it just me?

Gybrsh avatar Sep 17 '24 20:09 Gybrsh

@Gybrsh I had the same problem at first. Deleting the HomePods and re-adding did the trick for me.

mattsch avatar Sep 17 '24 20:09 mattsch

Damn! That worked @mattsch. I should have tried that first, haha :D Thanks!!

Gybrsh avatar Sep 17 '24 20:09 Gybrsh

Damn! That worked @mattsch. I should have tried that first, haha :D Thanks!!

May I ask, after upgrading to iOS 18, do they still have the same problem that HomePod/ ATV went off or unavailable which requires regular manual reload the integration

edmondss avatar Sep 18 '24 03:09 edmondss

@edmondss I have iOS 18. I will monitor and report back. I will know the issue persists if my automation to reload the integration triggers again.

meminens avatar Sep 18 '24 03:09 meminens

@edmondss I have iOS 18. I will monitor and report back. I will know the issue persists if my automation to reload the integration triggers again.

Thank you. Appreciated.

edmondss avatar Sep 19 '24 03:09 edmondss

@edmondss Unfortunately, I can report that the issue persists. My automation for reload triggered yesterday. I don't know if it helps but I found the following error in the logs:

Failed to connect

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protocol.py", line 275, in _receive
    await semaphore.acquire()
  File "/usr/local/lib/python3.12/asyncio/locks.py", line 386, in acquire
    await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/apple_tv/__init__.py", line 282, in connect_once
    await self._connect_once(raise_missing_credentials)
  File "/usr/src/homeassistant/homeassistant/components/apple_tv/__init__.py", line 267, in _connect_once
    await self._connect(conf, raise_missing_credentials)
  File "/usr/src/homeassistant/homeassistant/components/apple_tv/__init__.py", line 387, in _connect
    self.atv = await connect(conf, self.hass.loop, session=session)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyatv/__init__.py", line 155, in connect
    await atv.connect()
  File "/usr/local/lib/python3.12/site-packages/pyatv/core/facade.py", line 723, in connect
    if await setup_data.connect():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/__init__.py", line 1097, in _connect
    await protocol.start()
  File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protocol.py", line 146, in start
    self.device_info = await self.send_and_receive(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protocol.py", line 262, in send_and_receive
    return await self._receive(identifier, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protocol.py", line 274, in _receive
    async with async_timeout.timeout(timeout):
  File "/usr/local/lib/python3.12/site-packages/async_timeout/__init__.py", line 141, in __aexit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.12/site-packages/async_timeout/__init__.py", line 228, in _do_exit
    raise asyncio.TimeoutError
TimeoutError

meminens avatar Sep 24 '24 23:09 meminens

@edmondss Unfortunately, I can report that the issue persists. My automation for reload triggered yesterday. I don't know if it helps but I found the following error in the logs:

Failed to connect

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protocol.py", line 275, in _receive
    await semaphore.acquire()
  File "/usr/local/lib/python3.12/asyncio/locks.py", line 386, in acquire
    await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/apple_tv/__init__.py", line 282, in connect_once
    await self._connect_once(raise_missing_credentials)
  File "/usr/src/homeassistant/homeassistant/components/apple_tv/__init__.py", line 267, in _connect_once
    await self._connect(conf, raise_missing_credentials)
  File "/usr/src/homeassistant/homeassistant/components/apple_tv/__init__.py", line 387, in _connect
    self.atv = await connect(conf, self.hass.loop, session=session)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyatv/__init__.py", line 155, in connect
    await atv.connect()
  File "/usr/local/lib/python3.12/site-packages/pyatv/core/facade.py", line 723, in connect
    if await setup_data.connect():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/__init__.py", line 1097, in _connect
    await protocol.start()
  File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protocol.py", line 146, in start
    self.device_info = await self.send_and_receive(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protocol.py", line 262, in send_and_receive
    return await self._receive(identifier, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/mrp/protocol.py", line 274, in _receive
    async with async_timeout.timeout(timeout):
  File "/usr/local/lib/python3.12/site-packages/async_timeout/__init__.py", line 141, in __aexit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.12/site-packages/async_timeout/__init__.py", line 228, in _do_exit
    raise asyncio.TimeoutError
TimeoutError

Thanks. I hate to ask, will this ever be fixed?

edmondss avatar Sep 25 '24 02:09 edmondss

+1 facing the same issue

sysofwan avatar Oct 15 '24 01:10 sysofwan

Same issue, I have to reload the integration each day. It is so annoying as I'm using them to provide doorbell rings, too.

itradesize avatar Dec 28 '24 11:12 itradesize

Same

freddeh avatar Jan 03 '25 12:01 freddeh