Open nashnix opened 8 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)
I can report that the exact same behaviour noted above persists under the most current version of Home Assistant (i.e, under version 2024.3.1):
Home Assistant details:
Log:
Logger: homeassistant.components.apple_tv.config_flow
Source: components/apple_tv/config_flow.py:460
integration: apple_tv (documentation, issues)
First occurred: 18:38:55 (1 occurrences)
Last logged: 18:38:55
Authentication problem
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/pyatv/support/__init__.py", line 71, in error_handler
return await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/companion/auth.py", line 53, in start_pairing
resp = await self.protocol.exchange_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/companion/protocol.py", line 142, in exchange_auth
return await self._exchange_generic_opack(frame_type, data, identifier, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/companion/protocol.py", line 175, 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 460, in async_pair_next_protocol
await self.pairing.begin()
File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/companion/pairing.py", line 47, in begin
await error_handler(
File "/usr/local/lib/python3.12/site-packages/pyatv/support/__init__.py", line 77, in error_handler
raise fallback(str(ex)) from ex
pyatv.exceptions.PairingError: Command failed: Pairing not allowed
As before:
facing same issue with newer Apple TV 4 and Apple TV 4K (gen 3). AppleTV (gen 2) works fine
I am having the same issue as well.
Core 2024.4.2
Supervisor 2024.04.0
Operating System 12.1
Frontend 20240404.1
Apple TV 4K tvOS 17.4.
I have also tested with pyatv stand alone from pip and it gives the same exception.
I was able to make the authentication work and the Home Assistant Apple TV integration setup to succeed. The issue for me was that the settings "Air Play Settings" and "Remote App Pairing" under Restrictions in Settings App was set to "Restrict". Once those were changed to "Allow" the pairing process worked.
Thanks @jonatansmedsgard, but as I noted in both my reports above; AirPlay is on, access is set to "everyone", and there are no PIN codes or like barriers (that includes the remote stuff too).
Whatever issue this is, that doesn't fix it.
The issue appears to be on the HomeAssistant side; as far as the AppleTV is concerned, everything is set up and working just fine.
Just installed HomeAssistant and has the same issue with Apple TV integration ..
It appears that a complete factory reset of your AppleTV will result in Home Assistant being able to see and integrate the AppleTV. See https://support.apple.com/en-us/108897 for directions as to how.
Note that this will wipe everything from your AppleTV, including any streaming services and downloads you have.
I would not call that real solution though; it is, at best, a stopgap workaround. Most people will be loathe to wipe their AppleTV just to enable this integration - especially as you will need to re-download everything you had on it manually, which means having to log back into every one of the fifty streaming services everyone has to have now, all at once. As such, I have left the issue open, as it is still in need of a reasonable solution.
I was able to make the authentication work and the Home Assistant Apple TV integration setup to succeed. The issue for me was that the settings "Air Play Settings" and "Remote App Pairing" under Restrictions in Settings App was set to "Restrict". Once those were changed to "Allow" the pairing process worked.
This worked for me. A difference I have from the others is that I am running the current beta version of the new tvOS, 18.0
I was able to make the authentication work and the Home Assistant Apple TV integration setup to succeed. The issue for me was that the settings "Air Play Settings" and "Remote App Pairing" under Restrictions in Settings App was set to "Restrict". Once those were changed to "Allow" the pairing process worked.
This worked for me as well, thanks @jonatansmedsgard
I was able to make the authentication work and the Home Assistant Apple TV integration setup to succeed. The issue for me was that the settings "Air Play Settings" and "Remote App Pairing" under Restrictions in Settings App was set to "Restrict". Once those were changed to "Allow" the pairing process worked.
Thank you! I've been banging my head against this for a while! :)
https://github.com/postlund/pyatv/issues/2495 https://github.com/maxileith/homebridge-appletv-enhanced/issues/459
The problem
Expected Behaviour:
Home Assistant will ask the Apple TV to provide a PIN, this is provided and entered, and Home Assistant connects to Apple TV
Actual Behaviour:
Home Assistant asks the Apple TV to provide a PIN; this is provided and entered, then Home Assistant integration fails, declaring "invalid authentication", even though the AppleTV connection PIN is correct.
Supplementary:
Remotes and Devices
>Remote App and Devices
, the AppleTV has an entry forHome Assistant
, which was not present before attempting this; so, as far as the AppleTV is concerned, everything went smoothly.What version of Home Assistant Core has the issue?
core-2024.3.0
What was the last working version of Home Assistant Core?
N/A - has never worked
What type of installation are you running?
Home Assistant Supervised
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?
Additional information
The following are definitely not the cause: