Apple TV integration not installing

I am running HA Green, which discovers my ATV (Apple TV gen3) and invites me to install the Apple TV integration. But when I click submit (after giving it the IP address) it just churns for 2-3 min (does not ask for any PINs) and spits out a ‘Unexpected Error’. The ‘discovered’ window then disappears, only to reappear next time I open HA, and the same process repeats (8 or 10 times now!)

I have installed the Homebridge integration, which makes no difference.

The HA Green and Apple TV are both attached by ethernet (via a network switch) to the same router; and the initial integration window is giving the correct name for my apple TV, so clearly has some connection to it.

Any thoughts on how I can get this integration to work?

Please post your logs.

I will do so once I have worked out how to find and copy the logs within HA.

Can you please direct me to the documentation which explains how to do this?

Any solution here? I have the same issue. New to HA.

Logger: homeassistant.components.apple_tv.config_flow
Source: components/apple_tv/config_flow.py:468
integration: apple_tv (documentation, issues)
First occurred: 5:32:19 PM (24 occurrences)
Last logged: 8:17:32 PM

Unexpected exception
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/apple_tv/config_flow.py”, line 468, in async_pair_next_protocol
await self.pairing.begin()
File “/usr/local/lib/python3.13/site-packages/pyatv/protocols/dmap/pairing.py”, line 85, in begin
await self._publish_service(ipaddr, port)
File “/usr/local/lib/python3.13/site-packages/pyatv/protocols/dmap/pairing.py”, line 114, in _publish_service
await mdns.publish(
…<9 lines>…
)
File “/usr/local/lib/python3.13/site-packages/pyatv/core/mdns.py”, line 549, in publish
await loop.run_in_executor(None, zconf.register_service, zsrv)
File “/usr/local/lib/python3.13/concurrent/futures/thread.py”, line 59, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.13/site-packages/zeroconf/_core.py”, line 321, in register_service
run_coro_with_timeout(
~~~~~~~~~~~~~~~~~~~~~^
await_awaitable(
^^^^^^^^^^^^^^^^
…<3 lines>…
_REGISTER_TIME * _REGISTER_BROADCASTS,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File “/usr/local/lib/python3.13/site-packages/zeroconf/_utils/asyncio.py”, line 113, in run_coro_with_timeout
return asyncio.run_coroutine_threadsafe(aw, loop).result(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
millis_to_seconds(timeout) + _LOADED_SYSTEM_TIMEOUT
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File “/usr/local/lib/python3.13/concurrent/futures/_base.py”, line 456, in result
return self.__get_result()
~~~~~~~~~~~~~~~~~^^
File “/usr/local/lib/python3.13/concurrent/futures/_base.py”, line 401, in __get_result
raise self._exception
File “/usr/local/lib/python3.13/site-packages/zeroconf/_utils/asyncio.py”, line 97, in await_awaitable
task = await aw
^^^^^^^^
File “/usr/local/lib/python3.13/site-packages/zeroconf/_core.py”, line 351, in async_register_service
await self.async_check_service(info, allow_name_change, cooperating_responders, strict)
File “/usr/local/lib/python3.13/site-packages/zeroconf/_core.py”, line 544, in async_check_service
raise NonUniqueNameException
zeroconf._exceptions.NonUniqueNameException

OK - found the logs (HA> Settings > System > Logs). Below is the only one which includes the phrase ‘apple_tv’, so I presume it’s the relevant one. Does that (and Positiveground’s who says s/he has a similar problem) give you any insight into what the problem may be:

‘Logger: homeassistant.components.apple_tv.config_flow’
‘’’
Source: components/apple_tv/config_flow.py:468
integration: apple_tv (documentation, issues)
‘’’
‘First occurred: 7 January 2025 at 19:15:35 (1 occurrences)’
‘Last logged: 7 January 2025 at 19:15:35’

‘Unexpected exception’
‘’’
Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/components/apple_tv/config_flow.py”, line 468, in async_pair_next_protocol await self.pairing.begin() File “/usr/local/lib/python3.13/site-packages/pyatv/protocols/airplay/pairing.py”, line 49, in begin self.http = await http_connect(self.address, self.service.port) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.13/site-packages/pyatv/support/http.py”, line 654, in http_connect _, connection = await loop.create_connection(HttpConnection, address, port) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.13/asyncio/base_events.py”, line 1161, in create_connection raise exceptions[0] File “/usr/local/lib/python3.13/asyncio/base_events.py”, line 1136, in create_connection sock = await self._connect_sock( ^^^^^^^^^^^^^^^^^^^^^^^^^ exceptions, addrinfo, laddr_infos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.13/asyncio/base_events.py”, line 1039, in _connect_sock await self.sock_connect(sock, address) File “/usr/local/lib/python3.13/asyncio/selector_events.py”, line 641, in sock_connect return await fut ^^^^^^^^^ File “/usr/local/lib/python3.13/asyncio/selector_events.py”, line 681, in _sock_connect_cb raise OSError(err, f’Connect call failed {address}‘) OSError: [Errno 113] Connect call failed (‘192.168.1.195’, 7000)
‘’’

Many thanks in anticipation.Preformatted text

I suggest you post an issue to GitHub.

Thank you for the suggestion. I am not familiar with the GitHub website and only first heard of it in this HA forum. I have looked at it briefly, and it seems to be a very technical resource for IT professionals (which I am most assuredly not). I presume that there is no ‘beginners’ section to GitHub?

However, I am happy to report that I have now been able to install the AppleTV integration - more by luck than skill I suspect - by installing it using the Home Assistant Companion application on my iPhone, rather than using the HA browser log-in on my laptop (Mac).

@Positiveground - you may wish to try doing this. I have no idea why it worked, but it did for me.