maxileith / homebridge-appletv-enhanced

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

Error After Successful Device Pairing #691

Open elmercado07 opened 3 days ago

elmercado07 commented 3 days ago

Preconditions

Current Situation

After the initial configuration of the plugin and successful pairing of Apple TV, I am receiving the following error:

Logs

[19/10/2024, 07:47:17] [Apple TV Enhanced] [I] Platform: Finished initializing platform: Apple TV Enhanced
[19/10/2024, 07:47:17] Publishing bridge accessory (name: Apple TV Enhanced, publishInfo: {
  username: 'XX:XX:XX:XX:XX:XX',
  port: 47313,
  pincode: '***-**-***',
  category: 2,
  bind: undefined,
  mdns: undefined,
  addIdentifyingMaterial: true,
  advertiser: 'avahi'
}).
[19/10/2024, 07:47:17] [Apple TV Enhanced] [I] Update check: The update checker is configured to check for updates between 3:00 and 3:59, excluding betas. Auto updating is turned on.
[19/10/2024, 07:47:17] Homebridge v1.8.4 (HAP v0.12.2) (Apple TV Enhanced) is running on port 47313.
[19/10/2024, 07:47:17] 

NOTICE TO USERS AND PLUGIN DEVELOPERS
> Homebridge 2.0 is on the way and brings some breaking changes to existing plugins.
> Please visit the following link to learn more about the changes and how to prepare:
> https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0

