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

Accessory "Apple TV" does not "turn on" with native remote #155

Closed
rvetere opened this issue Jan 2, 2024 · 52 comments
Closed

Accessory "Apple TV" does not "turn on" with native remote #155

rvetere opened this issue Jan 2, 2024 · 52 comments
Assignees
Labels
bug Something isn't working

Comments

@rvetere
Copy link

rvetere commented Jan 2, 2024

Analysis

I have successfully installed v1.0.0 of the Plugin, all logs are looking good, the Apple TV is discovered and no error shows up. I also get the Accessory running so far and i can turn it on/off successfully by using the Accessory trough Homebridge.

Now, the thing that i actually want to achieve - i have an automation in place that declines the canvas and turn off all lights when the Apple TV is getting activated.

The automation works great when i turn the Apple TV on trough the Accessory, or with the "Turn On" command - but it's not working great when i just use the native remote.

Expected Behavior

I would like to have a reliable "active state", especially when i use the native remote.

Steps To Reproduce

  1. Setup Apple TV Enhanced (and freshly boot the homebridge/childbridge)
  2. Add the Apple TV Accessory in Homekit
  3. Turn the Apple TV on with the native remote, it works!
  4. Wait for a few hours or one or two days
  5. Coming back to the setup (logs are showing nothing special), turn on the Apple TV with the native remote and watch how the state doesn't change at all!

Logs

[02/01/2024, 08:56:08] [Apple TV Enhanced] Child bridge process ended
[02/01/2024, 08:56:08] [Apple TV Enhanced] Process Ended. Code: 143, Signal: null
[02/01/2024, 08:56:15] [Apple TV Enhanced] Restarting Process...
[02/01/2024, 08:56:15] [Apple TV Enhanced] Launched child bridge with PID 523338
[02/01/2024, 08:56:16] Registering platform 'homebridge-appletv-enhanced.AppleTVEnhanced'
[02/01/2024, 08:56:16] [Apple TV Enhanced] Loaded homebridge-appletv-enhanced v1.0.0 child bridge successfully
[02/01/2024, 08:56:16] Loaded 0 cached accessories from cachedAccessories.0ED7621AE9BD.
[02/01/2024, 08:56:16] [Apple TV Enhanced] Platform: Finished initializing platform: Apple TV Enhanced
[02/01/2024, 08:56:16] [Apple TV Enhanced] Python check: Starting python check.
[02/01/2024, 08:56:16] [Apple TV Enhanced] Python check: plugin dir exists.
[02/01/2024, 08:56:16] Homebridge v1.7.0 (HAP v0.11.1) (Apple TV Enhanced) is running on port 30495.
[02/01/2024, 08:56:16] [Apple TV Enhanced] Python check: Python 3.11.2 is installed and supported by the plugin.
[02/01/2024, 08:56:16] [Apple TV Enhanced] Python check: Virtual environment already exists.
[02/01/2024, 08:56:16] [Apple TV Enhanced] Python check: Venv is using current system python version (3.11.2).
[02/01/2024, 08:56:16] [Apple TV Enhanced] Python check: Checking if pip is up-to-date ...
[02/01/2024, 08:56:34] [Apple TV Enhanced] Python check: Pip is up-to-date
[02/01/2024, 08:56:35] [Apple TV Enhanced] Python check: Python requirements are satisfied.
[02/01/2024, 08:56:35] [Apple TV Enhanced] Python check: Finished
[02/01/2024, 08:56:35] [Apple TV Enhanced] Platform: Starting device discovery ...
[02/01/2024, 08:56:42] [Apple TV Enhanced] Platform: Adding Apple TV Apple TV (C0:95:6D:5F:33:4B)
[02/01/2024, 08:56:42] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): verifying credentials ...
[02/01/2024, 08:56:44] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Credentials are still valid. Continuing ...
[02/01/2024, 08:56:46] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Finished initializing
[02/01/2024, 08:56:46] Apple TV Apple TV 0760 is running on port 45589.
[02/01/2024, 08:56:46] Please add [Apple TV Apple TV 0760] manually in Home app. Setup Code: 770-02-137
[02/01/2024, 08:56:48] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): New Active State: off
[02/01/2024, 08:56:48] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Current App: com.apple.TVMusic

Configuration

{
            "mediaTypes": [
                "music",
                "video"
            ],
            "deviceStates": [
                "idle",
                "paused",
                "playing",
                "stopped"
            ],
            "remoteKeysAsSwitch": [
                "home",
                "turn_off",
                "turn_on",
                "volume_down",
                "volume_up"
            ],
            "customInputURIs": [],
            "discover": {
                "unicast": [],
                "blacklist": [],
                "multicast": true
            },
            "name": "Apple TV Enhanced",
            "deviceStateDelay": 0,
            "avadaKedavraAppAmount": 15,
            "disableVolumeControlRemote": false,
            "forceVenvRecreate": false,
            "logLevel": 3,
            "_bridge": {
                "username": "0E:D7:62:1A:E9:BD",
                "port": 30495
            },
            "platform": "AppleTVEnhanced"
        },

Environment

  • OS: Debian GNU/Linux Bookworm (12)
  • Docker: false
  • Homebridge: 1.7.0
  • Apple TV Enhanced: 1.0.0
  • Node: 20.10.0
  • npm: 10.2.3
  • Python: 3.11.2

Additional Context

Sometimes when i come home after a day, i see the following Warning in the Logs:

Apple TV (C0:95:6D:5F:33:4B): Apple TV can be reached on OSI Layer 2 but not on 3. This is likely a network problem. Restart the plugin after you have fixed the root cause.

Of course, this can be a reason why it suddenly stops working - i just don't know what to fix in my network, because, the network is working fine! I see my Apple TV online in my connected wifi devices with the static IP it always gets

@rvetere rvetere added the bug Something isn't working label Jan 2, 2024
@maxileith
Copy link
Owner

maxileith commented Jan 2, 2024

Do you use HomePod(s) as your default speaker(s)?

@rvetere
Copy link
Author

rvetere commented Jan 3, 2024

No i'm not using my HomePod as default speaker, my projector has a built-in soundbar.

@maxileith
Copy link
Owner

maxileith commented Jan 3, 2024

Please post debug logs from the initial start of the plugin until the problem occurs. Mark the spots where you turn on or off your Apple TV with the original remote in the logs.

@rvetere
Copy link
Author

rvetere commented Jan 4, 2024

So, it is working at your place? Do you know how i can turn on the debug logs?

@maxileith
Copy link
Owner

maxileith commented Jan 4, 2024

You can change the log level of the plugin in the configuration.

So, it is working at your place?

I cannot reproduce the issue on my side.

@maxileith
Copy link
Owner

@rvetere any updates?

@mufler
Copy link

mufler commented Jan 7, 2024

Today I started to experience the same problem described her. Everything works e.g automation with lights, when i turn the Apple TV on through the Accessory, or with the "Turn On" command - but it's not working when i just use the native remote. Logs show no special errors, but the "New Active State: on/off" in the logs is missing when using native remote.

Edit: After making some changes in the plugin (enable/disable some motion sensors) and restarting the plugin, I now see the "New Active State: on/off" in the logs when I use the native remote, and everything is now working.

@felipehjcosta
Copy link

Hey @maxileith, I've changed to Log Level 4 (Debug) as you suggested however any kind of log appears when I use the native remote controller.

@maxileith
Copy link
Owner

however any kind of log appears

Please post the debug logs here.

@maxileith
Copy link
Owner

Logs show no special errors

We are not looking for errors. Please post debug logs here and mark the point where you are turning on / off the Apple TV with the physical remote.

@felipehjcosta
Copy link

felipehjcosta commented Jan 7, 2024

@mufler I've tried what you said but it didn't work. 😢

@maxileith the logs bellow:

[1/7/2024, 10:56:22 AM] [Apple TV Enhanced] Apple TV Living Room (EC:A9:07:21:AD:F9): Rocket Remote: turn_off

>>>>>>>>>>>>> Turn on with physical remote

[1/7/2024, 10:56:49 AM] [Apple TV Enhanced] Platform: Starting device discovery ...

[1/7/2024, 10:56:55 AM] [Apple TV Enhanced] Platform: finished multicast device discovery

[1/7/2024, 10:56:55 AM] [Apple TV Enhanced] Platform: Found Apple TV Living Room (3) (EC:A9:07:21:AD:F9 / 192.168.1.230).

[1/7/2024, 10:56:55 AM] [Apple TV Enhanced] Platform: Apple TV Living Room (3) (EC:A9:07:21:AD:F9) with UUID 87cca5a0-c5dd-4fd6-a927-d3a53f6858aa already exists. Skipping.

[1/7/2024, 10:56:55 AM] [Apple TV Enhanced] Platform: Finished device discovery.

[1/7/2024, 10:56:59 AM] [Apple TV Enhanced] Apple TV Living Room (EC:A9:07:21:AD:F9): Rocket Remote: Skipping heartbeat since last command was only 37s before.

>>>>>>>>>>>>> Turn off with physical remote

[1/7/2024, 10:57:49 AM] [Apple TV Enhanced] Platform: Starting device discovery ...

[1/7/2024, 10:57:55 AM] [Apple TV Enhanced] Platform: finished multicast device discovery

[1/7/2024, 10:57:55 AM] [Apple TV Enhanced] Platform: Found Apple TV Living Room (3) (EC:A9:07:21:AD:F9 / 192.168.1.230).

[1/7/2024, 10:57:55 AM] [Apple TV Enhanced] Platform: Apple TV Living Room (3) (EC:A9:07:21:AD:F9) with UUID 87cca5a0-c5dd-4fd6-a927-d3a53f6858aa already exists. Skipping.

[1/7/2024, 10:57:55 AM] [Apple TV Enhanced] Platform: Finished device discovery.

[1/7/2024, 10:57:59 AM] [Apple TV Enhanced] Apple TV Living Room (EC:A9:07:21:AD:F9): Rocket Remote: app_list

[1/7/2024, 10:57:59 AM] [Apple TV Enhanced] Apple TV Living Room (EC:A9:07:21:AD:F9): Rocket Remote: App: Arcade (com.apple.Arcade), App: App Store (com.apple.TVAppStore), App: Twitch (tv.twitch), App: Buscar (com.apple.TVSearch), App: Fotos (com.apple.TVPhotos), App: Computadores (com.apple.TVHomeSharing), App: Música (com.apple.TVMusic), App: Calm (com.calm.calmapp), App: TV (com.apple.TVWatchList), App: Globoplay (com.globo.hydra), App: Moonlight (com.moonlight-stream.Moonlight), App: PragerU (com.cappital.prageru), App: YouTube (com.google.ios.youtube), App: Filmes (com.apple.TVMovies), App: HBO Max (com.hbo.hbonow), App: Disney+ (com.disney.disneyplus), App: FaceTime (com.apple.facetime), App: Crossy Road (com.hipsterwhale.crossyarcade), App: Fitness (com.apple.Fitness), App: Crunchyroll (com.crunchyroll.iphone), App: Ajustes (com.apple.TVSettings), App: Netflix (com.netflix.Netflix), App: Star+ (com.disney.starplus), App: homeTV (com.panta.Home-TV), App: Speedtest (com.ookla.speedtest), App: JapanRural (jp.gamestart.japaneserural), App: Asphalt 8+ (com.gameloft.asphalt8arcade), App: Angel (com.VidAngel.TheChosen), App: Prime Video (com.amazon.aiv.AIVApp), App: TempleRun+ (com.imangi.templerunplus), App: Podcasts (com.apple.podcasts), App: GRIS+ (com.devolverdigital.com.grisplus), App: Steam Link (com.valvesoftware.SteamLink17)

@maxileith
Copy link
Owner

Do you guys have any HDMI hops between the Apple TV and the television? AV Receiver / HDMI Hub / Hue Sync Box ...

@maxileith
Copy link
Owner

Do you use HomePod(s) as your default speaker(s)?

And it would also be nice if you @felipehjcosta and @mufler could answer this question :)

@felipehjcosta
Copy link

felipehjcosta commented Jan 7, 2024

@maxileith I use 2 HomePods as speakers.

@maxileith
Copy link
Owner

maxileith commented Jan 7, 2024

@maxileith I use 2 HomePods as your speakers.

@felipehjcosta from the README:

  • If using external speakers like HomePods as the default, the Apple TV is always reported as powered on. This is a known issue of the dependency pyatv, see postlund/pyatv#1667. As a result, the Apple TV device will only be shown as off in HomeKit when powered off via the Apple TV device in HomeKit. After restarting the plugin the device will always be shown as on.

@felipehjcosta
Copy link

@maxileith I don't have any HDMI hops between the Apple TV and the television but I have enabled HDMI-CEC on my TV.

@felipehjcosta
Copy link

That's sad. 😢

I will follow the original issue on pyatv thanks!

@maxileith I use 2 HomePods as your speakers.

@felipehjcosta from the README:

  • If using external speakers like HomePods as the default, the Apple TV is always reported as powered on. This is a known issue of the dependency pyatv, see postlund/pyatv#1667. As a result, the Apple TV device will only be shown as off in HomeKit when powered off via the Apple TV device in HomeKit. After restarting the plugin the device will always be shown as on.

@mufler
Copy link

mufler commented Jan 7, 2024

Do you use HomePod(s) as your default speaker(s)?

And it would also be nice if you @felipehjcosta and @mufler could answer this question :)

Hi, I dont have any HDMI hops between the Apple TV and the television. I dont have HomePod either, my speakers are connected to TVs line/headphone out.

@maxileith
Copy link
Owner

Edit: After making some changes in the plugin (enable/disable some motion sensors) and restarting the plugin, I now see the "New Active State: on/off" in the logs when I use the native remote, and everything is now working.

What did you change exactly?

@mufler
Copy link

mufler commented Jan 7, 2024

Edit: After making some changes in the plugin (enable/disable some motion sensors) and restarting the plugin, I now see the "New Active State: on/off" in the logs when I use the native remote, and everything is now working.

What did you change exactly?

Since I didn't have any sensors enabled, I enabled some and disabled all "Remote Keys as Switches" (mainly turn_off and turn_on). I also updated plugin to v1.0.1. Here is my working config:

{
    "mediaTypes": [
        "tv",
        "video"
    ],
    "deviceStates": [
        "idle",
        "paused",
        "playing",
        "stopped"
    ],
    "remoteKeysAsSwitch": [],
    "customInputURIs": [],
    "discover": {
        "unicast": [
            "192.168.x.xxx"
        ],
        "blacklist": [],
        "multicast": true
    },
    "name": "Apple TV Enhanced",
    "deviceStateDelay": 0,
    "avadaKedavraAppAmount": 10,
    "disableVolumeControlRemote": false,
    "forceVenvRecreate": false,
    "logLevel": 3,
    "platform": "AppleTVEnhanced"
}

@maxileith
Copy link
Owner

Since I didn't have any sensors enabled, I enabled some and disabled all "Remote Keys as Switches" (mainly turn_off and turn_on). I also updated plugin to v1.0.1. Here is my working config:

Weird that shouldn't change anything regarding the active state. Thanks for letting me know.

@rvetere
Copy link
Author

rvetere commented Jan 8, 2024

Hey everybody, here i deliver my debug logs as i found out now what is the debug-level (4!, it's nowhere documented here..)

I can already say - no, i have no HDMI hops between my Apple TV and my Epson Beamer, but i too activated "HDMI-CEC" to sync the volume from my apple-tv remote to my beamer.

After i personally started investigation "how to determine if an Apple TV is running", i came up with the idea to develop a small App for Apple TV, which then could be used to expose something like an API for this plugin - maybe much stabler..? How did you implement your "active" state anyway?

So, my homebridge is running since ~4 hours now, apple TV is turned off and the Accessory in Homebridge has "active state = false". Now i just hit my apple remote power button, Apple TV turns on, the Accessory doesn't change at all and these are my logs:

[08/01/2024, 11:10:57] [Apple TV Enhanced] Platform: Starting device discovery ...
[08/01/2024, 11:11:04] [Apple TV Enhanced] Platform: finished multicast device discovery
[08/01/2024, 11:11:04] [Apple TV Enhanced] Platform: Found Apple TV Apple TV (C0:95:6D:5F:33:4B / 192.168.1.186).
[08/01/2024, 11:11:04] [Apple TV Enhanced] Platform: Apple TV Apple TV (C0:95:6D:5F:33:4B) with UUID 6c0c9b54-1717-4339-a7a5-5f676de7d85e already exists. Skipping.
[08/01/2024, 11:11:04] [Apple TV Enhanced] Platform: Finished device discovery.
[08/01/2024, 11:11:04] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): event mediaType: null
[08/01/2024, 11:11:04] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): event deviceState: null
[08/01/2024, 11:11:04] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): event appId: null
[08/01/2024, 11:11:08] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Rocket Remote: app_list
[08/01/2024, 11:11:08] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Rocket Remote: App: Fitness (com.apple.Fitness), App: Podcasts (com.apple.podcasts), App: Filme (com.apple.TVMovies), App: Prime Video (com.amazon.aiv.AIVApp), App: TV (com.apple.TVWatchList), App: Fotos (com.apple.TVPhotos), App: App Store (com.apple.TVAppStore), App: Play SRF (ch.srf.srfplayer), App: Sky (com.homedia.sky), App: Arcade (com.apple.Arcade), App: Suchen (com.apple.TVSearch), App: Computer (com.apple.TVHomeSharing), App: FaceTime (com.apple.facetime), App: ARTE (tv.arte.plus7), App: YouTube (com.google.ios.youtube), App: PlaySuisse (ch.srgssr.playsuisse.tv), App: Speedtest (com.ookla.speedtest), App: Disney+ (com.disney.disneyplus), App: Einstellungen (com.apple.TVSettings), App: Netflix (com.netflix.Netflix), App: Musik (com.apple.TVMusic)

Nothing special to see i guess, except the "event deviceState: null", null is not the state i'm looking for as the device is running :-/

Update: i can see in the logs how the "device discovery" is started again and still no luck to determine the correct state of "active = true", but my Apple TV is still turned on 😢

Update2: Now if i restart the childbridge of "Apple TV Enhanced", it detects the correct state with "idle", these are the logs:

[08/01/2024, 11:15:44] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Total services 37 (63 remaining)
[08/01/2024, 11:15:44] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Input display order: AQQqAAAAAAABBEUAAAAAAAEEqR2slgAAAQTSES6KAAABBC+TeUUAAAEEI3mIcwAAAQS1RH+fAAABBAi7f0QAAAEEFd14AQAAAQSE4v5+AAABBAC9K3cAAAEEkoQKvQAAAQR+Wd4JAAABBMw0gMcAAAEEpINglgAAAQT4YCitAAABBPkIFVAAAAEEycHdRAAAAQR6mctTAAABBD3f/zEAAAEEbtL2SAAAAQQO7f9OAAABBECjf9A=
[08/01/2024, 11:15:44] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): recreating listeners
[08/01/2024, 11:15:44] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): recreating rocket remote
[08/01/2024, 11:15:44] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Rocket Remote: creating
[08/01/2024, 11:15:44] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Finished initializing
[08/01/2024, 11:15:44] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Reporting as booted.
[08/01/2024, 11:15:44] [Apple TV Enhanced] Platform: Apple TV Apple TV (C0:95:6D:5F:33:4B) finished booting. Publishing the accessory now.
[08/01/2024, 11:15:44] Apple TV Apple TV 0760 is running on port 39921.
[08/01/2024, 11:15:44] Please add [Apple TV Apple TV 0760] manually in Home app. Setup Code: 770-02-137
[08/01/2024, 11:15:46] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Rocket Remote: Enter commands and press enter
Type help for help and exit to quit
[08/01/2024, 11:15:46] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): event powerState: on
[08/01/2024, 11:15:46] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): New Active State: on
[08/01/2024, 11:15:46] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): event powerState: null
[08/01/2024, 11:15:46] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): event mediaType: unknown
[08/01/2024, 11:15:46] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): New Media Type State: unknown
[08/01/2024, 11:15:46] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): event deviceState: idle
[08/01/2024, 11:15:46] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): New Device State Draft (might be discarded if there are state changes until the configured delay of 
0ms is over): idle
[08/01/2024, 11:15:46] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): New Device State: idle
[08/01/2024, 11:16:32] [Apple TV Enhanced] Platform: Starting device discovery ...
[08/01/2024, 11:16:39] [Apple TV Enhanced] Platform: finished multicast device discovery
[08/01/2024, 11:16:39] [Apple TV Enhanced] Platform: Found Apple TV Apple TV (C0:95:6D:5F:33:4B / 192.168.1.186).
[08/01/2024, 11:16:39] [Apple TV Enhanced] Platform: Apple TV Apple TV (C0:95:6D:5F:33:4B) with UUID 6c0c9b54-1717-4339-a7a5-5f676de7d85e already exists. Skipping.
[08/01/2024, 11:16:39] [Apple TV Enhanced] Platform: Finished device discovery.
[08/01/2024, 11:16:44] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Rocket Remote: app_list
[08/01/2024, 11:16:44] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Rocket Remote: App: Fitness (com.apple.Fitness), App: Podcasts (com.apple.podcasts), App: Filme (com.apple.TVMovies), App: Prime Video (com.amazon.aiv.AIVApp), App: TV (com.apple.TVWatchList), App: Fotos (com.apple.TVPhotos), App: App Store (com.apple.TVAppStore), App: Play SRF (ch.srf.srfplayer), App: Sky (com.homedia.sky), App: Arcade (com.apple.Arcade), App: Suchen (com.apple.TVSearch), App: Computer (com.apple.TVHomeSharing), App: FaceTime (com.apple.facetime), App: ARTE (tv.arte.plus7), App: YouTube (com.google.ios.youtube), App: PlaySuisse (ch.srgssr.playsuisse.tv), App: Speedtest (com.ookla.speedtest), App: Disney+ (com.disney.disneyplus), App: Einstellungen (com.apple.TVSettings), App: Netflix (com.netflix.Netflix), App: Musik (com.apple.TVMusic)

PS: maybe to cheer you up a bit - i have tried all available "Android TV" plugins too as my beamer would have an android tv platform... Not one of them can determine an active state reliably, it is the same behavior with everyone... it works from the beginning, and just breaks silently after one day running :D I'm now investigating if there are smart plugs available for homekit where i can trigger on a certain amount of power consumption (THAT would be the ONLY reliable trigger i guess which also works after one year running :D)

@mufler cool you got it working at your place now - but just wait now for 3-4 hours or a day... and, does it still work then? i'm pretty sure it will break again (i'm in the same situation, it works from a fresh start, but not anymore after 1 day active)

@maxileith
Copy link
Owner

maxileith commented Jan 8, 2024

@rvetere thank you for providing the logs 👍🏻

Hey everybody, here i deliver my debug logs as i found out now what is the debug-level (4!, it's nowhere documented here..)

It is documented in the config.schema.json which is displayed when using the Cofnig UI 😉

image

After i personally started investigation "how to determine if an Apple TV is running", i came up with the idea to develop a small App for Apple TV, which then could be used to expose something like an API for this plugin - maybe much stabler..? How did you implement your "active" state anyway?

Way too much overhead ... this can definetly be determined the way I am currently doing it. At my side it is rock solid.

How did you implement your "active" state anyway?

Just look at the source code, this is what FOSS is all about 😉

this.device.on('update:powerState', powerStateListener);

"event deviceState: null", null is not the state i'm looking for as the device is running :-/

What do you mean with "running"? Is music/video playing? If not, this is the expected behaviour.


What I need you to do @rvetere: Send me the output of /var/lib/homebridge/appletv-enhanced/.venv/bin/atvscript -s xxx.xxx.xxx.xxx push_updates where xxx.xxx.xxx.xxx is the IP of your Apple TV. Then turn on / off your Apple TV a few times and post the logs here. (assuming /var/lib/homebridge is your homebridge dir)

It may be the case that the output of this script differs wether or not one has a HDMI CEC setup or not.

@maxileith maxileith self-assigned this Jan 8, 2024
@rvetere
Copy link
Author

rvetere commented Jan 8, 2024

oh, when i just execute this script you told me, i become an exception:

{"result": "failure", "datetime": "2024-01-08T17:22:00.974243+01:00", "exception": "power_state is not supported", "stacktrace": "Traceback (most recent call last):\n  File \"/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/scripts/atvscript.py\", line 393, in appstart\n    args.output(await _handle_command(args, abort_sem, storage, loop)),\n                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/scripts/atvscript.py\", line 275, in _handle_command\n    return await _run_command(atv, args, abort_sem, loop)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/scripts/atvscript.py\", line 304, in _run_command\n    output(True, values={\"power_state\": atv.power.power_state.name.lower()})\n                                        ^^^^^^^^^^^^^^^^^^^^^\n  File \"/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/support/shield.py\", line 72, in _guard_method\n    return func(self, *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/core/facade.py\", line 320, in power_state\n    return self.relay(\"power_state\")\n           ^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/core/relayer.py\", line 90, in relay\n    instance = self._find_instance(\n               ^^^^^^^^^^^^^^^^^^^^\n  File \"/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/core/relayer.py\", line 114, in _find_instance\n    raise exceptions.NotSupportedError(f\"{target} is not supported\")\npyatv.exceptions.NotSupportedError: power_state is not supported\n"}

What do you mean with "running"? Is music/video playing? If not, this is the expected behaviour.

Ah no, nothing was playing, so then the state would be correct :)

And sorry about the loglevel rant :D i was only in the json config and never checked the UI again, and here in the readme i was looking for a little description about logLevel and couldn't find one

@maxileith
Copy link
Owner

@rvetere maybe there is something wrong with the credentials ... can you delete the file /var/lib/homebridge/appletv-enhanced/AABBCCDDEEFF/credentials.txt where AABBCCDDEEFF is the MAC address of your Apple TV. You will need to pair your Apple TV with the plugin after restart again. Don´t worry, the homebridge accessory will still be paired with HomeKit.

@rvetere
Copy link
Author

rvetere commented Jan 8, 2024

ok i killed all stored credentials, also resetted the cached accessory and also recreated the venv... but i still get the same exception when i try to execute the atvscript...

@rvetere
Copy link
Author

rvetere commented Jan 8, 2024

Mhm, after playing around more i got this error now when i turned the apple tv on with the accessory (it turned on successfully, but did not change state to "on")

[08/01/2024, 21:50:41] [homebridge-appletv-enhanced] This plugin threw an error from the characteristic 'Active': Unhandled error thrown inside write handler for characteristic: Got pyatv Error: Command _systemInfo failed

pyatv Stacktrace:
Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/tasks.py", line 490, in wait_for
    return fut.result()
           ^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/locks.py", line 213, in wait
    await fut
asyncio.exceptions.CancelledError

The 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/protocols/companion/api.py", line 163, in _send_command
    resp = await self._protocol.exchange_opack(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 154, in exchange_opack
    return await self._exchange_generic_opack(frame_type, data, identifier, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 167, in _exchange_generic_opack
    unpacked_object = await self._queues[identifier].wait(timeout)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/support/collections.py", line 160, in wait
    await asyncio.wait_for(self._event.wait(), timeout)
  File "/usr/lib/python3.11/asyncio/tasks.py", line 492, in wait_for
    raise exceptions.TimeoutError() from exc
TimeoutError

The 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/atvscript.py", line 393, in appstart
    args.output(await _handle_command(args, abort_sem, storage, loop)),
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/scripts/atvscript.py", line 273, in _handle_command
    atv = await connect(config, loop, 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 145, in connect
    await self.system_info()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/api.py", line 184, in system_info
    await self._send_command(
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.11/site-packages/pyatv/protocols/companion/api.py", line 174, in _send_command
    raise exceptions.ProtocolError(f"Command {identifier} failed") from ex
pyatv.exceptions.ProtocolError: Command _systemInfo failed
. See https://homebridge.io/w/JtMGR for more info.

@maxileith
Copy link
Owner

maxileith commented Jan 8, 2024

What I need you to do @rvetere: Send me the output of /var/lib/homebridge/appletv-enhanced/.venv/bin/atvscript -s xxx.xxx.xxx.xxx push_updates where xxx.xxx.xxx.xxx is the IP of your Apple TV. Then turn on / off your Apple TV a few times and post the logs here. (assuming /var/lib/homebridge is your homebridge dir)

Sorry for the confusion, but the command I mentioned here is wrong. You need to use /var/lib/homebridge/appletv-enhanced/.venv/bin/atvscript -s xxx.xxx.xxx.xxx --airplay-credentials abc --companion-credentials abc push_updates where abc is the string from /var/lib/homebridge/appletv-enhanced/AABBCCDDEEFF/credentials.txt. The credentials were missing, this is why you did get the 'power_state is not supported' error. Could you please send me the output.

@rvetere
Copy link
Author

rvetere commented Jan 9, 2024

Ok cool, this is working :) Here is the output:

{"result": "success", "datetime": "2024-01-09T01:20:52.883716+01:00", "power_state": "off"}
{"result": "success", "datetime": "2024-01-09T01:20:52.884806+01:00", "output_devices": [{"name": "Apple TV", "identifier": "D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]}
{"result": "success", "datetime": "2024-01-09T01:20:52.887514+01:00", "hash": "ca496c14642c78af6dd4250191fe175f6dafd72b4c33bcbab43c454aae051da1", "media_type": "unknown", "device_state": "idle", "title": null, "artist": null, "album": null, "genre": null, "total_time": null, "position": null, "shuffle": "off", "repeat": "off", "series_name": null, "season_number": null, "episode_number": null, "content_identifier": null, "app": null, "app_id": null}

@maxileith
Copy link
Owner

maxileith commented Jan 9, 2024

@rvetere Can you do this again and turn on / off the Apple TV?

P.S. I have added descriptions for each configuration parameter to the README 😄

@rvetere
Copy link
Author

rvetere commented Jan 11, 2024

Of course i can do that, but, it doesn't show anything new to me...

I turn on my Apple-TV, and just execute the command:

{"result": "success", "datetime": "2024-01-11T19:45:57.122827+01:00", "power_state": "on"}
{"result": "success", "datetime": "2024-01-11T19:45:57.123138+01:00", "output_devices": [{"name": "Apple TV", "identifier": "D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]}
{"result": "success", "datetime": "2024-01-11T19:45:57.125393+01:00", "hash": "ca496c14642c78af6dd4250191fe175f6dafd72b4c33bcbab43c454aae051da1", "media_type": "unknown", "device_state": "idle", "title": null, "artist": null, "album": null, "genre": null, "total_time": null, "position": null, "shuffle": "off", "repeat": "off", "series_name": null, "season_number": null, "episode_number": null, "content_identifier": null, "app": null, "app_id": null}
{"result": "success", "datetime": "2024-01-11T19:45:57.126692+01:00", "volume": 50.0}

Turn it off again and execute the command

{"result": "success", "datetime": "2024-01-11T19:45:36.866700+01:00", "power_state": "off"}
{"result": "success", "datetime": "2024-01-11T19:45:36.867579+01:00", "output_devices": [{"name": "Apple TV", "identifier": "D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]}
{"result": "success", "datetime": "2024-01-11T19:45:36.870494+01:00", "hash": "ca496c14642c78af6dd4250191fe175f6dafd72b4c33bcbab43c454aae051da1", "media_type": "unknown", "device_state": "idle", "title": null, "artist": null, "album": null, "genre": null, "total_time": null, "position": null, "shuffle": "off", "repeat": "off", "series_name": null, "season_number": null, "episode_number": null, "content_identifier": null, "app": null, "app_id": null}
{"result": "success", "datetime": "2024-01-11T19:45:36.871385+01:00", "volume": 50.0}

And when i repeat this 5 times, it always shows the correct "power_state", but my Accessory looks like this:
Screenshot 2024-01-11 at 19 45 52

Because the script seems to work perfect and always returns the correct state, i went this far that i wrote my own little plugin that just polls this script in an interval of 4 seconds and just gives me a motion sensor that triggers when it turns on... Surprisingly, this is working pretty well even after a day and it always detects it right (yeah, the script is truly working)... Fun fact, while my "ATV Poller" plugin is active, then the state of the Accessory "Apple TV" seems to be correct too! :D Well, after two days of running i disabled my poller again as it eats up all the ressources and makes my Raspberry Pi pretty unstable (well, no wonder why :D)

I'm a programmer myself and i just wanted to investigate further with this little "poller" - but of course, this is not the setup i'm looking for.

Meantime, i also wrote Apple in the official "Apple TV Feedback Form" that they should just implement this "power-on" state in their native integration! I would love to get back to the native integrations once Apple has fixed that (and it COULDN'T be hard for them, as the apple tv app on iphone is already giving me these states and triggers when i use the Shortcut app, but just not in HomeKit -.-)

Maybe we should all do this and spam apple until they can deliver :/ Sometimes i hate this friggin company to be such a monopol...

https://www.apple.com/feedback/apple-tv/

PS: the best trigger i've got so far is to use a Meross Smartplug that can measure power consumption, and with the "homebridge-meross" plugin i can get a "in use" trigger at a certain threshold of power consumption - this way i can truly see when my whole beamer-system is running and it would be perfect! downside, it takes 30 seconds to trigger -.- totally unusable...

@rvetere
Copy link
Author

rvetere commented Jan 11, 2024

Oh, another interesting find in the logs:

[09/01/2024, 10:55:32] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): event powerState: on
[09/01/2024, 10:55:32] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): New Active State: on
[09/01/2024, 10:55:32] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Waiting until mediaType and deviceState is reported: 3500ms
[09/01/2024, 10:55:33] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Waiting until mediaType and deviceState is reported: 4000ms
[09/01/2024, 10:55:33] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Waiting until mediaType and deviceState is reported: 4500ms
[09/01/2024, 10:55:34] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Waiting until mediaType and deviceState is reported: 5000ms
[09/01/2024, 10:55:34] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Waiting until mediaType and deviceState is reported: 5500ms
[09/01/2024, 10:55:35] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Waiting until mediaType and deviceState is reported: 6000ms
[09/01/2024, 10:55:35] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Waiting until mediaType and deviceState is reported: 6500ms
[09/01/2024, 10:55:36] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Waiting until mediaType and deviceState is reported: 7000ms
[09/01/2024, 10:55:36] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Waiting until mediaType and deviceState is reported: 7500ms
[09/01/2024, 10:55:37] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Waiting until mediaType and deviceState is reported: 8000ms
[09/01/2024, 10:55:37] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): Waiting until mediaType and deviceState is reported: 8500ms
[09/01/2024, 10:55:38] [homebridge-appletv-enhanced] This plugin slows down Homebridge. The write handler for the characteristic 'Active' on the accessory 'Apple TV Apple TV 0760' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info.
[09/01/2024, 10:55:40] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): event mediaType: unknown
[09/01/2024, 10:55:40] [Apple TV Enhanced] Apple TV (C0:95:6D:5F:33:4B): New Media Type State: unknown

I really don't like to see This plugin slows down Homebridge and doesn't give me much trust in this project

@rvetere
Copy link
Author

rvetere commented Jan 11, 2024

next i'm going to build a tiny esp32 board with a low-tech camera and just watch the tiny LED that starts shining on the device with tensor flow :D there's already a project in place to do that ^^ https://github.com/jomjol/AI-on-the-edge-device

@maxileith
Copy link
Owner

maxileith commented Jan 11, 2024

Hi @rvetere,

I think I have found the root cause. However, before that I want to say something …

Way of communication

I'm a programmer myself and i just wanted to investigate further with this little "poller" - but of course, this is not the setup i'm looking for.

I really don't like to see This plugin slows down Homebridge and doesn't give me much trust in this project

You can always do your own projects if you do not have the trust into this project. No software project is perfect, there are always some bugs. You will just not get around this! What is bugging me here is that you are only complaining all the time and providing suggestions for solutions that are ridiculous, like …

next i'm going to build a tiny esp32 board with a low-tech camera and just watch the tiny LED that starts shining on the device with tensor flow :D there's already a project in place to do that ^^ https://github.com/jomjol/AI-on-the-edge-device

or

After i personally started investigation "how to determine if an Apple TV is running", i came up with the idea to develop a small App for Apple TV, which then could be used to expose something like an API for this plugin - maybe much stabler..? How did you implement your "active" state anyway?

… which is kind of concerning. Nevertheless, you have really found a bug here and I am willing to fix that bug with you, but I need you to cooperate on this with me. Open-source should be fun, and I do not have the feeling that you are appreciating what I am doing here … I want this issue to be fixed for you and potentially others, too. I just cannot reproduce the error with my setup. This is why I need you to provide the exact outputs that I need to investigate the problem.

You truely need to work on your tone. This is by far the most disrespectful way of dealing with an issue that I have experienced in this project.

Of course i can do that, but, it doesn't show anything new to me...

I did not ask you to turn on your Apple TV, then execute the atvscript, terminate it, turn off your Apple TV, then execute arvscript and terminate it again. If you had just looked at the documentation of pyatv once, you would have seen that atvscript push_updates streams all updates regarding an Apple TV. So I still would like to see how it looks like when you are executing atvscript push_updates and keep it running while you are turning on or off your Apple TV. This is a big difference!

I think I have found the root cause …

I think I have found the root cause. Let us look at the following:

{"result": "success", "datetime": "2024-01-11T19:45:57.122827+01:00", "power_state": "on"}
{"result": "success", "datetime": "2024-01-11T19:45:57.123138+01:00", "output_devices": [{"name": "Apple TV", "identifier": "D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]}
{"result": "success", "datetime": "2024-01-11T19:45:57.125393+01:00", "hash": "ca496c14642c78af6dd4250191fe175f6dafd72b4c33bcbab43c454aae051da1", "media_type": "unknown", "device_state": "idle", "title": null, "artist": null, "album": null, "genre": null, "total_time": null, "position": null, "shuffle": "off", "repeat": "off", "series_name": null, "season_number": null, "episode_number": null, "content_identifier": null, "app": null, "app_id": null}
{"result": "success", "datetime": "2024-01-11T19:45:57.126692+01:00", "volume": 50.0}

There are 4 lines in this log, that have different JSON schemas, let just refer to them as line 1, 2, 3 and 4. I did only know of the schema of line 1, 3 and 4 since 2 never appeared on my setup. So this is an unexpected pattern to me.

As it turns out, the developer of sebbo2002/node-pyatv did not know of that either (I suppose). I am using this dependency to integrate pyatv into my plugin. Just recently I have discovered a bug in this dependency which resulted in a very similar error pattern, see #147. In order to fix that, I have opened sebbo2002/node-pyatv#291 (if you want to know the details about the root cause, please take a look into the PR, this will apply for this issue as well). I think we will need a similar fix for this issue, so output_devices in the atvscript push_updates output are handled similar to volume and power_state.

https://github.com/sebbo2002/node-pyatv/blob/60a414daeaac29c53254611ef25a54dbf671a720/src/lib/device-events.ts#L38-L52

I have created an issue here: sebbo2002/node-pyatv#295

So now we need to wait for the developer to review the issue, provide a fix and release it. But I am confident that this is the problem we were looking for.

@maxileith
Copy link
Owner

@rvetere any questions or suggestions adding to this?

@rvetere
Copy link
Author

rvetere commented Jan 12, 2024

Wow, that's fantastic news! I'm really pleased to hear that you've successfully identified the root cause.

I want to apologize for my tone in our previous interaction. I wasn't in the best frame of mind to engage constructively and I realize now that I shouldn't have written in that state. My apologies for any inconvenience caused!

@mufler
Copy link

mufler commented Jan 13, 2024

Hi again guys, good to see that you have not given up on this issue!
As @rvetere "predicted", this issue is back for me after some days. As I understand the situation you guys have potentially found the cause and are waiting for the other developer to provide the fix.
Is there any information (from logs etc.) I can provide you that can help? Just let me know.

Edit: Looks like I have found a repeatable situation when this issue occurs. It happens when I connect my bluetooth headphones to AppleTV. Here is my process with AppleTV native remote:

  1. I turn on AppleTV and log shows: New Active State: on. As expected.
  2. I turn off AppleTV and log shows: New Active State: off. As expected.
  3. I turn on AppleTV again and log shows: New Active State: on. As expected.
  4. I connect Bluetooth headphones to AppleTV and log shows: event powerState: null. The problem?
  5. I turn off AppleTV with headphones still connected to AppleTV, cannot see New Active State: off (AppleTV turns off, but no automation is working.) Not as expected.
  6. I turn on AppleTV (with headphones still connected to AppleTV), cannot see New Active State: on (AppleTV turns on, but no automation is working.) Not as expected.
  7. I disconnect Bluetooth headphones from AppleTV and turn off AppleTV, the log shows New Active State: off Everything works again as expected.

@maxileith
Copy link
Owner

@mufler Nothing to do on your side. I will update you guys here once the fix to the problem is released ...

@maxileith
Copy link
Owner

maxileith commented Jan 13, 2024

Edit: Looks like I have found a repeatable situation when this issue occurs. It happens when I connect my bluetooth headphones to AppleTV. Here is my process with AppleTV native remote:

@mufler thanks for the steps to reproduce. This might seem like the same problem we are looking at here in this issue since the symptom is the same. However, this is another issue which is most likely related to postlund/pyatv#1667. Could you please open a new bug report with the title "connected to temporary audio device --> power state incorrect".

@mufler
Copy link

mufler commented Jan 14, 2024

@maxileith I have submitted the bug report here: postlund/pyatv#2331

@maxileith
Copy link
Owner

@rvetere Could you check wether or not v1.1.1-2 works for you?

@maxileith
Copy link
Owner

maxileith commented Jan 16, 2024

I just discovered a bug because of which there is still a possibility for mediaType, deviceType and powerState to be reported as null: sebbo2002/node-pyatv#301

@maxileith
Copy link
Owner

maxileith commented Jan 16, 2024

@rvetere Can you check if v1.2.0-2 resolves your issues?

@hsugene
Copy link

hsugene commented Jan 18, 2024

Hi @maxileith, thanks for your work on this plugin. I’ve been lurking here because my setup is having a similar issue—the plugin tracks the on/off state of my Apple TVs at first, but then it stops and the only thing that seems to get it working is a fully resetting everything (reinstalling the plugin, deleting the credentials, etc.).

Unfortunately, v1.2.0-2 does not seem to resolve it. What I have noticed is that it is reliable on my 2nd generation Apple TV 4K. It’s the 3rd generation unit that is having issues.

I would be willing to provide whatever logs you need if you think they will help, but I may not have time for a few days. Just wanted to offer some feedback on the most recent beta.

@maxileith
Copy link
Owner

@poopmagic Could you please open a new issue for that. If it is not fixed in v1.2.0-2 it is likely to be a different root cause. Please ensure that you answer the follwoing questions when filling out a new bug report:

  • Are you using any other audio output than the HDMI port of your Apple TV. If so, which?
  • Include debug logs (log level 4)
  • Try to find a reproducable pattern where the error occurs.

@rvetere
Copy link
Author

rvetere commented Jan 22, 2024

@maxileith No, still no luck with v1.2.0-5, even after a complet fresh setup, the same behavior - the accessory breaks after a few hours uptime

@maxileith
Copy link
Owner

@rvetere Thanks for the reply. Sorry to say that, but could you please provide logs once more. Set the log level to verbose (level 5) and turn on / off your Apple TV. Mark the spots where you turned on / off your Apple TV in the logs.

I really thought that the issue solved in v1.2.0-2 was the cause ...

@maxileith maxileith mentioned this issue Jan 22, 2024
@rvetere
Copy link
Author

rvetere commented Jan 23, 2024

Ok i did that, and i think i found a whole new root cause, but first things first.
Before i started, i just had a look into the plugin log "as it is" and already saw a warning:

[1/23/2024, 8:29:29 AM] [Apple TV Enhanced] [I] Platform: Starting device discovery ...
[1/23/2024, 8:29:29 AM] [Apple TV Enhanced] [D] Platform: Starting device discovery ...
[1/23/2024, 8:29:29 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][13] /var/lib/homebridge/appletv-enhanced/.venv/bin/atvscript scan
[1/23/2024, 8:29:35 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][13] stdout: {"result": "success", "datetime": "2024-01-23T08:29:35.396250+01:00", "devices": [{"name": "Remo\u2019s MacBook Pro (97)", "address": "192.168.1.250", "identifier": "F8:4D:89:78:DC:06", "all_identifiers": ["F8:4D:89:78:DC:06", "F84D8978DC06"], "device_info": {"mac": "F8:4D:89:78:DC:06", "model": "Unknown", "model_str": "MacBookPro18,4", "operating_system": "MacOS", "version": null}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "companion", "port": 50432}, {"protocol": "raop", "port": 7000}]}, {"name": "Sonos 2.1", "address": "192.168.1.60", "identifier": "F0:F6:C1:A4:C4:EE", "all_identifiers": ["F0:F6:C1:A4:C4:EE", "F0F6C1A4C4EE"], "device_info": {"mac": "F0:F6:C1:A4:C4:EE", "model": "Unknown", "model_str": "Era 100", "operating_system": "Unknown", "version": null}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "raop", "port": 7000}]}, {"name": "Denon DRA-800H", "address": "192.168.1.101", "identifier": "00:06:78:B6:9B:FA", "all_identifiers": ["00:06:78:B6:9B:FA", "000678B69BFA"], "device_info": {"mac": "00:06:78:B6:9B:FA", "model": "Unknown", "model_str": "Denon DRA-800H", "operating_system": "Unknown", "version": null}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "raop", "port": 7000}]}, {"name": "Apple TV", "address": "192.168.1.186", "identifier": "C0:95:6D:5F:33:4B", "all_identifiers": ["D4ED48E4-4C88-47C0-B05C-077747F85C5D", "C0:95:6D:5F:33:4B", "C0956D5F334B"], "device_info": {"mac": "C0:95:6D:5F:33:4B", "model": "AppleTV4KGen3", "model_str": "Apple TV 4K (gen 3)", "operating_system": "TvOS", "version": "17.2"}, "services": [{"protocol": "companion", "port": 49153}, {"protocol": "airplay", "port": 7000}, {"protocol": "raop", "port": 7000}]}, {"name": "Livingroom", "address": "192.168.1.112", "identifier": "AC:BC:B5:D3:71:9F", "all_identifiers": ["AC:BC:B5:D3:71:9F", "ACBCB5D3719F"], "device_info": {"mac": "AC:BC:B5:D3:71:9F", "model": "HomePodGen2", "model_str": "HomePod (gen 2)", "operating_system": "Unknown", "version": "17.2"}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "companion", "port": 49153}, {"protocol": "raop", "port": 7000}]}]}
[1/23/2024, 8:29:35 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][13] /var/lib/homebridge/appletv-enhanced/.venv/bin/atvscript exited with code: 0
[1/23/2024, 8:29:35 AM] [Apple TV Enhanced] [D] Platform: finished multicast device discovery
[1/23/2024, 8:29:35 AM] [Apple TV Enhanced] [D] Platform: Found Apple TV Apple TV (C0:95:6D:5F:33:4B / 192.168.1.186).
[1/23/2024, 8:29:35 AM] [Apple TV Enhanced] [I] Platform: Adding Apple TV Apple TV (C0:95:6D:5F:33:4B)
[1/23/2024, 8:29:35 AM] [Apple TV Enhanced] [D] Platform: Waiting for Apple TV Apple TV (C0:95:6D:5F:33:4B) to boot ...
[1/23/2024, 8:29:35 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Accessory Config: {"name":"Apple TV Enhanced","deviceStateDelay":0,"remoteKeysAsSwitch":["turn_off","turn_on","volume_down","volume_up"],"avadaKedavraAppAmount":15,"disableVolumeControlRemote":false,"setTopBox":false,"discover":{"multicast":true},"forceVenvRecreate":false,"logLevel":5,"deviceSpecificOverrides":[{"overrideMediaTypes":false,"overrideDeviceStates":false,"overrideDeviceStateDelay":false,"deviceStateDelay":0,"overrideRemoteKeysAsSwitch":false,"overrideAvadaKedavraAppAmount":false,"avadaKedavraAppAmount":15,"overrideCustomInputURIs":false,"overrideDisableVolumeControlRemote":false,"disableVolumeControlRemote":false,"overrideSetTopBox":false,"setTopBox":false}],"platform":"AppleTVEnhanced"}
[1/23/2024, 8:29:35 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Loaded credentials: 4a112892f99cdb9a238d5e6b449388b38880ac1546be2cc232665521b4031e6b:ecb9cda6059378f33564768292c10c3ba8f1bb8707c44ea1a6b42f2ee2e4f116:44344544343845342d344338382d343743302d423035432d303737373437463835433544:37663363666266312d356532642d346366662d396236392d313438666635393263646434
[1/23/2024, 8:29:35 AM] [Apple TV Enhanced] [I] Apple TV (C0:95:6D:5F:33:4B): verifying credentials ...
[1/23/2024, 8:29:35 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][J] /var/lib/homebridge/appletv-enhanced/.venv/bin/atvremote -s 192.168.1.186 -i C0:95:6D:5F:33:4B --airplay-credentials 4a112892f99cdb9a238d5e6b449388b38880ac1546be2cc232665521b4031e6b:ecb9cda6059378f33564768292c10c3ba8f1bb8707c44ea1a6b42f2ee2e4f116:44344544343845342d344338382d343743302d423035432d303737373437463835433544:37663363666266312d356532642d346366662d396236392d313438666635393263646434 --companion-credentials 4a112892f99cdb9a238d5e6b449388b38880ac1546be2cc232665521b4031e6b:ecb9cda6059378f33564768292c10c3ba8f1bb8707c44ea1a6b42f2ee2e4f116:44344544343845342d344338382d343743302d423035432d303737373437463835433544:37663363666266312d356532642d346366662d396236392d313438666635393263646434 app_list
[1/23/2024, 8:29:35 AM] [Apple TV Enhanced] [D] Platform: Finished device discovery.
[1/23/2024, 8:29:37 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][J] stdout: 2024-01-23 08:29:37 ERROR [pyatv.scripts.atvremote]: Could not find any Apple TV on current network
[1/23/2024, 8:29:37 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][J] /var/lib/homebridge/appletv-enhanced/.venv/bin/atvremote exited with code: 1
[1/23/2024, 8:29:37 AM] [Apple TV Enhanced] [W] Apple TV (C0:95:6D:5F:33:4B): Apple TV can be reached on OSI Layer 2 but not on 3. This is likely a network problem. Restart the plugin after you have fixed the root cause.
[1/23/2024, 8:30:29 AM] [Apple TV Enhanced] [D] Platform: Starting device discovery ...
[1/23/2024, 8:30:29 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][2H] /var/lib/homebridge/appletv-enhanced/.venv/bin/atvscript scan
[1/23/2024, 8:30:35 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][2H] stdout: {"result": "success", "datetime": "2024-01-23T08:30:35.403367+01:00", "devices": [{"name": "Remo\u2019s MacBook Pro (97)", "address": "192.168.1.250", "identifier": "F8:4D:89:78:DC:06", "all_identifiers": ["F8:4D:89:78:DC:06", "F84D8978DC06"], "device_info": {"mac": "F8:4D:89:78:DC:06", "model": "Unknown", "model_str": "MacBookPro18,4", "operating_system": "MacOS", "version": null}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "companion", "port": 50432}, {"protocol": "raop", "port": 7000}]}, {"name": "Sonos 2.1", "address": "192.168.1.60", "identifier": "F0:F6:C1:A4:C4:EE", "all_identifiers": ["F0:F6:C1:A4:C4:EE", "F0F6C1A4C4EE"], "device_info": {"mac": "F0:F6:C1:A4:C4:EE", "model": "Unknown", "model_str": "Era 100", "operating_system": "Unknown", "version": null}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "raop", "port": 7000}]}, {"name": "Denon DRA-800H", "address": "192.168.1.101", "identifier": "00:06:78:B6:9B:FA", "all_identifiers": ["00:06:78:B6:9B:FA", "000678B69BFA"], "device_info": {"mac": "00:06:78:B6:9B:FA", "model": "Unknown", "model_str": "Denon DRA-800H", "operating_system": "Unknown", "version": null}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "raop", "port": 7000}]}, {"name": "Apple TV", "address": "192.168.1.186", "identifier": "C0:95:6D:5F:33:4B", "all_identifiers": ["D4ED48E4-4C88-47C0-B05C-077747F85C5D", "C0:95:6D:5F:33:4B", "C0956D5F334B"], "device_info": {"mac": "C0:95:6D:5F:33:4B", "model": "AppleTV4KGen3", "model_str": "Apple TV 4K (gen 3)", "operating_system": "TvOS", "version": "17.2"}, "services": [{"protocol": "companion", "port": 49153}, {"protocol": "airplay", "port": 7000}, {"protocol": "raop", "port": 7000}]}, {"name": "Livingroom", "address": "192.168.1.112", "identifier": "AC:BC:B5:D3:71:9F", "all_identifiers": ["AC:BC:B5:D3:71:9F", "ACBCB5D3719F"], "device_info": {"mac": "AC:BC:B5:D3:71:9F", "model": "HomePodGen2", "model_str": "HomePod (gen 2)", "operating_system": "Unknown", "version": "17.2"}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "companion", "port": 49153}, {"protocol": "raop", "port": 7000}]}]}
[1/23/2024, 8:30:35 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][2H] /var/lib/homebridge/appletv-enhanced/.venv/bin/atvscript exited with code: 0
[1/23/2024, 8:30:35 AM] [Apple TV Enhanced] [D] Platform: finished multicast device discovery
[1/23/2024, 8:30:35 AM] [Apple TV Enhanced] [D] Platform: Found Apple TV Apple TV (C0:95:6D:5F:33:4B / 192.168.1.186).
[1/23/2024, 8:30:35 AM] [Apple TV Enhanced] [D] Platform: Apple TV Apple TV (C0:95:6D:5F:33:4B) with UUID 6c0c9b54-1717-4339-a7a5-5f676de7d85e already exists. Skipping.
[1/23/2024, 8:30:35 AM] [Apple TV Enhanced] [D] Platform: Finished device discovery.

This Apple TV can be reached on OSI Layer 2 but not on 3 is strange... but wait, my next step was to reboot the raspberry pi and this is the bootup-log of the plugin:

[1/23/2024, 8:33:53 AM] [Apple TV Enhanced] [I] Platform: Finished initializing platform: Apple TV Enhanced
[1/23/2024, 8:33:53 AM] Homebridge v1.7.0 (HAP v0.11.1) (homebridge-virtual-button) is running on port 41703.
[1/23/2024, 8:33:53 AM] [Apple TV Enhanced] [D] Platform: Executed didFinishLaunching callback
[1/23/2024, 8:33:53 AM] [Apple TV Enhanced] [I] Python check: Starting python check.
[1/23/2024, 8:33:53 AM] [Apple TV Enhanced] [I] Python check: plugin dir exists.
[1/23/2024, 8:33:54 AM] [Apple TV Enhanced] [I] Python check: Python 3.10.12 is installed and supported by the plugin.
[1/23/2024, 8:33:54 AM] [Apple TV Enhanced] [I] Python check: Virtual environment already exists.
[1/23/2024, 8:33:54 AM] [Apple TV Enhanced] [I] Python check: Venv is using current system python version (3.10.12).
[1/23/2024, 8:33:56 AM] [Apple TV Enhanced] [I] Python check: Venv pip version: 23.3.2
[1/23/2024, 8:33:56 AM] [Apple TV Enhanced] [I] Python check: Checking if there is an update for venv pip ...
[1/23/2024, 8:33:56 AM] [Apple TV Enhanced] [I] Python check: Venv pip is up-to-date
[1/23/2024, 8:33:58 AM] [Apple TV Enhanced] [I] Python check: Python requirements are satisfied.
[1/23/2024, 8:33:58 AM] [Apple TV Enhanced] [I] Python check: Finished
[1/23/2024, 8:33:58 AM] [Apple TV Enhanced] [D] Platform: Setting the storage path of the PyATV instance to /var/lib/homebridge
[1/23/2024, 8:33:58 AM] [Apple TV Enhanced] [D] CustomPyATVInstance: Set atvscript path to "/var/lib/homebridge/appletv-enhanced/.venv/bin/atvscript".
[1/23/2024, 8:33:58 AM] [Apple TV Enhanced] [D] CustomPyATVInstance: Set atvremote path to "/var/lib/homebridge/appletv-enhanced/.venv/bin/atvremote".
[1/23/2024, 8:33:58 AM] [Apple TV Enhanced] [I] Platform: Starting device discovery ...
[1/23/2024, 8:33:58 AM] [Apple TV Enhanced] [D] Platform: Starting device discovery ...
[1/23/2024, 8:33:58 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][3O] /var/lib/homebridge/appletv-enhanced/.venv/bin/atvscript scan
[1/23/2024, 8:34:05 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][3O] stdout: {"result": "success", "datetime": "2024-01-23T08:34:05.262241+01:00", "devices": [{"name": "Livingroom", "address": "192.168.1.112", "identifier": "AC:BC:B5:D3:71:9F", "all_identifiers": ["AC:BC:B5:D3:71:9F", "ACBCB5D3719F"], "device_info": {"mac": "AC:BC:B5:D3:71:9F", "model": "HomePodGen2", "model_str": "HomePod (gen 2)", "operating_system": "Unknown", "version": "17.2"}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "companion", "port": 49153}, {"protocol": "raop", "port": 7000}]}, {"name": "Apple TV", "address": "192.168.1.186", "identifier": "C0:95:6D:5F:33:4B", "all_identifiers": ["D4ED48E4-4C88-47C0-B05C-077747F85C5D", "C0:95:6D:5F:33:4B", "C0956D5F334B"], "device_info": {"mac": "C0:95:6D:5F:33:4B", "model": "AppleTV4KGen3", "model_str": "Apple TV 4K (gen 3)", "operating_system": "TvOS", "version": "17.2"}, "services": [{"protocol": "companion", "port": 49153}, {"protocol": "airplay", "port": 7000}, {"protocol": "raop", "port": 7000}]}, {"name": "Remo\u2019s MacBook Pro (97)", "address": "192.168.1.250", "identifier": "F8:4D:89:78:DC:06", "all_identifiers": ["F8:4D:89:78:DC:06", "F84D8978DC06"], "device_info": {"mac": "F8:4D:89:78:DC:06", "model": "Unknown", "model_str": "MacBookPro18,4", "operating_system": "MacOS", "version": null}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "companion", "port": 50432}, {"protocol": "raop", "port": 7000}]}, {"name": "Denon DRA-800H", "address": "192.168.1.101", "identifier": "00:06:78:B6:9B:FA", "all_identifiers": ["00:06:78:B6:9B:FA", "000678B69BFA"], "device_info": {"mac": "00:06:78:B6:9B:FA", "model": "Unknown", "model_str": "Denon DRA-800H", "operating_system": "Unknown", "version": null}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "raop", "port": 7000}]}, {"name": "Sonos 2.1", "address": "192.168.1.60", "identifier": "F0:F6:C1:A4:C4:EE", "all_identifiers": ["F0:F6:C1:A4:C4:EE", "F0F6C1A4C4EE"], "device_info": {"mac": "F0:F6:C1:A4:C4:EE", "model": "Unknown", "model_str": "Era 100", "operating_system": "Unknown", "version": null}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "raop", "port": 7000}]}]}
[1/23/2024, 8:34:05 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][3O] /var/lib/homebridge/appletv-enhanced/.venv/bin/atvscript exited with code: 0
[1/23/2024, 8:34:05 AM] [Apple TV Enhanced] [D] Platform: finished multicast device discovery
[1/23/2024, 8:34:05 AM] [Apple TV Enhanced] [D] Platform: Found Apple TV Apple TV (C0:95:6D:5F:33:4B / 192.168.1.186).
[1/23/2024, 8:34:05 AM] [Apple TV Enhanced] [I] Platform: Adding Apple TV Apple TV (C0:95:6D:5F:33:4B)
[1/23/2024, 8:34:05 AM] [Apple TV Enhanced] [D] Platform: Waiting for Apple TV Apple TV (C0:95:6D:5F:33:4B) to boot ...
[1/23/2024, 8:34:05 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Accessory Config: {"name":"Apple TV Enhanced","deviceStateDelay":0,"remoteKeysAsSwitch":["turn_off","turn_on","volume_down","volume_up"],"avadaKedavraAppAmount":15,"disableVolumeControlRemote":false,"setTopBox":false,"discover":{"multicast":true},"forceVenvRecreate":false,"logLevel":5,"deviceSpecificOverrides":[{"overrideMediaTypes":false,"overrideDeviceStates":false,"overrideDeviceStateDelay":false,"deviceStateDelay":0,"overrideRemoteKeysAsSwitch":false,"overrideAvadaKedavraAppAmount":false,"avadaKedavraAppAmount":15,"overrideCustomInputURIs":false,"overrideDisableVolumeControlRemote":false,"disableVolumeControlRemote":false,"overrideSetTopBox":false,"setTopBox":false}],"platform":"AppleTVEnhanced"}
[1/23/2024, 8:34:05 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Loaded credentials: 4a112892f99cdb9a238d5e6b449388b38880ac1546be2cc232665521b4031e6b:ecb9cda6059378f33564768292c10c3ba8f1bb8707c44ea1a6b42f2ee2e4f116:44344544343845342d344338382d343743302d423035432d303737373437463835433544:37663363666266312d356532642d346366662d396236392d313438666635393263646434
[1/23/2024, 8:34:05 AM] [Apple TV Enhanced] [I] Apple TV (C0:95:6D:5F:33:4B): verifying credentials ...
[1/23/2024, 8:34:05 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1R] /var/lib/homebridge/appletv-enhanced/.venv/bin/atvremote -s 192.168.1.186 -i C0:95:6D:5F:33:4B --airplay-credentials 4a112892f99cdb9a238d5e6b449388b38880ac1546be2cc232665521b4031e6b:ecb9cda6059378f33564768292c10c3ba8f1bb8707c44ea1a6b42f2ee2e4f116:44344544343845342d344338382d343743302d423035432d303737373437463835433544:37663363666266312d356532642d346366662d396236392d313438666635393263646434 --companion-credentials 4a112892f99cdb9a238d5e6b449388b38880ac1546be2cc232665521b4031e6b:ecb9cda6059378f33564768292c10c3ba8f1bb8707c44ea1a6b42f2ee2e4f116:44344544343845342d344338382d343743302d423035432d303737373437463835433544:37663363666266312d356532642d346366662d396236392d313438666635393263646434 app_list
[1/23/2024, 8:34:05 AM] [Apple TV Enhanced] [D] Platform: Finished device discovery.
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1R] stdout: App: Fitness (com.apple.Fitness), App: Podcasts (com.apple.podcasts), App: Filme (com.apple.TVMovies), App: Prime Video (com.amazon.aiv.AIVApp), App: TV (com.apple.TVWatchList), App: Fotos (com.apple.TVPhotos), App: App Store (com.apple.TVAppStore), App: Play SRF (ch.srf.srfplayer), App: Sky (com.homedia.sky), App: Arcade (com.apple.Arcade), App: Suchen (com.apple.TVSearch), App: Computer (com.apple.TVHomeSharing), App: FaceTime (com.apple.facetime), App: ARTE (tv.arte.plus7), App: YouTube (com.google.ios.youtube), App: PlaySuisse (ch.srgssr.playsuisse.tv), App: Speedtest (com.ookla.speedtest), App: Disney+ (com.disney.disneyplus), App: Einstellungen (com.apple.TVSettings), App: Netflix (com.netflix.Netflix), App: Musik (com.apple.TVMusic)
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1R] /var/lib/homebridge/appletv-enhanced/.venv/bin/atvremote exited with code: 0
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [I] Apple TV (C0:95:6D:5F:33:4B): Credentials are still valid. Continuing ...
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [I] Apple TV (C0:95:6D:5F:33:4B): Exposing Apple TV as accessory of type Apple TV.
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 2 (98 remaining)
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding television speaker.
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 3 (97 remaining)
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding remote key turn_off as a switch. (named: Turn Off)
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 4 (96 remaining)
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding remote key turn_on as a switch. (named: Turn On)
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 5 (95 remaining)
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding remote key volume_down as a switch. (named: Volume Down)
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 6 (94 remaining)
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding remote key volume_up as a switch. (named: Volume Up)
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 7 (93 remaining)
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding Avada Kedavra as an input. (named: Avada Kedavra)
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 8 (92 remaining)
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding Home as an input. (named: Home)
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 9 (91 remaining)
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding com.apple.TVAirPlay as an input. (named: AirPlay)
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 10 (90 remaining)
[1/23/2024, 8:34:07 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][22] /var/lib/homebridge/appletv-enhanced/.venv/bin/atvremote -s 192.168.1.186 -i C0:95:6D:5F:33:4B --airplay-credentials 4a112892f99cdb9a238d5e6b449388b38880ac1546be2cc232665521b4031e6b:ecb9cda6059378f33564768292c10c3ba8f1bb8707c44ea1a6b42f2ee2e4f116:44344544343845342d344338382d343743302d423035432d303737373437463835433544:37663363666266312d356532642d346366662d396236392d313438666635393263646434 --companion-credentials 4a112892f99cdb9a238d5e6b449388b38880ac1546be2cc232665521b4031e6b:ecb9cda6059378f33564768292c10c3ba8f1bb8707c44ea1a6b42f2ee2e4f116:44344544343845342d344338382d343743302d423035432d303737373437463835433544:37663363666266312d356532642d346366662d396236392d313438666635393263646434 app_list
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][22] stdout: App: Fitness (com.apple.Fitness), App: Podcasts (com.apple.podcasts), App: Filme (com.apple.TVMovies), App: Prime Video (com.amazon.aiv.AIVApp), App: TV (com.apple.TVWatchList), App: Fotos (com.apple.TVPhotos), App: App Store (com.apple.TVAppStore), App: Play SRF (ch.srf.srfplayer), App: Sky (com.homedia.sky), App: Arcade (com.apple.Arcade), App: Suchen (com.apple.TVSearch), App: Computer (com.apple.TVHomeSharing), App: FaceTime (com.apple.facetime), App: ARTE (tv.arte.plus7), App: YouTube (com.google.ios.youtube), App: PlaySuisse (ch.srgssr.playsuisse.tv), App: Speedtest (com.ookla.speedtest), App: Disney+ (com.disney.disneyplus), App: Einstellungen (com.apple.TVSettings), App: Netflix (com.netflix.Netflix), App: Musik (com.apple.TVMusic)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][22] /var/lib/homebridge/appletv-enhanced/.venv/bin/atvremote exited with code: 0
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding com.google.ios.youtube as an input. (named: YouTube)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 11 (89 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding com.apple.TVSearch as an input. (named: Suchen)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 12 (88 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding com.ookla.speedtest as an input. (named: Speedtest)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 13 (87 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding com.homedia.sky as an input. (named: Sky)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 14 (86 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding com.amazon.aiv.AIVApp as an input. (named: Prime Video)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 15 (85 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding com.apple.podcasts as an input. (named: Podcasts)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 16 (84 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding ch.srgssr.playsuisse.tv as an input. (named: PlaySuisse)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 17 (83 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding ch.srf.srfplayer as an input. (named: Play SRF)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 18 (82 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding com.netflix.Netflix as an input. (named: Netflix)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 19 (81 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding com.apple.TVPhotos as an input. (named: Fotos)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 20 (80 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding com.apple.Fitness as an input. (named: Fitness)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 21 (79 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding com.apple.TVMovies as an input. (named: Filme)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 22 (78 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding com.apple.facetime as an input. (named: FaceTime)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 23 (77 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding com.apple.TVSettings as an input. (named: Einstellungen)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 24 (76 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding com.disney.disneyplus as an input. (named: Disney)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 25 (75 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding com.apple.TVHomeSharing as an input. (named: Computer)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 26 (74 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding com.apple.Arcade as an input. (named: Arcade)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 27 (73 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding com.apple.TVAppStore as an input. (named: App Store)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 28 (72 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding com.apple.TVWatchList as an input. (named: Apple TV)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 29 (71 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding com.apple.TVMusic as an input. (named: Apple Music)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 30 (70 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Adding tv.arte.plus7 as an input. (named: ARTE)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Total services 31 (69 remaining)
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Input display order: AQQqAAAAAAABBEUAAAAAAAEEqR2slgAAAQTSES6KAAABBC+TeUUAAAEEI3mIcwAAAQS1RH+fAAABBAi7f0QAAAEEFd14AQAAAQSE4v5+AAABBAC9K3cAAAEEkoQKvQAAAQR+Wd4JAAABBMw0gMcAAAEEpINglgAAAQT4YCitAAABBPkIFVAAAAEEycHdRAAAAQR6mctTAAABBD3f/zEAAAEEbtL2SAAAAQQO7f9OAAABBECjf9A=
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): recreating listeners
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] Start listeing to events from device Apple TV
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] /var/lib/homebridge/appletv-enhanced/.venv/bin/atvscript -s 192.168.1.186 -i C0:95:6D:5F:33:4B --airplay-credentials 4a112892f99cdb9a238d5e6b449388b38880ac1546be2cc232665521b4031e6b:ecb9cda6059378f33564768292c10c3ba8f1bb8707c44ea1a6b42f2ee2e4f116:44344544343845342d344338382d343743302d423035432d303737373437463835433544:37663363666266312d356532642d346366662d396236392d313438666635393263646434 --companion-credentials 4a112892f99cdb9a238d5e6b449388b38880ac1546be2cc232665521b4031e6b:ecb9cda6059378f33564768292c10c3ba8f1bb8707c44ea1a6b42f2ee2e4f116:44344544343845342d344338382d343743302d423035432d303737373437463835433544:37663363666266312d356532642d346366662d396236392d313438666635393263646434 push_updates
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): recreating rocket remote
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Rocket Remote: creating
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [I] Apple TV (C0:95:6D:5F:33:4B): Finished initializing
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Reporting as booted.
[1/23/2024, 8:34:09 AM] [Apple TV Enhanced] [D] Platform: Apple TV Apple TV (C0:95:6D:5F:33:4B) finished booting. Publishing the accessory now.
[1/23/2024, 8:34:09 AM] Apple TV Apple TV 0760 is running on port 35207.
[1/23/2024, 8:34:09 AM] Please add [Apple TV Apple TV 0760] manually in Home app. Setup Code: 723-04-715
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] stdout: {"result": "success", "datetime": "2024-01-23T08:34:11.374264+01:00", "power_state": "off"}
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] > {"result": "success", "datetime": "2024-01-23T08:34:11.374264+01:00", "power_state": "off"}
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No hash value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374264+01:00","power_state":"off"})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No mediaType value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374264+01:00","power_state":"off"})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No deviceState value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374264+01:00","power_state":"off"})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No title value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374264+01:00","power_state":"off"})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No artist value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374264+01:00","power_state":"off"})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No album value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374264+01:00","power_state":"off"})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No genre value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374264+01:00","power_state":"off"})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No totalTime value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374264+01:00","power_state":"off"})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No position value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374264+01:00","power_state":"off"})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No shuffle value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374264+01:00","power_state":"off"})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No repeat value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374264+01:00","power_state":"off"})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No app value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374264+01:00","power_state":"off"})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No appId value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374264+01:00","power_state":"off"})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No focusState value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374264+01:00","power_state":"off"})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): event powerState: off
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [I] Apple TV (C0:95:6D:5F:33:4B): New Active State: off
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] stdout: {"result": "success", "datetime": "2024-01-23T08:34:11.374505+01:00", "output_devices": [{"name": "Apple TV", "identifier": "D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]}
{"result": "success", "datetime": "2024-01-23T08:34:11.377259+01:00", "hash": "ca496c14642c78af6dd4250191fe175f6dafd72b4c33bcbab43c454aae051da1", "media_type": "unknown", "device_state": "idle", "title": null, "artist": null, "album": null, "genre": null, "total_time": null, "position": null, "shuffle": "off", "repeat": "off", "series_name": null, "season_number": null, "episode_number": null, "content_identifier": null, "app": null, "app_id": null}
{"result": "success", "datetime": "2024-01-23T08:34:11.379369+01:00", "volume": 50.0}
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] > {"result": "success", "datetime": "2024-01-23T08:34:11.374505+01:00", "output_devices": [{"name": "Apple TV", "identifier": "D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]}
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No hash value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374505+01:00","output_devices":[{"name":"Apple TV","identifier":"D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No mediaType value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374505+01:00","output_devices":[{"name":"Apple TV","identifier":"D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No deviceState value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374505+01:00","output_devices":[{"name":"Apple TV","identifier":"D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No title value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374505+01:00","output_devices":[{"name":"Apple TV","identifier":"D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No artist value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374505+01:00","output_devices":[{"name":"Apple TV","identifier":"D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No album value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374505+01:00","output_devices":[{"name":"Apple TV","identifier":"D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No genre value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374505+01:00","output_devices":[{"name":"Apple TV","identifier":"D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No totalTime value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374505+01:00","output_devices":[{"name":"Apple TV","identifier":"D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No position value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374505+01:00","output_devices":[{"name":"Apple TV","identifier":"D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No shuffle value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374505+01:00","output_devices":[{"name":"Apple TV","identifier":"D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No repeat value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374505+01:00","output_devices":[{"name":"Apple TV","identifier":"D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No app value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374505+01:00","output_devices":[{"name":"Apple TV","identifier":"D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No appId value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374505+01:00","output_devices":[{"name":"Apple TV","identifier":"D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No powerState value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374505+01:00","output_devices":[{"name":"Apple TV","identifier":"D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No focusState value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.374505+01:00","output_devices":[{"name":"Apple TV","identifier":"D4ED48E4-4C88-47C0-B05C-077747F85C5D"}]})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] > {"result": "success", "datetime": "2024-01-23T08:34:11.377259+01:00", "hash": "ca496c14642c78af6dd4250191fe175f6dafd72b4c33bcbab43c454aae051da1", "media_type": "unknown", "device_state": "idle", "title": null, "artist": null, "album": null, "genre": null, "total_time": null, "position": null, "shuffle": "off", "repeat": "off", "series_name": null, "season_number": null, "episode_number": null, "content_identifier": null, "app": null, "app_id": null}
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No title value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.377259+01:00","hash":"ca496c14642c78af6dd4250191fe175f6dafd72b4c33bcbab43c454aae051da1","media_type":"unknown","device_state":"idle","title":null,"artist":null,"album":null,"genre":null,"total_time":null,"position":null,"shuffle":"off","repeat":"off","series_name":null,"season_number":null,"episode_number":null,"content_identifier":null,"app":null,"app_id":null})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No artist value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.377259+01:00","hash":"ca496c14642c78af6dd4250191fe175f6dafd72b4c33bcbab43c454aae051da1","media_type":"unknown","device_state":"idle","title":null,"artist":null,"album":null,"genre":null,"total_time":null,"position":null,"shuffle":"off","repeat":"off","series_name":null,"season_number":null,"episode_number":null,"content_identifier":null,"app":null,"app_id":null})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No album value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.377259+01:00","hash":"ca496c14642c78af6dd4250191fe175f6dafd72b4c33bcbab43c454aae051da1","media_type":"unknown","device_state":"idle","title":null,"artist":null,"album":null,"genre":null,"total_time":null,"position":null,"shuffle":"off","repeat":"off","series_name":null,"season_number":null,"episode_number":null,"content_identifier":null,"app":null,"app_id":null})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No genre value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.377259+01:00","hash":"ca496c14642c78af6dd4250191fe175f6dafd72b4c33bcbab43c454aae051da1","media_type":"unknown","device_state":"idle","title":null,"artist":null,"album":null,"genre":null,"total_time":null,"position":null,"shuffle":"off","repeat":"off","series_name":null,"season_number":null,"episode_number":null,"content_identifier":null,"app":null,"app_id":null})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No totalTime value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.377259+01:00","hash":"ca496c14642c78af6dd4250191fe175f6dafd72b4c33bcbab43c454aae051da1","media_type":"unknown","device_state":"idle","title":null,"artist":null,"album":null,"genre":null,"total_time":null,"position":null,"shuffle":"off","repeat":"off","series_name":null,"season_number":null,"episode_number":null,"content_identifier":null,"app":null,"app_id":null})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No position value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.377259+01:00","hash":"ca496c14642c78af6dd4250191fe175f6dafd72b4c33bcbab43c454aae051da1","media_type":"unknown","device_state":"idle","title":null,"artist":null,"album":null,"genre":null,"total_time":null,"position":null,"shuffle":"off","repeat":"off","series_name":null,"season_number":null,"episode_number":null,"content_identifier":null,"app":null,"app_id":null})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No app value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.377259+01:00","hash":"ca496c14642c78af6dd4250191fe175f6dafd72b4c33bcbab43c454aae051da1","media_type":"unknown","device_state":"idle","title":null,"artist":null,"album":null,"genre":null,"total_time":null,"position":null,"shuffle":"off","repeat":"off","series_name":null,"season_number":null,"episode_number":null,"content_identifier":null,"app":null,"app_id":null})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No appId value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.377259+01:00","hash":"ca496c14642c78af6dd4250191fe175f6dafd72b4c33bcbab43c454aae051da1","media_type":"unknown","device_state":"idle","title":null,"artist":null,"album":null,"genre":null,"total_time":null,"position":null,"shuffle":"off","repeat":"off","series_name":null,"season_number":null,"episode_number":null,"content_identifier":null,"app":null,"app_id":null})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No powerState value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.377259+01:00","hash":"ca496c14642c78af6dd4250191fe175f6dafd72b4c33bcbab43c454aae051da1","media_type":"unknown","device_state":"idle","title":null,"artist":null,"album":null,"genre":null,"total_time":null,"position":null,"shuffle":"off","repeat":"off","series_name":null,"season_number":null,"episode_number":null,"content_identifier":null,"app":null,"app_id":null})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No focusState value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.377259+01:00","hash":"ca496c14642c78af6dd4250191fe175f6dafd72b4c33bcbab43c454aae051da1","media_type":"unknown","device_state":"idle","title":null,"artist":null,"album":null,"genre":null,"total_time":null,"position":null,"shuffle":"off","repeat":"off","series_name":null,"season_number":null,"episode_number":null,"content_identifier":null,"app":null,"app_id":null})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): event mediaType: unknown
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): event deviceState: idle
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): New Device State Draft discarded (since Apple TV is off): idle
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): event powerState: null
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] > {"result": "success", "datetime": "2024-01-23T08:34:11.379369+01:00", "volume": 50.0}
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No hash value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.379369+01:00","volume":50})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No mediaType value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.379369+01:00","volume":50})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No deviceState value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.379369+01:00","volume":50})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No title value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.379369+01:00","volume":50})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No artist value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.379369+01:00","volume":50})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No album value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.379369+01:00","volume":50})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No genre value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.379369+01:00","volume":50})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No totalTime value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.379369+01:00","volume":50})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No position value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.379369+01:00","volume":50})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No shuffle value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.379369+01:00","volume":50})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No repeat value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.379369+01:00","volume":50})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No app value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.379369+01:00","volume":50})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No appId value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.379369+01:00","volume":50})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No powerState value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.379369+01:00","volume":50})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4L] No focusState value found in input ({"result":"success","datetime":"2024-01-23T08:34:11.379369+01:00","volume":50})
[1/23/2024, 8:34:11 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Rocket Remote: Enter commands and press enter
Type help for help and exit to quit
[1/23/2024, 8:34:58 AM] [Apple TV Enhanced] [D] Platform: Starting device discovery ...
[1/23/2024, 8:34:58 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4N] /var/lib/homebridge/appletv-enhanced/.venv/bin/atvscript scan
[1/23/2024, 8:35:05 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4N] stdout: {"result": "success", "datetime": "2024-01-23T08:35:05.226011+01:00", "devices": [{"name": "Denon DRA-800H", "address": "192.168.1.101", "identifier": "00:06:78:B6:9B:FA", "all_identifiers": ["00:06:78:B6:9B:FA", "000678B69BFA"], "device_info": {"mac": "00:06:78:B6:9B:FA", "model": "Unknown", "model_str": "Denon DRA-800H", "operating_system": "Unknown", "version": null}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "raop", "port": 7000}]}, {"name": "Sonos 2.1", "address": "192.168.1.60", "identifier": "F0:F6:C1:A4:C4:EE", "all_identifiers": ["F0:F6:C1:A4:C4:EE", "F0F6C1A4C4EE"], "device_info": {"mac": "F0:F6:C1:A4:C4:EE", "model": "Unknown", "model_str": "Era 100", "operating_system": "Unknown", "version": null}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "raop", "port": 7000}]}, {"name": "Apple TV", "address": "192.168.1.186", "identifier": "C0:95:6D:5F:33:4B", "all_identifiers": ["D4ED48E4-4C88-47C0-B05C-077747F85C5D", "C0:95:6D:5F:33:4B", "C0956D5F334B"], "device_info": {"mac": "C0:95:6D:5F:33:4B", "model": "AppleTV4KGen3", "model_str": "Apple TV 4K (gen 3)", "operating_system": "TvOS", "version": "17.2"}, "services": [{"protocol": "companion", "port": 49153}, {"protocol": "airplay", "port": 7000}, {"protocol": "raop", "port": 7000}]}, {"name": "Livingroom", "address": "192.168.1.112", "identifier": "AC:BC:B5:D3:71:9F", "all_identifiers": ["AC:BC:B5:D3:71:9F", "ACBCB5D3719F"], "device_info": {"mac": "AC:BC:B5:D3:71:9F", "model": "HomePodGen2", "model_str": "HomePod (gen 2)", "operating_system": "Unknown", "version": "17.2"}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "companion", "port": 49153}, {"protocol": "raop", "port": 7000}]}, {"name": "Remo\u2019s MacBook Pro (97)", "address": "192.168.1.250", "identifier": "F8:4D:89:78:DC:06", "all_identifiers": ["F8:4D:89:78:DC:06", "F84D8978DC06"], "device_info": {"mac": "F8:4D:89:78:DC:06", "model": "Unknown", "model_str": "MacBookPro18,4", "operating_system": "MacOS", "version": null}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "companion", "port": 50432}, {"protocol": "raop", "port": 7000}]}]}
[1/23/2024, 8:35:05 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][4N] /var/lib/homebridge/appletv-enhanced/.venv/bin/atvscript exited with code: 0
[1/23/2024, 8:35:05 AM] [Apple TV Enhanced] [D] Platform: finished multicast device discovery
[1/23/2024, 8:35:05 AM] [Apple TV Enhanced] [D] Platform: Found Apple TV Apple TV (C0:95:6D:5F:33:4B / 192.168.1.186).
[1/23/2024, 8:35:05 AM] [Apple TV Enhanced] [D] Platform: Apple TV Apple TV (C0:95:6D:5F:33:4B) with UUID 6c0c9b54-1717-4339-a7a5-5f676de7d85e already exists. Skipping.
[1/23/2024, 8:35:05 AM] [Apple TV Enhanced] [D] Platform: Finished device discovery.
[1/23/2024, 8:35:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Rocket Remote: app_list
[1/23/2024, 8:35:09 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Rocket Remote: App: Fitness (com.apple.Fitness), App: Podcasts (com.apple.podcasts), App: Filme (com.apple.TVMovies), App: Prime Video (com.amazon.aiv.AIVApp), App: TV (com.apple.TVWatchList), App: Fotos (com.apple.TVPhotos), App: App Store (com.apple.TVAppStore), App: Play SRF (ch.srf.srfplayer), App: Sky (com.homedia.sky), App: Arcade (com.apple.Arcade), App: Suchen (com.apple.TVSearch), App: Computer (com.apple.TVHomeSharing), App: FaceTime (com.apple.facetime), App: ARTE (tv.arte.plus7), App: YouTube (com.google.ios.youtube), App: PlaySuisse (ch.srgssr.playsuisse.tv), App: Speedtest (com.ookla.speedtest), App: Disney+ (com.disney.disneyplus), App: Einstellungen (com.apple.TVSettings), App: Netflix (com.netflix.Netflix), App: Musik (com.apple.TVMusic)

Well, so far, nothing special in the boot-log i think... So i went further and turned on my Apple TV Gen3 4k:

[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] stdout: {"result": "success", "datetime": "2024-01-23T11:48:26.077380+01:00", "volume": 0.0}
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] > {"result": "success", "datetime": "2024-01-23T11:48:26.077380+01:00", "volume": 0.0}
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No hash value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.077380+01:00","volume":0})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No mediaType value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.077380+01:00","volume":0})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No deviceState value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.077380+01:00","volume":0})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No title value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.077380+01:00","volume":0})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No artist value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.077380+01:00","volume":0})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No album value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.077380+01:00","volume":0})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No genre value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.077380+01:00","volume":0})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No totalTime value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.077380+01:00","volume":0})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No position value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.077380+01:00","volume":0})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No shuffle value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.077380+01:00","volume":0})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No repeat value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.077380+01:00","volume":0})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No app value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.077380+01:00","volume":0})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No appId value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.077380+01:00","volume":0})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No powerState value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.077380+01:00","volume":0})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No focusState value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.077380+01:00","volume":0})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] stdout: {"result": "success", "datetime": "2024-01-23T11:48:26.662233+01:00", "volume": 50.0}
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] > {"result": "success", "datetime": "2024-01-23T11:48:26.662233+01:00", "volume": 50.0}
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No hash value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.662233+01:00","volume":50})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No mediaType value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.662233+01:00","volume":50})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No deviceState value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.662233+01:00","volume":50})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No title value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.662233+01:00","volume":50})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No artist value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.662233+01:00","volume":50})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No album value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.662233+01:00","volume":50})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No genre value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.662233+01:00","volume":50})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No totalTime value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.662233+01:00","volume":50})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No position value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.662233+01:00","volume":50})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No shuffle value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.662233+01:00","volume":50})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No repeat value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.662233+01:00","volume":50})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No app value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.662233+01:00","volume":50})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No appId value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.662233+01:00","volume":50})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No powerState value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.662233+01:00","volume":50})
[1/23/2024, 11:48:26 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] No focusState value found in input ({"result":"success","datetime":"2024-01-23T11:48:26.662233+01:00","volume":50})
[1/23/2024, 11:48:36 AM] [Apple TV Enhanced] [D] Platform: Starting device discovery ...
[1/23/2024, 11:48:36 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] /var/lib/homebridge/appletv-enhanced/.venv/bin/atvscript scan
[1/23/2024, 11:48:42 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] stdout: {"result": "success", "datetime": "2024-01-23T11:48:42.772876+01:00", "devices": [{"name": "Livingroom", "address": "192.168.1.112", "identifier": "AC:BC:B5:D3:71:9F", "all_identifiers": ["AC:BC:B5:D3:71:9F", "ACBCB5D3719F"], "device_info": {"mac": "AC:BC:B5:D3:71:9F", "model": "HomePodGen2", "model_str": "HomePod (gen 2)", "operating_system": "Unknown", "version": "17.2"}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "companion", "port": 49153}, {"protocol": "raop", "port": 7000}]}, {"name": "Denon DRA-800H", "address": "192.168.1.101", "identifier": "00:06:78:B6:9B:FA", "all_identifiers": ["00:06:78:B6:9B:FA", "000678B69BFA"], "device_info": {"mac": "00:06:78:B6:9B:FA", "model": "Unknown", "model_str": "Denon DRA-800H", "operating_system": "Unknown", "version": null}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "raop", "port": 7000}]}, {"name": "Sonos 2.1", "address": "192.168.1.60", "identifier": "F0:F6:C1:A4:C4:EE", "all_identifiers": ["F0:F6:C1:A4:C4:EE", "F0F6C1A4C4EE"], "device_info": {"mac": "F0:F6:C1:A4:C4:EE", "model": "Unknown", "model_str": "Era 100", "operating_system": "Unknown", "version": null}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "raop", "port": 7000}]}, {"name": "Remo\u2019s MacBook Pro (97)", "address": "192.168.1.250", "identifier": "F8:4D:89:78:DC:06", "all_identifiers": ["F8:4D:89:78:DC:06", "F84D8978DC06"], "device_info": {"mac": "F8:4D:89:78:DC:06", "model": "Unknown", "model_str": "MacBookPro18,4", "operating_system": "MacOS", "version": null}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "companion", "port": 50432}, {"protocol": "raop", "port": 7000}]}, {"name": "Apple TV", "address": "192.168.1.186", "identifier": "C0:95:6D:5F:33:4B", "all_identifiers": ["D4ED48E4-4C88-47C0-B05C-077747F85C5D", "C0:95:6D:5F:33:4B", "C0956D5F334B"], "device_info": {"mac": "C0:95:6D:5F:33:4B", "model": "AppleTV4KGen3", "model_str": "Apple TV 4K (gen 3)", "operating_system": "TvOS", "version": "17.2"}, "services": [{"protocol": "companion", "port": 49153}, {"protocol": "airplay", "port": 7000}, {"protocol": "raop", "port": 7000}]}]}
[1/23/2024, 11:48:43 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][1L] /var/lib/homebridge/appletv-enhanced/.venv/bin/atvscript exited with code: 0
[1/23/2024, 11:48:43 AM] [Apple TV Enhanced] [D] Platform: finished multicast device discovery
[1/23/2024, 11:48:43 AM] [Apple TV Enhanced] [D] Platform: Found Apple TV Apple TV (C0:95:6D:5F:33:4B / 192.168.1.186).
[1/23/2024, 11:48:43 AM] [Apple TV Enhanced] [D] Platform: Apple TV Apple TV (C0:95:6D:5F:33:4B) with UUID 6c0c9b54-1717-4339-a7a5-5f676de7d85e already exists. Skipping.
[1/23/2024, 11:48:43 AM] [Apple TV Enhanced] [D] Platform: Finished device discovery.
[1/23/2024, 11:48:47 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Rocket Remote: app_list
[1/23/2024, 11:48:47 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Rocket Remote: App: Fitness (com.apple.Fitness), App: Podcasts (com.apple.podcasts), App: Filme (com.apple.TVMovies), App: Prime Video (com.amazon.aiv.AIVApp), App: TV (com.apple.TVWatchList), App: Fotos (com.apple.TVPhotos), App: App Store (com.apple.TVAppStore), App: Play SRF (ch.srf.srfplayer), App: Sky (com.homedia.sky), App: Arcade (com.apple.Arcade), App: Suchen (com.apple.TVSearch), App: Computer (com.apple.TVHomeSharing), App: FaceTime (com.apple.facetime), App: ARTE (tv.arte.plus7), App: YouTube (com.google.ios.youtube), App: PlaySuisse (ch.srgssr.playsuisse.tv), App: Speedtest (com.ookla.speedtest), App: Disney+ (com.disney.disneyplus), App: Einstellungen (com.apple.TVSettings), App: Netflix (com.netflix.Netflix), App: Musik (com.apple.TVMusic)

And after that, i tunred it off again:

[1/23/2024, 11:49:36 AM] [Apple TV Enhanced] [D] Platform: Starting device discovery ...
[1/23/2024, 11:49:36 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][P] /var/lib/homebridge/appletv-enhanced/.venv/bin/atvscript scan
[1/23/2024, 11:49:42 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][P] stdout: {"result": "success", "datetime": "2024-01-23T11:49:42.790903+01:00", "devices": [{"name": "Remo\u2019s MacBook Pro (97)", "address": "192.168.1.250", "identifier": "F8:4D:89:78:DC:06", "all_identifiers": ["F8:4D:89:78:DC:06", "F84D8978DC06"], "device_info": {"mac": "F8:4D:89:78:DC:06", "model": "Unknown", "model_str": "MacBookPro18,4", "operating_system": "MacOS", "version": null}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "companion", "port": 50432}, {"protocol": "raop", "port": 7000}]}, {"name": "Denon DRA-800H", "address": "192.168.1.101", "identifier": "00:06:78:B6:9B:FA", "all_identifiers": ["00:06:78:B6:9B:FA", "000678B69BFA"], "device_info": {"mac": "00:06:78:B6:9B:FA", "model": "Unknown", "model_str": "Denon DRA-800H", "operating_system": "Unknown", "version": null}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "raop", "port": 7000}]}, {"name": "Apple TV", "address": "192.168.1.186", "identifier": "C0:95:6D:5F:33:4B", "all_identifiers": ["D4ED48E4-4C88-47C0-B05C-077747F85C5D", "C0:95:6D:5F:33:4B", "C0956D5F334B"], "device_info": {"mac": "C0:95:6D:5F:33:4B", "model": "AppleTV4KGen3", "model_str": "Apple TV 4K (gen 3)", "operating_system": "TvOS", "version": "17.2"}, "services": [{"protocol": "companion", "port": 49153}, {"protocol": "airplay", "port": 7000}, {"protocol": "raop", "port": 7000}]}, {"name": "Sonos 2.1", "address": "192.168.1.60", "identifier": "F0:F6:C1:A4:C4:EE", "all_identifiers": ["F0:F6:C1:A4:C4:EE", "F0F6C1A4C4EE"], "device_info": {"mac": "F0:F6:C1:A4:C4:EE", "model": "Unknown", "model_str": "Era 100", "operating_system": "Unknown", "version": null}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "raop", "port": 7000}]}, {"name": "Livingroom", "address": "192.168.1.112", "identifier": "AC:BC:B5:D3:71:9F", "all_identifiers": ["AC:BC:B5:D3:71:9F", "ACBCB5D3719F"], "device_info": {"mac": "AC:BC:B5:D3:71:9F", "model": "HomePodGen2", "model_str": "HomePod (gen 2)", "operating_system": "Unknown", "version": "17.2"}, "services": [{"protocol": "airplay", "port": 7000}, {"protocol": "companion", "port": 49153}, {"protocol": "raop", "port": 7000}]}]}
[1/23/2024, 11:49:43 AM] [Apple TV Enhanced] [V] CustomPyATVInstance: [node-pyatv][P] /var/lib/homebridge/appletv-enhanced/.venv/bin/atvscript exited with code: 0
[1/23/2024, 11:49:43 AM] [Apple TV Enhanced] [D] Platform: finished multicast device discovery
[1/23/2024, 11:49:43 AM] [Apple TV Enhanced] [D] Platform: Found Apple TV Apple TV (C0:95:6D:5F:33:4B / 192.168.1.186).
[1/23/2024, 11:49:43 AM] [Apple TV Enhanced] [D] Platform: Apple TV Apple TV (C0:95:6D:5F:33:4B) with UUID 6c0c9b54-1717-4339-a7a5-5f676de7d85e already exists. Skipping.
[1/23/2024, 11:49:43 AM] [Apple TV Enhanced] [D] Platform: Finished device discovery.
[1/23/2024, 11:49:47 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Rocket Remote: app_list
[1/23/2024, 11:49:47 AM] [Apple TV Enhanced] [D] Apple TV (C0:95:6D:5F:33:4B): Rocket Remote: App: Fitness (com.apple.Fitness), App: Podcasts (com.apple.podcasts), App: Filme (com.apple.TVMovies), App: Prime Video (com.amazon.aiv.AIVApp), App: TV (com.apple.TVWatchList), App: Fotos (com.apple.TVPhotos), App: App Store (com.apple.TVAppStore), App: Play SRF (ch.srf.srfplayer), App: Sky (com.homedia.sky), App: Arcade (com.apple.Arcade), App: Suchen (com.apple.TVSearch), App: Computer (com.apple.TVHomeSharing), App: FaceTime (com.apple.facetime), App: ARTE (tv.arte.plus7), App: YouTube (com.google.ios.youtube), App: PlaySuisse (ch.srgssr.playsuisse.tv), App: Speedtest (com.ookla.speedtest), App: Disney+ (com.disney.disneyplus), App: Einstellungen (com.apple.TVSettings), App: Netflix (com.netflix.Netflix), App: Musik (com.apple.TVMusic)

And now it's getting really interesting - search trough the logs for the name "MacBook Pro", and at least in the "turn-off" log, you find it!

Does that mean that my Macbook Pro is somehow registered as the Apple TV? Seems like! This could also explain the "can be reached on OSI Layer 2 but not on 3" i guess

@maxileith
Copy link
Owner

Does that mean that my Macbook Pro is somehow registered as the Apple TV?

No, the plugin is just searching for devices and finds your MacBook. As you can see from the log, the plugin is not adding your MacBook as an Apple TV, just the actual Apple TV. Verbose log removed:

[1/23/2024, 11:48:36 AM] [Apple TV Enhanced] [D] Platform: Starting device discovery ...
[1/23/2024, 11:48:43 AM] [Apple TV Enhanced] [D] Platform: finished multicast device discovery
[1/23/2024, 11:48:43 AM] [Apple TV Enhanced] [D] Platform: Found Apple TV Apple TV (C0:95:6D:5F:33:4B / 192.168.1.186).
[1/23/2024, 11:48:43 AM] [Apple TV Enhanced] [D] Platform: Apple TV Apple TV (C0:95:6D:5F:33:4B) with UUID 6c0c9b54-1717-4339-a7a5-5f676de7d85e already exists. Skipping.
[1/23/2024, 11:48:43 AM] [Apple TV Enhanced] [D] Platform: Finished device discovery.

So from the logs that you have provided, I cannot see anything wrong. It would be intresting to get the verbose logs of the moment the unexpected behaviour appears.

Regarding Apple TV can be reached on OSI Layer 2 but not on 3. The check is part of the startup procedure. It is weird that this does not always occur on your side. This could probably be fixed as part of #8.

@rvetere
Copy link
Author

rvetere commented Jan 24, 2024

ok, strange that nothing wrong can be seen then... well, i guess as i am the only one with this issue, from my side, you can close this ticket and i'm good so far... i will replace my apple tv remote with something working and deinstall the plugin then (sorry, really no offense)

@rvetere rvetere closed this as not planned Won't fix, can't repro, duplicate, stale Jan 26, 2024
@maxileith
Copy link
Owner

@rvetere I'm sorry that the issue is still there on your side. I hope you find a solution that works out for you.

@rvetere
Copy link
Author

rvetere commented Jan 26, 2024

@maxileith All good so far and sorry for my passive aggressive tone i stumbled into meanwhile 🙏 I can get very emotional with tech stuff and that's not good in open source communities (i basically should know that after 20 years of programming -.-)

I have a solution now - it's the Flirc USB dongle and the Flirc Skip Remote:

  • I throw away the original apple tv remote and use the skip remote now - the skip remote natively supports all Apple TV generations
  • With the skip remote, it's possible to record keys on the flirc usb dongle (not possible with the apple remote as flirc doesn't support RF devices)
  • With the Flirc USB, i can record the "power" button of the skip remote and not just power on my apple tv, but also execute a keyboard shortcut on my custom raspberry pi (which is in place now besides the apple tv, just for this single purpose)
  • Next i'm going to use an app launcher for linux, which gives me the possibility to execute a custom "curl" command on that keyboard hotkey -> so i press power on, the flirc dongle receives that and executes a curl request on my network
  • I programmed a new homebridge plugin that gives me virtual buttons, and an HTTP interface to update/toggle these buttons -> so i can send the right HTTP request with my curl command, and toggle a virutal button called "cinema on"
  • After all, i can add an automation in homekit, based on that virtual button, which will execute my wanted logic like "decline the canvas, and during daytime, close all blinds, turn off all lights"

For anybody curious, here is my virtual-button plugin: https://github.com/rocket-monkey/homebridge-virtual-button
But it's not finished yet, i'm working on the HTTP updates right now and will deliver documentation too once done

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

5 participants