Closed chini007 closed 4 months ago
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!
(message by CodeOwnersMention)
apple_tv documentation apple_tv source (message by IssueLinks)
Are you able to connect to other local devices? Since you're running home assistant in a container, the network setup can be different
Oh yes I can connect other devices. I have already connected my smart home server (digitalStrom) via mqtt, my bose system, samsung tv, bosch controller etc.
Are they on different networks, e.g. VLANs?
No they are all on same LAN. HA and other Integrations can see other devices using IP.
The important thing is that the IP packets reaching the Apple TV has an address belonging to the same network as the Apple TV, otherwise they will be dropped (MDNS/zeroconf works that way). Just IP connectivity is not enough. Since unicast look ups doesn't work (when you manually specify IP), I suspect this is not the case.
i have a similar issue, im running home-assistant OS in truenas vm, i can't add via ip address, i was able to connect to my synology nas just fine for the record
How is the network configured in the VM?
Simple..., att modem/wifi, http://192.168.1.106:8123/ home assistant, 192.168.1.74 (appletv), i can ping appletv from truenas scale
I fixed my issue! I didnt have enable truest filters enabled.... Not sure why that did it!
It might have been that it dropped MDNS packets because of that. Something related to firewall or network rules would have been my best guess here.
The important thing is that the IP packets reaching the Apple TV has an address belonging to the same network as the Apple TV, otherwise they will be dropped (MDNS/zeroconf works that way). Just IP connectivity is not enough. Since unicast look ups doesn't work (when you manually specify IP), I suspect this is not the case.
Am lost here, how could I check if the packets are coming from same network as Apple TV or not. And if not how could still add apple TV.
@postlund Yeah I'm having the same issue here. Running HassOS, added a new adapter for the network in which the AppleTV resides. I can ping the AppleTV from HA, but when adding the device I just get the following:
pfsense is doing the routing, but nothing should be blocked on the VLAN level, meaning the HassOS adapter has full permissions to the apple TV.
Update: Suddenly I see AppleTV, HomeKit and Thread as Discovered Devices, though I only went through the initialization process for the AppleTV integration (entering the pin codes 3 times), though the adoption process still fails with only a warning in the logs:
Config entry 'Living Room' for apple_tv integration not ready yet: Not found at x.x.x.x (redacted), waiting for discovery; Retrying in background
@rwjack I know @bdraco has made improvements that hopefully improves this. The important thing is the the source IP address in Home Assistant matches the network in which the Apple TV resides, otherwise you must use an MDNS relayer (being reachable, e.g. ICMP, is not enough for this to work, the Apple TV will just do the packets).
Yep, exactly why I added a new adapter in HassOS to match the Network AppleTV resides in, but not even this seems to have resolved the issue.
New changes aren't in a published release yet. Should be next week or sooner depending on when some other issues get tied up
Another update, it started working the next day, but failed again today with the same warning as before:
Something really wonky is going on. 🥴
2023.8.2 was published with some more changes to work around flakey multicast
If thats the underlying problem, it should help.
If its not, you'll probably need to provide debug logs for pyatv
I can confirm the issue, sometimes it works perfectly to connect to ATV, sometimes it does not. I am running HA OS 2023.8.4 as a VM on Proxmox, only VirtIO Network Adapter is on the same subnet as ATV, a Homepod mini in the same room connected to the same router wirelessly works flawless. I can see the UDP packages of both Apple devices with wireshark on the NIC.
Now, when taking a look at the logs of pyatv (activated debug logs) I recognized that the integration tried to connect to the IP x.x.x.194 which was a dynamic non-actual registration on the FritzBox being my main router in that network with the same name of "MensCave" as the MDNS registration of the ATV. Since I deleted that record, the integration worked perfectly. No idea what the FritzBox does, maybe it's time to replace it by OPNsense ;-)
Anyway, maybe that helps someone, attached the log. home-assistant_apple_tv_2023-09-04T15-00-20.510Z.log
With debugging enabled, I had this log the only time the integration recognized my Apple TV. HA never recognized the Apple TV again.
Logger: homeassistant.components.apple_tv.config_flow
Source: components/apple_tv/config_flow.py:421
Integration: Apple TV (documentation, issues)
First occurred: 16:23:39 (1 occurrences)
Last logged: 16:23:39
Unexpected exception
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/apple_tv/config_flow.py", line 421, in async_pair_next_protocol
await self.pairing.begin()
File "/usr/local/lib/python3.11/site-packages/pyatv/protocols/airplay/pairing.py", line 60, in begin
self.http = await http_connect(self.address, self.service.port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyatv/support/http.py", line 653, in http_connect
_, connection = await loop.create_connection(HttpConnection, address, port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1085, in create_connection
raise exceptions[0]
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection
sock = await self._connect_sock(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 628, in sock_connect
return await fut
^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 668, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
OSError: [Errno 113] Connect call failed ('192.168.1.80', 7000)
This is what I see with debug 192.168.178.81: Multicast is broken or device offline, trying unicast PTR queries for ['_device-info._tcp.local.']
any new info on this? I am having the same issue with two apple tv's
I am also having an issue not able to connect my AppleTV to home assistant. I have in the past, but using proxmox ubuntu VM this time around, I am able to ping the AppleTV within ubuntu server fine, with no issues. But when I try to add the AppleTV ip to the AppleTV integration in HA, it says "No devices found on the network".
Edit:
I GOT IT WORKING
In my docker compose yaml, I originally set the network mode to "bridge"
I updated the network mode to "host" and this fixed it immediately after HA came back up. It also auto-found my appletv along with a bunch of other integrations.
Yes, updating the pod to host mode "hostNetwork: true" resolves it.
The problem
I am trying to add my apple TV. And when I provide the IP address of the apple TV, it complains Device not found.
What version of Home Assistant Core has the issue?
core-2023.6.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
apple_tv
Link to integration documentation on our website
No response
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