[19/10/2024, 07:47:17] [Apple TV Enhanced] [S] Update check: You are using the latest version of AppleTV Enhanced (excluding betas): 1.9.0
[19/10/2024, 07:47:17] [Apple TV Enhanced] [I] Python check: Starting python check.
[19/10/2024, 07:47:17] [Apple TV Enhanced] [I] Python check: plugin dir exists.
[19/10/2024, 07:47:18] [Apple TV Enhanced] [I] Python check: OpenSSL 3.0.11 is installed and compatible.
[19/10/2024, 07:47:18] [Apple TV Enhanced] [I] Python check: Python 3.11.2 is installed and supported by the plugin.
[19/10/2024, 07:47:18] [Apple TV Enhanced] [I] Python check: Virtual environment already exists.
[19/10/2024, 07:47:18] [Apple TV Enhanced] [I] Python check: Virtual environment is using the systems default python environment. Continuing ...
[19/10/2024, 07:47:19] [Apple TV Enhanced] [I] Python check: Venv pip version: 24.2
[19/10/2024, 07:47:19] [Apple TV Enhanced] [I] Python check: Checking if there is an update for venv pip ...
[19/10/2024, 07:47:19] [Apple TV Enhanced] [I] Python check: Venv pip is up-to-date
[19/10/2024, 07:47:20] [Apple TV Enhanced] [I] Python check: Python requirements are satisfied.
[19/10/2024, 07:47:20] [Apple TV Enhanced] [S] Python check: Finished
[19/10/2024, 07:47:20] [Apple TV Enhanced] [I] Platform: Starting device discovery ...
[19/10/2024, 07:47:26] [Apple TV Enhanced] [I] Platform: Adding Living Room (XX:XX:XX:XX:XX:XX)
[19/10/2024, 07:47:26] [Apple TV Enhanced] [I] Platform: Adding Bedroom (XX:XX:XX:XX:XX:XX)
[19/10/2024, 07:47:26] [Apple TV Enhanced] [I] Bedroom (XX:XX:XX:XX:XX:XX): verifying credentials ...
[19/10/2024, 07:47:26] [Apple TV Enhanced] [W] Living Room (XX:XX:XX:XX:XX:XX): Credentials are no longer valid. Need to repair ...
[19/10/2024, 07:47:26] [Apple TV Enhanced] [W] Living Room (XX:XX:XX:XX:XX:XX): You need to pair your Apple TV before the plugin can connect to it. Open the webpage http://192.168.4.96:42062/. Then, enter the pairing code that will be displayed on your Apple TV.
[19/10/2024, 07:47:28] [Apple TV Enhanced] [E] Bedroom (XX:XX:XX:XX:XX:XX): Unexpected atvremote response: 2024-10-19 07:47:28 ERROR [pyatv.protocols.airplay]: Failed to set up remote control channel
Traceback (most recent call last):
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/airplay/__init__.py", line 348, in _connect_rc
    await session.setup_remote_control()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/airplay/ap2_session.py", line 80, in setup_remote_control
    await self._setup_event_channel(self.connection.remote_ip)
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/airplay/ap2_session.py", line 119, in _setup_event_channel
    resp = await self._setup(
           ^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/airplay/ap2_session.py", line 112, in _setup
    resp = await self.rtsp.setup(body=body)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/support/rtsp.py", line 177, in setup
    return await self.exchange("SETUP", headers=headers, body=body)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/support/rtsp.py", line 294, in exchange
    resp = await self.connection.send_and_receive(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/support/http.py", line 490, in send_and_receive
    raise exceptions.AuthenticationError("not authenticated")
pyatv.exceptions.AuthenticationError: not authenticatedApp: Max (com.wbd.stream), App: Fitness (com.apple.Fitness), App: Podcasts (com.apple.podcasts), App: Movies (com.apple.TVMovies), App: Prime Video (com.amazon.aiv.AIVApp), App: TV (com.apple.TVWatchList), App: Photos (com.apple.TVPhotos), App: App Store (com.apple.TVAppStore), App: Arcade (com.apple.Arcade), App: NFL (com.nfl.gamecenter), App: TV Shows (com.apple.TVShows), App: Search (com.apple.TVSearch), App: Peacock (com.peacocktv.peacock), App: Computers (com.apple.TVHomeSharing), App: YouTube TV (com.google.ios.youtubeunplugged), App: Sonic Racing (com.sega.kartios), App: YouTube (com.google.ios.youtube), App: ESPN (com.espn.ScoreCenter), App: Disney+ (com.disney.disneyplus), App: Plex (com.plexapp.plex), App: Settings (com.apple.TVSettings), App: Netflix (com.netflix.Netflix), App: tvOS Browser (com.elmercado07.tvbrowser), App: Music (com.apple.TVMusic)
[19/10/2024, 07:47:28] [Apple TV Enhanced] Child bridge process ended
[19/10/2024, 07:47:28] [Apple TV Enhanced] Process Ended. Code: 1, Signal: null
[19/10/2024, 07:47:35] [Apple TV Enhanced] Restarting Process...
[19/10/2024, 07:47:36] [Apple TV Enhanced] Launched child bridge with PID 98183
[19/10/2024, 07:47:36] [Apple TV Enhanced] Loaded homebridge-appletv-enhanced v1.9.0 child bridge successfully

Configuration

{
    "name": "Apple TV Enhanced",
    "mediaTypes": [
        "music",
        "tv",
        "video"
    ],
    "deviceStates": [
        "idle",
        "loading",
        "paused",
        "playing",
        "seeking",
        "stopped"
    ],
    "deviceStateDelay": 0,
    "remoteKeysAsSwitch": [
        "turn_off",
        "turn_on"
    ],
    "avadaKedavraAppAmount": 15,
    "disableVolumeControlRemote": false,
    "absoluteVolumeControl": false,
    "discover": {
        "multicast": true
    },
    "forceVenvRecreate": false,
    "logLevel": 3,
    "updateCheckLevel": "stable",
    "updateCheckTime": 3,
    "deviceSpecificOverrides": [
        {
            "overrideMediaTypes": false,
            "overrideDeviceStates": false,
            "overrideDeviceStateDelay": false,
            "deviceStateDelay": 0,
            "overrideRemoteKeysAsSwitch": false,
            "overrideAvadaKedavraAppAmount": false,
            "avadaKedavraAppAmount": 15,
            "overrideCustomInputURIs": false,
            "overrideDisableVolumeControlRemote": false,
            "disableVolumeControlRemote": false,
            "overrideAbsoluteVolumeControl": false,
            "absoluteVolumeControl": false
        }
    ],
    "_bridge": {
        "username": "XX:XX:XX:XX:XX:6XX",
        "port": 47313
    },
    "platform": "AppleTVEnhanced"
}

Operating System

Linux

Operating System: Bits

64-bit

Operating System: Distribution

homebridge/homebridge-raspbian-image-1.2.0-(64bit)

Operating System: Distribution Version

Debian GNU/Linux Bookworm (12)

Docker

no

Docker Image

None

Docker Image Tag

No response

Homebridge Version

1.8.4

Homebridge Config UI Version

v4.62.0

Homebridge Storage Path

/var/lib/homebridge

Homebridge Apple TV Enhanced Version

1.9.0

Node Version

20.18.0

NPM Version

10.8.2

Python Version

3.11.12

PIP Version

23.0.1

HDMI Hops

None

Audio Output

no

Same Subnet

yes

Additional Context

This is my first time trying to run/configure this plugin, so maybe I am doing something wrong. Any assistance would be greatly appreciated. I looked everywhere before submitting this for the error and could not find anything.

github-actions[bot] commented 3 days ago

❗ Action required

There are a few problems with your opened issue. Please fix them by editing the issue:

Often the problem you are experiencing will be solved by simply making your environment compliant with the requirements (fulfilling the pre-checks).

🔁 Rerun

After editing the issue, the checks will be run again.

Under no circumstances should the issue be adjusted untruthfully. If the issue cannot fulfill the pre-checks, your environment is simply not supported.

If you do not adjust the issue accordingly, the issue will be automatically closed after 60 days of inactivity.