maxileith / homebridge-appletv-enhanced

Homebridge plugin that exposes Apple TVs with features that should be native to Apple HomeKit.
MIT License
172 stars 3 forks source link

Not able to integrate Apple TV #455

Closed philmue1988 closed 4 days ago

philmue1988 commented 3 months ago

Preconditions

Issue

HI,

first of all, thanks for the nice plugin. I was already able to integrate the Apple TV in the home app but I had to restore the Apple TV. Now I´m trying to get it back into the system. I alway get this message and the child bridge is starting again and again. does anyone has clue? I´m using 17.5.1, access settings are allowed to everyone.

Unable to execute request 2V: Traceback (most recent call last):File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/support/__init__.py", line 71, in error_handler
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 120, in _setup_encryption
    await pair_verifier.verify_credentials()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/auth.py", line 150, in verify_credentials
    encrypted_data = self.srp.verify1(self.credentials, server_pub_key, encrypted)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/auth/hap_srp.py", line 101, in verify1
    raise exceptions.AuthenticationError("incorrect device response")
pyatv.exceptions.AuthenticationError: incorrect device responseThe above exception was the direct cause of the following exception:

Traceback (most recent call last):File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 978, in _run_application
    return await cli_handler(loop)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 723, in cli_handler
    return await _handle_commands(args, config, storage, loop)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 851, in _handle_commands
    atv = await connect(config, loop, protocol=args.protocol, storage=storage)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/__init__.py", line 155, in connect
    await atv.connect()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/core/facade.py", line 684, in connect
    if await setup_data.connect():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/__init__.py", line 571, in _connect
    await api.connect()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/api.py", line 143, in connect
    await self._protocol.start()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 108, in start
    await error_handler(self._setup_encryption, exceptions.AuthenticationError)
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/support/__init__.py", line 77, in error_handler
    raise fallback(str(ex)) from ex
pyatv.exceptions.AuthenticationError: incorrect device response

>>> An error occurred, full stack trace above
[18/06/2024, 19:44:00] [Apple TV Enhanced] [E] Wohnzimmer (3) (C8:69:CD:41:2D:4C): Error: Unable to execute request 2V: Traceback (most recent call last):File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/support/__init__.py", line 71, in error_handler
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 120, in _setup_encryption
    await pair_verifier.verify_credentials()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/auth.py", line 150, in verify_credentials
    encrypted_data = self.srp.verify1(self.credentials, server_pub_key, encrypted)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/auth/hap_srp.py", line 101, in verify1
    raise exceptions.AuthenticationError("incorrect device response")
pyatv.exceptions.AuthenticationError: incorrect device responseThe above exception was the direct cause of the following exception:

Traceback (most recent call last):File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 978, in _run_application
    return await cli_handler(loop)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 723, in cli_handler
    return await _handle_commands(args, config, storage, loop)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/scripts/atvremote.py", line 851, in _handle_commands
    atv = await connect(config, loop, protocol=args.protocol, storage=storage)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/__init__.py", line 155, in connect
    await atv.connect()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/core/facade.py", line 684, in connect
    if await setup_data.connect():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/__init__.py", line 571, in _connect
    await api.connect()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/api.py", line 143, in connect
    await self._protocol.start()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 108, in start
    await error_handler(self._setup_encryption, exceptions.AuthenticationError)
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/support/__init__.py", line 77, in error_handler
    raise fallback(str(ex)) from ex
pyatv.exceptions.AuthenticationError: incorrect device response

>>> An error occurred, full stack trace above
    at /var/lib/homebridge/node_modules/homebridge-appletv-enhanced/node_modules/@sebbo2002/node-pyatv/src/lib/tools.ts:172:15
    at Generator.next (<anonymous>)
    at o (/var/lib/homebridge/node_modules/homebridge-appletv-enhanced/node_modules/@sebbo2002/node-pyatv/dist/lib/index.cjs:1:627)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Any Ideas?

maxileith commented 3 months ago

Which device is C8:69:CD:41:2D:4C? Is it an actual Apple TV?

philmue1988 commented 3 months ago

Yes an Apple 4K. It was already paired

maxileith commented 2 months ago

can you delete ./appletv-enhanced/C869CD412D4C/credentials.txt and try it that works out for you? You will have to pair the Apple TV again.

github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open for 60 days with no activity.

github-actions[bot] commented 4 days ago

This issue was closed because it has been inactive for 14 days since being marked as stale.