Closed Didel closed 1 year ago
apple_tv documentation apple_tv source (message by IssueLinks)
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)
Same issue. My Apple TV is running public beta tvOS 16.
Same issue here, running latest tvOs on appletv 4k, latest HA.
Same here. Apple TV is running on 15.6.
Same here. Been on-going since the latest beta of pytv, but since I never managed to find any relevant log entries my filed issue staled out. Running the latest released tvos version.
This only seems to happen on the latest HW revision, i.e. the "new" AppleTV 4k. The older 4k model seems to just rock on...
This only seems to happen on the latest HW revision, i.e. the "new" AppleTV 4k. The older 4k model seems to just rock on...
Not true, I have the ‘old’ / original 4K model and still have these problems.
I
Fair enough.
In my setup I have an older one that I configured a few years ago which is still working just fine. That specific device has even been away in a different location for the summer but automation are still running when we came back in the autumn.
My two v2 4k devices just won't stick. Weird.
All of you that have upgraded to tvOS 16: make sure to change AirPlay access permission to "everyone on the same network". It seems like apple has made a reset on this option.
All of you that have upgraded to tvOS 16: make sure to change AirPlay access permission to "everyone on the same network". It seems like apple has made a reset on this option.
Is that to be read as though tvos 16 devices won't have this issue if reconfigured?
I have noticed that while the integration says it needs to be reconfigured/reconnected to the Apple TV, a restart of Home Assistant makes it work again without actually doing so. It appears to me that the integration thinks it's disconnected when it is not, maybe through some faulty error detection?
All of you that have upgraded to tvOS 16: make sure to change AirPlay access permission to "everyone on the same network". It seems like apple has made a reset on this option.
In iOS 16 the options are "Everyone", "Anyone on the same network" and "Only People Sharing This Home". I assume you mean the first option...
I have noticed that while the integration says it needs to be reconfigured/reconnected to the Apple TV, a restart of Home Assistant makes it work again without actually doing so. It appears to me that the integration thinks it's disconnected when it is not, maybe through some faulty error detection?
Same here. A simple restart of Home Assistant clears the error and the Reconfigure notification. In my case it only happens with one of the two identical Apple TVs in the house, both with static IPs and both with exactly the same settings.
@uspino2 "Anyone on the same network", otherwise you allow anyone to connect.
Has anyone had any luck here? I've been having the same issue and would gladly do further testing if anyone has ideas.
TVOS 16 with airplay on 'Everyone' and 'Anyone on the same network' tested, issue arrises with both.
@postlund Anything we can do to help debug this issue? It is kind of annoying.
I've had this issue for months on one original Apple TV 4k. I moved it to the core switch, same issue. Finally I just factory reset it and did a manual setup without the iPhone and it solved the issue. YMMV
I've had this issue for months on one original Apple TV 4k. I moved it to the core switch, same issue. Finally I just factory reset it and did a manual setup without the iPhone and it solved the issue. YMMV
@tsspmq - I have not set up an AppleTV in a long time. What do you mean by "without the iPhone"? Is there an option to complete setup of an Apple TV using iPhone I imagine? And therefore, you did not do that, but did it all on the TV itself?
Yeah basically thats how it works. I don't like using the iPhone (You take it close to it and it "assists" in the setup). It loads in WiFi settings as well as the iCloud user/password. Since I use a different account for the store its easier to just do fresh and I segment my entertainment devices on a different VLAN and if a switch reboots it reverts to the client VLAN the phone uses. Just an annoyance.
One thing I did forget to mention - The one difference between this device and the other three was I had not assigned it to a room for HomeKit to stop nagging me to do it. I did that after the reset. I don't use HomeKit, but I got sick of that "badge" in the settings telling me to finish airplay setup. The one Apple TV is used by another family member so they never pay attention to it.
I could be experiencing a placebo effect and it breaks again tomorrow. I'll report back if it does, but maybe a few others can try that in the meantime.
When I looked at the debug logs, it would simply say it disconnected then it would reconnect, and keep doing that. Eventually it would start discovering it and have 10 "new devices" in the integrations section.
I had thought it was a bad cable, some kind of a mDNS reflection problem outside of HA but when I moved it, the problem followed it.
When I find time this weekend I will give this reset a go. Report back if yours starts reauthenticating, and I'll be sure to report back my findings as well in the coming week. Hopefully providing some good starting points for debugging.
Just wanted to report back that everything is still working great.
I reset my AppleTV 4 (no k) just over an hour ago. Manual as did @tsspmq. No VLAN here, just static IP assignment. So far, it has not run into the failed automatic reauthentication. Will continue to monitor over the next few days and report back with any news.
Unfortunately, I have bad news. The reset -> manual setup (no iPhone assistance) did not solve the authentication error for me. However, there were some interesting changes I have noticed. It seems as though I am not actually receiving the authentication error now, as I dont have those logs nor do I get a "Attention Required: reconfigure" message in the integrations screen.
I am noticing that while the integration is still connected, the status of my AppleTV is not changing away from either 'Paused' or 'Idle' when I come back to it hours later. I can however still use the media player to switch [app] sources, and turn off the AppleTV. Pretty odd.
If anyone has some insights, I'd love to hear them. In the meantime, I've set up a script/automation duo to run the 'reload integration' service every 10 minutes between 8pm-midnight, because that always resets the issue and allows my other automations to fire based on state of the AppleTV.
Same issue here: Apple TV 4K (gen2) Firmware: 16.1 Static IP
Home Assistant 2022.11.4 Supervisor 2022.10.2 Operating System 9.3
Seeing both of these at the same time. Perhaps the "Reconfigure" alert is a false positive today? Many days the remote just won't work from the HA UI, using this call service:
type: button tap_action: action: call-service service: remote.send_command data: command: up target: entity_id: remote.living_room
And I will have to Reconfigure to restore remote commands.
I’m also experiencing this issue. HA 2023.1.4 and Apple TV 16.2
Same problem...
Logger: homeassistant.components.apple_tv.config_flow
Source: components/apple_tv/config_flow.py:410
Integration: Apple TV ([documentation](https://www.home-assistant.io/integrations/apple_tv), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+apple_tv%22))
First occurred: 04:46:15 (1 occurrences)
Last logged: 04:46:15
Authentication problem
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/pyatv/support/__init__.py", line 33, in error_handler
return await func(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/pyatv/protocols/companion/auth.py", line 54, in start_pairing
resp = await self.protocol.exchange_auth(
File "/usr/local/lib/python3.10/site-packages/pyatv/protocols/companion/protocol.py", line 145, in exchange_auth
return await self._exchange_generic_opack(frame_type, data, identifier, timeout)
File "/usr/local/lib/python3.10/site-packages/pyatv/protocols/companion/protocol.py", line 178, in _exchange_generic_opack
raise exceptions.ProtocolError(f"Command failed: {unpacked_object['_em']}")
pyatv.exceptions.ProtocolError: Command failed: Pairing not allowed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/apple_tv/config_flow.py", line 410, in async_pair_next_protocol
await self.pairing.begin()
File "/usr/local/lib/python3.10/site-packages/pyatv/protocols/companion/pairing.py", line 53, in begin
await error_handler(
File "/usr/local/lib/python3.10/site-packages/pyatv/support/__init__.py", line 41, in error_handler
raise fallback(str(ex)) from ex
pyatv.exceptions.PairingError: Command failed: Pairing not allowed
Same problem here. The reason seems to be that an old integration of Apple TV was not deleted completely (this one never worked, until I did I full reset of Apple TV and was able to create a new integration). Everytime the old integration is discovered (on a daily basis), the new, working integration stopps working. I do not know how to delete the old version. The only option in the three dots available is "documentation" (see printscreen). The logger keeps on saying that the connection to the old version is lost.
Probably the problem would be solved if the old integration could be deleted. Hope this helps to track down the problem and to find a solution!
Logger: homeassistant.components.apple_tv Source: components/apple_tv/init.py:169 Integration: Apple TV (documentation, issues) First occurred: 09:04:17 (2 occurrences) Last logged: 09:19:23
Connection lost to Apple TV "Wohnzimmer (2)"
I do not believe the orphaned integration is the issue but here is how you can delete it. I had a similar forgotten Apple TV integration. One caveat, this requires editing the .storage files which if you mess up can have some unintended consequences.
Install Studio Code Server and navigate to File > Open and look for the following files: I scrubbed the old Apple TV entry in the JSON storage from .storage/core.config_entries and .storage/core.device_registry. That completely got rid of any mention of the old integration.
However, I still see Can't Connect errors in the logs:
2023-04-05 21:06:59.233 ERROR (MainThread) [homeassistant.components.apple_tv] Failed to connect
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/apple_tv/__init__.py", line 222, in connect_once
await self._connect(conf, raise_missing_credentials)
File "/usr/src/homeassistant/homeassistant/components/apple_tv/__init__.py", line 324, in _connect
self.atv = await connect(conf, self.hass.loop, session=session)
File "/usr/local/lib/python3.10/site-packages/pyatv/__init__.py", line 135, in connect
await atv.connect()
File "/usr/local/lib/python3.10/site-packages/pyatv/core/facade.py", line 575, in connect
if await setup_data.connect():
File "/usr/local/lib/python3.10/site-packages/pyatv/protocols/companion/__init__.py", line 411, in _connect
await api.connect()
File "/usr/local/lib/python3.10/site-packages/pyatv/protocols/companion/api.py", line 121, in connect
await self._protocol.start()
File "/usr/local/lib/python3.10/site-packages/pyatv/protocols/companion/protocol.py", line 101, in start
await self.connection.connect()
File "/usr/local/lib/python3.10/site-packages/pyatv/protocols/companion/connection.py", line 80, in connect
await self.loop.create_connection(lambda: self, self.host, self.port)
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1076, in create_connection
raise exceptions[0]
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1060, in create_connection
sock = await self._connect_sock(
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 969, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 501, in sock_connect
return await fut
File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 541, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
OSError: [Errno 113] Connect call failed ('192.168.7.248', 49153)
2023-04-05 21:07:17.344 ERROR (MainThread) [pyatv.protocols.airplay] Failed to set up remote control channel
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/pyatv/protocols/airplay/__init__.py", line 258, in _connect_rc
await control.start(str(core.config.address), control_port, credentials)
File "/usr/local/lib/python3.10/site-packages/pyatv/protocols/airplay/remote_control.py", line 55, in start
self.connection = await http_connect(address, control_port)
File "/usr/local/lib/python3.10/site-packages/pyatv/support/http.py", line 558, in http_connect
_, connection = await loop.create_connection(HttpConnection, address, port)
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1076, in create_connection
raise exceptions[0]
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1060, in create_connection
sock = await self._connect_sock(
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 969, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 501, in sock_connect
return await fut
File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 541, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
OSError: [Errno 113] Connect call failed ('192.168.7.248', 7000)
Within settings, Airplay is set to Allow Access "Everyone" HA is 2023.4 Apple TV is 16.4
Dear Picket, thanks a lot for your quick reply and help. The good news is, the problem does not occur any more, the bad news is, I do not exactly know why. What I did: In the Apple Integration i clicked on system options and deactivated the option to enabe newly added entities. After this the orphant installation did not pop up any more and therefore could not disconnect the correct integration any more. In order to be able to send you the error log and to help resolving the issue, I activated the option again, but the orphant installation did stil not pop up any more and the Apple Integrations works. However, I cannot be sure this was the reason. I also updated Home Assistant to Version 2023.4.2, maybe this also helped. I am sorry I cannot deliver better information about that.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
The problem
It looks like the Apple TV requires new authentication in an almost daily basis.
It could be, although not confirmed, it might require new authentication after turning off the Apple TV (that happens once or multiple times daily).It appears that it does not matter how the AppleTV was turned off, either by automations or by the AppleTV Remote. After going through the authentication process in Home Assistant, everything’s works fine again until(what I assume is the reason) the Apple TV is powered off again[exact reason unknown].What version of Home Assistant Core has the issue?
2022.08.03
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?
In order of occurrence:
Additional information
It could be that #76781 is caused by this as well.
Screenshot of Home Assistant interface: