Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR [pyatv.protocols.companion]: Could not fetch SystemStatus, power_state will not work #308

Closed
6 tasks done
ztalbot2000 opened this issue Mar 8, 2024 · 6 comments
Closed
6 tasks done
Assignees
Labels
bug Something isn't working

Comments

@ztalbot2000
Copy link

ztalbot2000 commented Mar 8, 2024

Preconditions

  • Requirements fulfilled
  • The bug is not a known issue
  • The bug has not been solved in the past or the solution that was provided in the past does not work on my system
  • There is currently no other opened issue that describes this bug
  • I cannot find any solution to the problem in GitHub discussions
  • I am certain that the problem that I am having is a bug

Analysis

I installed homebridge-appletv-enhanced as instructed. I used the config.json you provide. I paired it with my AppleTV with the link in the homebridge.log. I can't determine why the error messages in the homebridge.log and what to do about them to fix the issue, but homebridge keeps restarting.

Expected Behavior

I expect homebridge to not restart

Steps To Reproduce

Nothing special was done, just followed the install instructions

Logs

�[37m[3/8/2024, 10:11:31 AM]�[0m �[36m[HB Supervisor]�[0m OS: Linux 5.10.103-v8+ arm64
�[37m[3/8/2024, 10:11:31 AM]�[0m �[36m[HB Supervisor]�[0m Node.js v20.11.1 /usr/local/bin/node
�[37m[3/8/2024, 10:11:31 AM]�[0m �[36m[HB Supervisor]�[0m Homebridge Path: /var/lib/homebridge/node_modules/homebridge/bin/homebridge
�[37m[3/8/2024, 10:11:31 AM]�[0m �[36m[HB Supervisor]�[0m UI Path: /opt/homebridge/lib/node_modules/homebridge-config-ui-x/dist/bin/standalone.js
�[0;37m[3/8/2024, 10:11:37 AM] �[0m�[0;36m[Homebridge UI]�[0m �[0;33mHomebridge UI v4.55.1 is listening on 0.0.0.0 port 9090�[0m
�[37m[3/8/2024, 10:11:37 AM]�[0m �[36m[HB Supervisor]�[0m Starting Homebridge with extra flags: -P /var/lib/homebridge/node_modules --strict-plugin-resolution
�[37m[3/8/2024, 10:11:37 AM]�[0m �[36m[HB Supervisor]�[0m Starting Homebridge with custom env: {"DEBUG":"*"}
�[37m[3/8/2024, 10:11:37 AM]�[0m �[36m[HB Supervisor]�[0m Started Homebridge v1.7.0 with PID: 2160
2024-03-08T15:11:38.283Z ciao:init Loading ciao v1.1.7...
2024-03-08T15:11:38.719Z HAP-NodeJS:Advertiser Initializing HAP-NodeJS v0.11.1 ...
�[37m[3/8/2024, 10:11:38 AM] �[39mLoaded config.json with 0 accessories and 2 platforms.
�[37m[3/8/2024, 10:11:39 AM] �[39mLoaded 0 cached accessories from cachedAccessories.
�[37m[3/8/2024, 10:11:39 AM] �[39m---
�[37m[3/8/2024, 10:11:39 AM] �[39mLoaded plugin: [email protected]
�[37m[3/8/2024, 10:11:39 AM] �[39mRegistering platform 'homebridge-appletv-enhanced.AppleTVEnhanced'
�[37m[3/8/2024, 10:11:39 AM] �[39m---
�[37m[3/8/2024, 10:11:39 AM] �[39mLoaded plugin: [email protected]
�[37m[3/8/2024, 10:11:39 AM] �[39mRegistering accessory 'homebridge-cmd4.Cmd4'
�[37m[3/8/2024, 10:11:39 AM] �[39mRegistering platform 'homebridge-cmd4.Cmd4'
�[37m[3/8/2024, 10:11:39 AM] �[39m---
�[37m[3/8/2024, 10:11:39 AM] �[39mLoading 2 platforms...
�[37m[3/8/2024, 10:11:39 AM] �[39m�[36m[Apple TV Enhanced]�[39m Initializing AppleTVEnhanced platform...
�[37m[3/8/2024, 10:11:39 AM] �[39m�[36m[Apple TV Enhanced]�[39m Initializing child bridge 0E:B4:3C:FB:64:67
2024-03-08T15:11:39.501Z HAP-NodeJS:Advertiser Preparing Advertiser for 'Homebridge 2024 D9BE' using bonjour-hap backend!
Setup Payload:
X-HM://0024E0B1FH1LQ
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:
�[30m�[47m                       �[49m�[39m
�[30m�[47m    ┌────────────┐     �[49m�[39m
�[30m�[47m    │ 555-55-555 │     �[49m�[39m
�[30m�[47m    └────────────┘     �[49m�[39m
�[30m�[47m                       �[49m�[39m
2024-03-08T15:11:39.520Z HAP-NodeJS:EventedHTTPServer Server listening on [::]:51450
2024-03-08T15:11:39.521Z HAP-NodeJS:Advertiser Starting to advertise 'Homebridge 2024 D9BE' using bonjour-hap backend!
�[37m[3/8/2024, 10:11:39 AM] �[39mHomebridge v1.7.0 (HAP v0.11.1) (Homebridge 2024) is running on port 51450.
2024-03-08T15:11:39.946Z ciao:init Loading ciao v1.1.7...
2024-03-08T15:11:40.303Z HAP-NodeJS:Advertiser Initializing HAP-NodeJS v0.11.1 ...
�[37m[3/8/2024, 10:11:40 AM] �[39m�[36m[Apple TV Enhanced]�[39m Launched child bridge with PID 2171
�[37m[3/8/2024, 10:11:40 AM] �[39mRegistering platform 'homebridge-appletv-enhanced.AppleTVEnhanced'
�[37m[3/8/2024, 10:11:40 AM] �[39m�[36m[Apple TV Enhanced]�[39m Loaded homebridge-appletv-enhanced v1.2.5 child bridge successfully
�[37m[3/8/2024, 10:11:40 AM] �[39mLoaded 0 cached accessories from cachedAccessories.0EB43CFB6467.
�[37m[3/8/2024, 10:11:40 AM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Platform: Finished initializing platform: Apple TV Enhanced
2024-03-08T15:11:40.883Z HAP-NodeJS:Advertiser Preparing Advertiser for 'Apple TV Enhanced 8289' using bonjour-hap backend!
�[37m[3/8/2024, 10:11:40 AM] �[39m�[36m[Apple TV Enhanced]�[39m �[90m[D] Platform: Executed didFinishLaunching callback�[39m
�[37m[3/8/2024, 10:11:40 AM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: Starting python check.
�[37m[3/8/2024, 10:11:40 AM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: plugin dir exists.
2024-03-08T15:11:40.913Z HAP-NodeJS:EventedHTTPServer Server listening on [::]:55110
2024-03-08T15:11:40.915Z HAP-NodeJS:Advertiser Starting to advertise 'Apple TV Enhanced 8289' using bonjour-hap backend!
�[37m[3/8/2024, 10:11:40 AM] �[39mHomebridge v1.7.0 (HAP v0.11.1) (Apple TV Enhanced) is running on port 55110.
�[37m[3/8/2024, 10:11:41 AM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: Python 3.11.6 is installed and supported by the plugin.
�[37m[3/8/2024, 10:11:41 AM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: Virtual environment already exists.
�[37m[3/8/2024, 10:11:41 AM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: Venv is using current system python version (3.11.6).
�[37m[3/8/2024, 10:11:42 AM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: Venv pip version: 24.0
�[37m[3/8/2024, 10:11:42 AM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: Checking if there is an update for venv pip ...
�[37m[3/8/2024, 10:11:43 AM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: Venv pip is up-to-date
�[37m[3/8/2024, 10:11:44 AM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: Python requirements are satisfied.
�[37m[3/8/2024, 10:11:44 AM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: Finished
�[37m[3/8/2024, 10:11:44 AM] �[39m�[36m[Apple TV Enhanced]�[39m �[90m[D] Platform: Setting the storage path of the PyATV instance to /var/lib/homebridge�[39m
�[37m[3/8/2024, 10:11:44 AM] �[39m�[36m[Apple TV Enhanced]�[39m �[90m[D] CustomPyATVInstance: Set atvscript path to "/var/lib/homebridge/appletv-enhanced/.venv/bin/atvscript".�[39m
�[37m[3/8/2024, 10:11:44 AM] �[39m�[36m[Apple TV Enhanced]�[39m �[90m[D] CustomPyATVInstance: Set atvremote path to "/var/lib/homebridge/appletv-enhanced/.venv/bin/atvremote".�[39m
�[37m[3/8/2024, 10:11:44 AM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Platform: Starting device discovery ...
�[37m[3/8/2024, 10:11:44 AM] �[39m�[36m[Apple TV Enhanced]�[39m �[90m[D] Platform: Starting device discovery ...�[39m
�[37m[3/8/2024, 10:11:45 AM] �[39m�[36m[Apple TV Enhanced]�[39m �[90m[D] Update check: The latest Apple TV Enhanced version false is 1.2.5�[39m
�[37m[3/8/2024, 10:11:45 AM] �[39m�[36m[Apple TV Enhanced]�[39m �[90m[D] Update check: You are using the latest version of Apple TV Enhanced (1.2.5)�[39m
�[37m[3/8/2024, 10:12:10 AM] �[39m�[36m[Apple TV Enhanced]�[39m �[90m[D] Platform: finished multicast device discovery�[39m
�[37m[3/8/2024, 10:12:10 AM] �[39m�[36m[Apple TV Enhanced]�[39m �[90m[D] Platform: Found Apple TV Apple TV (Bacement) (40:CB:C0:F4:1F:38 / 192.168.2.32).�[39m
�[37m[3/8/2024, 10:12:10 AM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Platform: Adding Apple TV Apple TV (Bacement) (40:CB:C0:F4:1F:38)
�[37m[3/8/2024, 10:12:10 AM] �[39m�[36m[Apple TV Enhanced]�[39m �[90m[D] Platform: Waiting for Apple TV Apple TV (Bacement) (40:CB:C0:F4:1F:38) to boot ...�[39m
�[37m[3/8/2024, 10:12:10 AM] �[39m�[36m[Apple TV Enhanced]�[39m �[90m[D] Apple TV (Bacement) (40:CB:C0:F4:1F:38): Accessory Config: {"name":"Apple TV Enhanced","mediaTypes":["music","video"],"deviceStates":["paused","playing"],"deviceStateDelay":3,"remoteKeysAsSwitch":["home","play_pause","stop","volume_down","volume_up"],"avadaKedavraAppAmount":15,"customInputURIs":["https://www.disneyplus.com/de-de/movies/avatar-the-way-of-water/6hlsDJnhiU30"],"disableVolumeControlRemote":true,"setTopBox":true,"discover":{"multicast":true},"forceVenvRecreate":false,"logLevel":4,"updateCheckLevel":"stable","deviceSpecificOverrides":[{"mac":"40:cb:c0:f4:1f:38","overrideMediaTypes":true,"mediaTypes":["music","video"],"overrideDeviceStates":true,"deviceStates":["paused","playing"],"overrideDeviceStateDelay":true,"deviceStateDelay":3,"overrideRemoteKeysAsSwitch":true,"remoteKeysAsSwitch":["home","play_pause","stop","volume_down","volume_up"],"overrideAvadaKedavraAppAmount":true,"avadaKedavraAppAmount":15,"overrideCustomInputURIs":true,"customInputURIs":["https://www.disneyplus.com/de-de/movies/avatar-the-way-of-water/6hlsDJnhiU30"],"overrideDisableVolumeControlRemote":true,"disableVolumeControlRemote":true,"overrideSetTopBox":true,"setTopBox":true}],"platform":"AppleTVEnhanced"}�[39m
�[37m[3/8/2024, 10:12:10 AM] �[39m�[36m[Apple TV Enhanced]�[39m �[90m[D] Apple TV (Bacement) (40:CB:C0:F4:1F:38): Loaded credentials: a7425394550ca7169d99dfe644f2b480bd40637c5ac12faea8ee1585ff058255:d6161ec9abd6606fa85c9ffa0c7553d6ff8666c788269ab45c779bdb68dbade4:37344544433435462d433541362d343339372d393745332d374636373439423830443938:35663138383163632d313465632d346662302d626235382d653431633761353838633534�[39m
�[37m[3/8/2024, 10:12:10 AM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Apple TV (Bacement) (40:CB:C0:F4:1F:38): verifying credentials ...
�[37m[3/8/2024, 10:12:10 AM] �[39m�[36m[Apple TV Enhanced]�[39m �[90m[D] Platform: Finished device discovery.�[39m
�[37m[3/8/2024, 10:12:13 AM] �[39m�[36m[Apple TV Enhanced]�[39m �[31m[E] Apple TV (Bacement) (40:CB:C0:F4:1F:38): Unexpected atvremote response: 2024-03-08 10:12:12 ERROR [pyatv.protocols.companion]: Could not fetch SystemStatus, power_state will not work (Command failed: No request handler)�[39m
�[31mTraceback (most recent call last):�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/__init__.py", line 211, in initialize�[39m
�[31m    system_status = await self.api.fetch_attention_state()�[39m
�[31m                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/api.py", line 346, in fetch_attention_state�[39m
�[31m    resp = await self._send_command("FetchAttentionState", {})�[39m
�[31m           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/api.py", line 163, in _send_command�[39m
�[31m    resp = await self._protocol.exchange_opack(�[39m
�[31m           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 154, in exchange_opack�[39m
�[31m    return await self._exchange_generic_opack(frame_type, data, identifier, timeout)�[39m
�[31m           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 175, in _exchange_generic_opack�[39m
�[31m    raise exceptions.ProtocolError(f"Command failed: {unpacked_object['_em']}")�[39m
�[31mpyatv.exceptions.ProtocolError: Command failed: No request handlerApp: Jump & Rush (com.xyrality.jumpandrush), App: Vimeo (com.vimeo), App: EarthCamTV (com.earthcam.earthcamtv), App: Arcade (com.apple.Arcade), App: Adafruit (com.adafruit.Adafruit-TV), App: Hallmark TV (com.hallmarkchannel.everywhere), App: App Store (com.apple.TVAppStore), App: TV Shows (com.apple.TVShows), App: Search (com.apple.TVSearch), App: Global TV (com.canwest.GlobalVideo), App: PAC-MAN 256 (eu.bandainamcoent.pacman256), App: Citytv (com.rogers.CitytvVideo), App: Photos (com.apple.TVPhotos), App: Computers (com.apple.TVHomeSharing), App: Music (com.apple.TVMusic), App: ICI Tou.tv (com.radiocanada.toutv), App: TV (com.apple.TVWatchList), App: Stream Player (com.solidus.streamplayer), App: CBC News (ca.cbc.CBCNews), App: Reuters TV (com.thomsonreuters.reuterstv), App: Fireplace (com.HAG.fireplace), App: Consumer Reports TV (org.consumerreports.tv), App: Apple Events (com.apple.appleevents), App: YouTube (com.google.ios.youtube), App: Movies (com.apple.TVMovies), App: Crave (ca.bellmedia.cravetv), App: Red's Kingdom (com.cobra.redskingdom), App: Fitness (com.apple.Fitness), App: A&E (com.aetn.aetv.ios.watch), App: NASA (gov.nasa.NASA), App: CNN (com.cnn.iphone), App: Netflix (com.netflix.Netflix), App: Nest (com.nestlabs.jasper.release), App: The Weather Network (com.theweathernetwork.twntv), App: Settings (com.apple.TVSettings), App: Treehouse (com.corus.treehouse), App: TestFlight (com.apple.TestFlight), App: The Bat Player (com.gabekangas.thebatplayer.tv), App: Speedtest (com.ookla.speedtest), App: Crackle (com.crackle.crackle-iphone), App: VLC (org.videolan.vlc-ios), App: Infuse 4 (com.firecore.fuse), App: Fibe TV (CA.BELL.FIBEREMOTE), App: The Weather Channel (com.weather.TWC), App: Podcasts (com.apple.podcasts), App: Developer (developer.apple.wwdc-Release), App: Sing! by Smule (com.smule.sing)�[39m
�[37m[3/8/2024, 10:12:13 AM] �[39m�[36m[Apple TV Enhanced]�[39m �[31m[E] Apple TV (Bacement) (40:CB:C0:F4:1F:38): Error: Unexpected atvremote response: 2024-03-08 10:12:12 ERROR [pyatv.protocols.companion]: Could not fetch SystemStatus, power_state will not work (Command failed: No request handler)�[39m
�[31mTraceback (most recent call last):�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/__init__.py", line 211, in initialize�[39m
�[31m    system_status = await self.api.fetch_attention_state()�[39m
�[31m                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/api.py", line 346, in fetch_attention_state�[39m
�[31m    resp = await self._send_command("FetchAttentionState", {})�[39m
�[31m           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/api.py", line 163, in _send_command�[39m
�[31m    resp = await self._protocol.exchange_opack(�[39m
�[31m           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 154, in exchange_opack�[39m
�[31m    return await self._exchange_generic_opack(frame_type, data, identifier, timeout)�[39m
�[31m           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 175, in _exchange_generic_opack�[39m
�[31m    raise exceptions.ProtocolError(f"Command failed: {unpacked_object['_em']}")�[39m
�[31mpyatv.exceptions.ProtocolError: Command failed: No request handlerApp: Jump & Rush (com.xyrality.jumpandrush), App: Vimeo (com.vimeo), App: EarthCamTV (com.earthcam.earthcamtv), App: Arcade (com.apple.Arcade), App: Adafruit (com.adafruit.Adafruit-TV), App: Hallmark TV (com.hallmarkchannel.everywhere), App: App Store (com.apple.TVAppStore), App: TV Shows (com.apple.TVShows), App: Search (com.apple.TVSearch), App: Global TV (com.canwest.GlobalVideo), App: PAC-MAN 256 (eu.bandainamcoent.pacman256), App: Citytv (com.rogers.CitytvVideo), App: Photos (com.apple.TVPhotos), App: Computers (com.apple.TVHomeSharing), App: Music (com.apple.TVMusic), App: ICI Tou.tv (com.radiocanada.toutv), App: TV (com.apple.TVWatchList), App: Stream Player (com.solidus.streamplayer), App: CBC News (ca.cbc.CBCNews), App: Reuters TV (com.thomsonreuters.reuterstv), App: Fireplace (com.HAG.fireplace), App: Consumer Reports TV (org.consumerreports.tv), App: Apple Events (com.apple.appleevents), App: YouTube (com.google.ios.youtube), App: Movies (com.apple.TVMovies), App: Crave (ca.bellmedia.cravetv), App: Red's Kingdom (com.cobra.redskingdom), App: Fitness (com.apple.Fitness), App: A&E (com.aetn.aetv.ios.watch), App: NASA (gov.nasa.NASA), App: CNN (com.cnn.iphone), App: Netflix (com.netflix.Netflix), App: Nest (com.nestlabs.jasper.release), App: The Weather Network (com.theweathernetwork.twntv), App: Settings (com.apple.TVSettings), App: Treehouse (com.corus.treehouse), App: TestFlight (com.apple.TestFlight), App: The Bat Player (com.gabekangas.thebatplayer.tv), App: Speedtest (com.ookla.speedtest), App: Crackle (com.crackle.crackle-iphone), App: VLC (org.videolan.vlc-ios), App: Infuse 4 (com.firecore.fuse), App: Fibe TV (CA.BELL.FIBEREMOTE), App: The Weather Channel (com.weather.TWC), App: Podcasts (com.apple.podcasts), App: Developer (developer.apple.wwdc-Release), App: Sing! by Smule (com.smule.sing)�[39m
�[31m    at V.<anonymous> (/var/lib/homebridge/node_modules/homebridge-appletv-enhanced/node_modules/@sebbo2002/node-pyatv/src/lib/device.ts:408:19)�[39m
�[31m    at Generator.next (<anonymous>)�[39m
�[31m    at o (/var/lib/homebridge/node_modules/homebridge-appletv-enhanced/node_modules/@sebbo2002/node-pyatv/dist/lib/index.cjs:1:627)�[39m
�[31m    at processTicksAndRejections (node:internal/process/task_queues:95:5)�[39m
�[37m[3/8/2024, 10:12:13 AM] �[39m�[36m[Apple TV Enhanced]�[39m �[33mChild bridge process ended�[39m
�[37m[3/8/2024, 10:12:13 AM] �[39m�[36m[Apple TV Enhanced]�[39m Process Ended. Code: 1, Signal: null
�[37m[3/8/2024, 10:12:20 AM] �[39m�[36m[Apple TV Enhanced]�[39m Restarting Process...

Configuration

{
    "bridge": {
        "name": "Homebridge 2024",
        "username": "0E:DA:6A:09:19:38",
        "port": 51450,
        "pin": "555-55-555"
    },
    "platforms": [
        {
            "name": "Config",
            "port": 9090,
            "platform": "config",
            "ssl": {
                "key": "ssl/private/SixtyFiveStableWay.key",
                "cert": "ssl/private/SixtyFiveStableWay.crt"
            }
        },
        {
            "name": "Apple TV Enhanced",
            "mediaTypes": [
                "music",
                "tv",
                "unknown",
                "video"
            ],
            "deviceStates": [
                "idle",
                "loading",
                "paused",
                "playing",
                "seeking",
                "stopped"
            ],
            "deviceStateDelay": 0,
            "remoteKeysAsSwitch": [
                "channel_down",
                "channel_up",
                "down",
                "home",
                "home_hold",
                "left",
                "menu",
                "next",
                "pause",
                "play",
                "play_pause",
                "previous",
                "right",
                "select",
                "skip_backward",
                "skip_forward",
                "stop",
                "turn_off",
                "turn_on",
                "top_menu",
                "up",
                "volume_down",
                "volume_up"
            ],
            "avadaKedavraAppAmount": 5,
            "customInputURIs": [
                "https://www.disneyplus.com/movies/rogue-one-a-star-wars-story/14CV6eSbygOA",
                "https://www.netflix.com/watch/81260280",
                "https://tv.apple.com/show/silo/umc.cmc.3yksgc857px0k0rqe5zd4jice",
                "vlc://https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8"
            ],
            "disableVolumeControlRemote": false,
            "setTopBox": false,
            "discover": {
                "multicast": true
            },
            "forceVenvRecreate": false,
            "logLevel": 4,
            "updateCheckLevel": "stable",
            "deviceSpecificOverrides": [
                {
                    "mac": "40:cb:c0:f4:1f:38",
                    "overrideMediaTypes": true,
                    "mediaTypes": [
                        "music",
                        "video"
                    ],
                    "overrideDeviceStates": true,
                    "deviceStates": [
                        "paused",
                        "playing"
                    ],
                    "overrideDeviceStateDelay": true,
                    "deviceStateDelay": 3,
                    "overrideRemoteKeysAsSwitch": true,
                    "remoteKeysAsSwitch": [
                        "home",
                        "play_pause",
                        "stop",
                        "volume_down",
                        "volume_up"
                    ],
                    "overrideAvadaKedavraAppAmount": true,
                    "avadaKedavraAppAmount": 15,
                    "overrideCustomInputURIs": true,
                    "customInputURIs": [
                        "https://www.disneyplus.com/de-de/movies/avatar-the-way-of-water/6hlsDJnhiU30"
                    ],
                    "overrideDisableVolumeControlRemote": true,
                    "disableVolumeControlRemote": true,
                    "overrideSetTopBox": true,
                    "setTopBox": true
                }
            ],
            "_bridge": {
                "username": "0E:B4:3C:FB:64:67",
                "port": 55110
            },
            "platform": "AppleTVEnhanced"
        }
    ],
    "accessories": []
}

Operating System

Linux

Operating System: Bits

64-bit

Operating System: Distribution

NAME="Debian GNU/Linux"

Operating System: Distribution Version

VERSION="11 (bullseye)"

Docker

no

Docker Image

None

Docker Image Tag

No response

Homebridge Version

1.7.0

Homebridge Config UI Version

v4.55.1

Homebridge Storage Path

/var/lib/homebridge

Homebridge Apple TV Enhanced Version

1.2.5

Node Version

v20.11.1

NPM Version

10.2.4

Python Version

3.11.6

PIP Version

24.0.0

HDMI Hops

None

Audio Output

no

Same Subnet

yes

Additional Context

No response

@ztalbot2000 ztalbot2000 added the bug Something isn't working label Mar 8, 2024
@github-actions github-actions bot added the bad request The bug report or question does not have the expected information label Mar 8, 2024
Copy link

github-actions bot commented Mar 8, 2024

✔️ Have a coffee ☕

Your opened issue fulfills all requirements validated in the pre-checks 🎉

My master will take a look at the problem as soon as he has the time for it 🤖

Time to get a coffee ☕

@github-actions github-actions bot removed the bad request The bug report or question does not have the expected information label Mar 8, 2024
@ztalbot2000
Copy link
Author

ztalbot2000 commented Mar 9, 2024

So I did a brand new install of PiOs on a Pi3. Unfortunately it reproduced the problem. The homebridge.log is below.

uname -a
Linux raspberrypi 6.1.0-rpi8-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.73-1+rpt1 (2024-01-25) aarch64 GNU/Linux

I may have a weird observation. After installing homebridge-appletv-enhanced on the new Pi and waiting awhile for all the python libraries it uses to be downloaded, I do not remember seeing homebridge continually restart. To get the 4 digit code needed to pair with AppleTV, I plugged the output of my AppleTV into the secondary output of my monitor. I had brought my AppleTV upstairs for testing and run up and down all the time. I believe only when I plugged the computer monitor into the AppleTV did the errors then occur. I'm going to try and reconfirm this.

�[37m[3/9/2024, 12:39:56 PM]�[0m �[36m[HB Supervisor]�[0m Restarting Homebridge...
�[37m[3/9/2024, 12:39:56 PM]�[0m �[36m[HB Supervisor]�[0m Starting Homebridge with extra flags: -I -P /var/lib/homebridge/node_modules --strict-plugin-resolution
�[37m[3/9/2024, 12:39:56 PM]�[0m �[36m[HB Supervisor]�[0m Started Homebridge v1.7.0 with PID: 1865
�[37m[3/9/2024, 12:39:58 PM] �[39mLoaded config.json with 0 accessories and 2 platforms.
�[37m[3/9/2024, 12:39:58 PM] �[39mLoaded 0 cached accessories from cachedAccessories.
�[37m[3/9/2024, 12:39:58 PM] �[39m---
�[37m[3/9/2024, 12:39:58 PM] �[39mLoaded plugin: [email protected]
�[37m[3/9/2024, 12:39:58 PM] �[39mRegistering platform 'homebridge-appletv-enhanced.AppleTVEnhanced'
�[37m[3/9/2024, 12:39:58 PM] �[39m---
�[37m[3/9/2024, 12:39:59 PM] �[39mLoaded plugin: [email protected]
�[37m[3/9/2024, 12:39:59 PM] �[39mRegistering accessory 'homebridge-cmd4.Cmd4'
�[37m[3/9/2024, 12:39:59 PM] �[39mRegistering platform 'homebridge-cmd4.Cmd4'
�[37m[3/9/2024, 12:39:59 PM] �[39m---
�[37m[3/9/2024, 12:39:59 PM] �[39mLoading 2 platforms...
�[37m[3/9/2024, 12:39:59 PM] �[39m�[36m[Apple TV Enhanced]�[39m Initializing AppleTVEnhanced platform...
�[37m[3/9/2024, 12:39:59 PM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Platform: Finished initializing platform: Apple TV Enhanced
�[37m[3/9/2024, 12:39:59 PM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: Starting python check.
�[37m[3/9/2024, 12:39:59 PM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: plugin dir exists.
Setup Payload:
X-HM://0024KMGFEO3SD
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:
�[30m�[47m                       �[49m�[39m
�[30m�[47m    ┌────────────┐     �[49m�[39m
�[30m�[47m    │ 666-66-666 │     �[49m�[39m
�[30m�[47m    └────────────┘     �[49m�[39m
�[30m�[47m                       �[49m�[39m
�[37m[3/9/2024, 12:39:59 PM] �[39mHomebridge v1.7.0 (HAP v0.11.1) (Homebridge Pi3 2024) is running on port 51452.
�[37m[3/9/2024, 12:39:59 PM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: Python 3.11.2 is installed and supported by the plugin.
�[37m[3/9/2024, 12:39:59 PM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: Virtual environment already exists.
�[37m[3/9/2024, 12:39:59 PM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: Venv is using current system python version (3.11.2).
�[37m[3/9/2024, 12:40:01 PM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: Venv pip version: 24.0
�[37m[3/9/2024, 12:40:01 PM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: Checking if there is an update for venv pip ...
�[37m[3/9/2024, 12:40:01 PM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: Venv pip is up-to-date
�[37m[3/9/2024, 12:40:04 PM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: Python requirements are satisfied.
�[37m[3/9/2024, 12:40:04 PM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Python check: Finished
�[37m[3/9/2024, 12:40:04 PM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Platform: Starting device discovery ...
�[37m[3/9/2024, 12:40:12 PM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Platform: Adding Apple TV Apple TV (Bacement) (40:CB:C0:F4:1F:38)
�[37m[3/9/2024, 12:40:12 PM] �[39m�[36m[Apple TV Enhanced]�[39m [I] Apple TV (Bacement) (40:CB:C0:F4:1F:38): verifying credentials ...
�[37m[3/9/2024, 12:40:15 PM] �[39m�[36m[Apple TV Enhanced]�[39m �[31m[E] Apple TV (Bacement) (40:CB:C0:F4:1F:38): Unexpected atvremote response: 2024-03-09 12:40:15 ERROR [pyatv.protocols.companion]: Could not fetch SystemStatus, power_state will not work (Command failed: No request handler)�[39m
�[31mTraceback (most recent call last):�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/__init__.py", line 211, in initialize�[39m
�[31m    system_status = await self.api.fetch_attention_state()�[39m
�[31m                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/api.py", line 346, in fetch_attention_state�[39m
�[31m    resp = await self._send_command("FetchAttentionState", {})�[39m
�[31m           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/api.py", line 163, in _send_command�[39m
�[31m    resp = await self._protocol.exchange_opack(�[39m
�[31m           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 154, in exchange_opack�[39m
�[31m    return await self._exchange_generic_opack(frame_type, data, identifier, timeout)�[39m
�[31m           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 175, in _exchange_generic_opack�[39m
�[31m    raise exceptions.ProtocolError(f"Command failed: {unpacked_object['_em']}")�[39m
�[31mpyatv.exceptions.ProtocolError: Command failed: No request handlerApp: Jump & Rush (com.xyrality.jumpandrush), App: Vimeo (com.vimeo), App: EarthCamTV (com.earthcam.earthcamtv), App: Arcade (com.apple.Arcade), App: Adafruit (com.adafruit.Adafruit-TV), App: Hallmark TV (com.hallmarkchannel.everywhere), App: App Store (com.apple.TVAppStore), App: TV Shows (com.apple.TVShows), App: Search (com.apple.TVSearch), App: Global TV (com.canwest.GlobalVideo), App: PAC-MAN 256 (eu.bandainamcoent.pacman256), App: Citytv (com.rogers.CitytvVideo), App: Photos (com.apple.TVPhotos), App: Computers (com.apple.TVHomeSharing), App: Music (com.apple.TVMusic), App: ICI Tou.tv (com.radiocanada.toutv), App: TV (com.apple.TVWatchList), App: Stream Player (com.solidus.streamplayer), App: CBC News (ca.cbc.CBCNews), App: Reuters TV (com.thomsonreuters.reuterstv), App: Fireplace (com.HAG.fireplace), App: Consumer Reports TV (org.consumerreports.tv), App: Apple Events (com.apple.appleevents), App: YouTube (com.google.ios.youtube), App: Movies (com.apple.TVMovies), App: Crave (ca.bellmedia.cravetv), App: Red's Kingdom (com.cobra.redskingdom), App: Fitness (com.apple.Fitness), App: A&E (com.aetn.aetv.ios.watch), App: NASA (gov.nasa.NASA), App: CNN (com.cnn.iphone), App: Netflix (com.netflix.Netflix), App: Nest (com.nestlabs.jasper.release), App: The Weather Network (com.theweathernetwork.twntv), App: Settings (com.apple.TVSettings), App: Treehouse (com.corus.treehouse), App: TestFlight (com.apple.TestFlight), App: The Bat Player (com.gabekangas.thebatplayer.tv), App: Speedtest (com.ookla.speedtest), App: Crackle (com.crackle.crackle-iphone), App: VLC (org.videolan.vlc-ios), App: Infuse 4 (com.firecore.fuse), App: Fibe TV (CA.BELL.FIBEREMOTE), App: The Weather Channel (com.weather.TWC), App: Podcasts (com.apple.podcasts), App: Developer (developer.apple.wwdc-Release), App: Sing! by Smule (com.smule.sing)�[39m
�[37m[3/9/2024, 12:40:16 PM] �[39m�[36m[Apple TV Enhanced]�[39m �[31m[E] Apple TV (Bacement) (40:CB:C0:F4:1F:38): Error: Unexpected atvremote response: 2024-03-09 12:40:15 ERROR [pyatv.protocols.companion]: Could not fetch SystemStatus, power_state will not work (Command failed: No request handler)�[39m
�[31mTraceback (most recent call last):�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/__init__.py", line 211, in initialize�[39m
�[31m    system_status = await self.api.fetch_attention_state()�[39m
�[31m                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/api.py", line 346, in fetch_attention_state�[39m
�[31m    resp = await self._send_command("FetchAttentionState", {})�[39m
�[31m           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/api.py", line 163, in _send_command�[39m
�[31m    resp = await self._protocol.exchange_opack(�[39m
�[31m           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 154, in exchange_opack�[39m
�[31m    return await self._exchange_generic_opack(frame_type, data, identifier, timeout)�[39m
�[31m           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[39m
�[31m  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 175, in _exchange_generic_opack�[39m
�[31m    raise exceptions.ProtocolError(f"Command failed: {unpacked_object['_em']}")�[39m
�[31mpyatv.exceptions.ProtocolError: Command failed: No request handlerApp: Jump & Rush (com.xyrality.jumpandrush), App: Vimeo (com.vimeo), App: EarthCamTV (com.earthcam.earthcamtv), App: Arcade (com.apple.Arcade), App: Adafruit (com.adafruit.Adafruit-TV), App: Hallmark TV (com.hallmarkchannel.everywhere), App: App Store (com.apple.TVAppStore), App: TV Shows (com.apple.TVShows), App: Search (com.apple.TVSearch), App: Global TV (com.canwest.GlobalVideo), App: PAC-MAN 256 (eu.bandainamcoent.pacman256), App: Citytv (com.rogers.CitytvVideo), App: Photos (com.apple.TVPhotos), App: Computers (com.apple.TVHomeSharing), App: Music (com.apple.TVMusic), App: ICI Tou.tv (com.radiocanada.toutv), App: TV (com.apple.TVWatchList), App: Stream Player (com.solidus.streamplayer), App: CBC News (ca.cbc.CBCNews), App: Reuters TV (com.thomsonreuters.reuterstv), App: Fireplace (com.HAG.fireplace), App: Consumer Reports TV (org.consumerreports.tv), App: Apple Events (com.apple.appleevents), App: YouTube (com.google.ios.youtube), App: Movies (com.apple.TVMovies), App: Crave (ca.bellmedia.cravetv), App: Red's Kingdom (com.cobra.redskingdom), App: Fitness (com.apple.Fitness), App: A&E (com.aetn.aetv.ios.watch), App: NASA (gov.nasa.NASA), App: CNN (com.cnn.iphone), App: Netflix (com.netflix.Netflix), App: Nest (com.nestlabs.jasper.release), App: The Weather Network (com.theweathernetwork.twntv), App: Settings (com.apple.TVSettings), App: Treehouse (com.corus.treehouse), App: TestFlight (com.apple.TestFlight), App: The Bat Player (com.gabekangas.thebatplayer.tv), App: Speedtest (com.ookla.speedtest), App: Crackle (com.crackle.crackle-iphone), App: VLC (org.videolan.vlc-ios), App: Infuse 4 (com.firecore.fuse), App: Fibe TV (CA.BELL.FIBEREMOTE), App: The Weather Channel (com.weather.TWC), App: Podcasts (com.apple.podcasts), App: Developer (developer.apple.wwdc-Release), App: Sing! by Smule (com.smule.sing)�[39m
�[31m    at V.<anonymous> (/var/lib/homebridge/node_modules/homebridge-appletv-enhanced/node_modules/@sebbo2002/node-pyatv/src/lib/device.ts:408:19)�[39m
�[31m    at Generator.next (<anonymous>)�[39m
�[31m    at o (/var/lib/homebridge/node_modules/homebridge-appletv-enhanced/node_modules/@sebbo2002/node-pyatv/dist/lib/index.cjs:1:627)�[39m
�[31m    at processTicksAndRejections (node:internal/process/task_queues:95:5)�[39m
�[37m[3/9/2024, 12:40:16 PM]�[0m �[36m[HB Supervisor]�[0m Homebridge Process Ended. Code: 1, Signal: null
�[37m[3/9/2024, 12:40:21 PM]�[0m �[36m[HB Supervisor]�[0m Restarting Homebridge...

@ztalbot2000
Copy link
Author

So my latest update is that I connected the AppleTV to a real tv. The same error happens as above as soon as appletv-enhanced is paired with the AppleTV.
Now I've tried this on my old Pi, a freshly installed Pi 3 with 2023-12-05-raspios-bookworm-arm64.img.xz that's been fully updated and now also on my Mac Mini. Everything results in the original error.

@ztalbot2000
Copy link
Author

OK. Fixed it. I needed to upgrade the AppleTV software. Doh! Maybe add this as an item to enter when filling out the bug form? My AppleTV was set to automatically update but I guess it had not for a long time.

@maxileith
Copy link
Owner

maxileith commented Mar 9, 2024

@ztalbot2000 thanks for letting me know. I was looking at this issue just now. This pretty much seems to be an unknown error. This issue has not even been reported in the pyatv repository.

Could you tell me the TvOS version of the Apple TV before updating?

@ztalbot2000
Copy link
Author

ztalbot2000 commented Mar 9, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants