Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HomePod constantly disconnects which require manual "reload" of Integration #114836

Open
edmondss opened this issue Apr 4, 2024 · 30 comments
Open

Comments

@edmondss
Copy link

edmondss commented Apr 4, 2024

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

@home-assistant
Copy link

home-assistant bot commented Apr 4, 2024

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)

@nmiller-engineering
Copy link

Unfortunately I ran into the same issue!

@Jaco1990
Copy link

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

@edmondss
Copy link
Author

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

Yes, sometimes it happens to my ATV too.

@echavet
Copy link

echavet commented Apr 15, 2024

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

@edmondss
Copy link
Author

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.

@scottshanafelt
Copy link

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.

@jum0n
Copy link

jum0n commented Apr 20, 2024

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.

@F-HALD
Copy link

F-HALD commented May 6, 2024

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?

@edmondss
Copy link
Author

edmondss commented May 7, 2024

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

@bobbergen
Copy link

I am having the same issue.

@cpressland
Copy link

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

@bobbergen
Copy link

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
Copy link

`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
    `

@zipzagster
Copy link

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

@tomdh76
Copy link

tomdh76 commented May 23, 2024

same issue, i have to reload the integration almost daily

@Royal911
Copy link

Same here

@KapUttyy
Copy link

Same here…

@meminens
Copy link

meminens commented Sep 1, 2024

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

@Gybrsh
Copy link

Gybrsh commented Sep 17, 2024

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?

@mattsch
Copy link
Contributor

mattsch commented Sep 17, 2024

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

@Gybrsh
Copy link

Gybrsh commented Sep 17, 2024

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

@edmondss
Copy link
Author

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

@meminens
Copy link

@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.

@edmondss
Copy link
Author

@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.

@meminens
Copy link

meminens commented Sep 24, 2024

@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

@edmondss
Copy link
Author

@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?

@sysofwan
Copy link

+1 facing the same issue

@itradesize
Copy link

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

@freddeh
Copy link

freddeh commented Jan 3, 2025

Same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests