Binding for Apple-TV

Hi All-

Sorry for not replying sooner, I’ve been away for a few weeks. I thought I’d included a reference to the problem, but I guess I never posted it. Here’s the bug report that I believe is the root of the problem some folks are seeing:

I haven’t had a chance to see if any of the related changes solve the problem; I’ll try to get to that in the next week as I get back up to speed.

I’m pretty happy with my AppleTV as a device, especially if you’ve got other Apple devices already. If you have HomeKit devices or use the OpenHAB HomeKit bridge, it can act as a HomeKit hub, which helps greatly with reliability vs just having an iPad or such. Some of the newer versions have Thread and Matter support, which I suspect will finally reach critical mass.

The big problem with AppleTV/HomePod integration is that Apple hasn’t publicly specified any of the protocols and so we’re at their mercy in terms of keeping the integration running. If you have automatic updates enabled, this can lead to things breaking while the changes are worked around.

I work on the binding in my spare time, so there are some things that I’d like to do, but haven’t found time for, yet. I do generally try to address problems when I hear about them. And of course, others are welcome to help out… I’m always glad to assist anyone wanting to get a bit more involved.

I’ve never used the google AV stuff, so I can’t really comment. Perhaps others can provide their thoughts about what works well and what doesn’t?

Hope this helps, feel free to let us know if there’s any other info we can provide.

Bill

1 Like

Thanks.
That issue seems to be fixed by : companion: Use static id for _i in _systemInfo by postlund · Pull Request #2680 · postlund/pyatv · GitHub now part of 0.16.1
I have done this test:

atvscript -s 192.168.1.107 push_updates --debug

and the log shows that the companion protocol remains connected.

So I’m a bit at a loss why it is not working:

2025-08-24 17:01:05.010 [INFO ] [nding.appletv.internal.PyATV$Scanner] - Started process 2919336
2025-08-24 17:01:05.010 [INFO ] [nding.appletv.internal.PyATV$Scanner] - Process 2919336 isRunning=true
2025-08-24 17:01:05.010 [INFO ] [nding.appletv.internal.PyATV$Scanner] - AppleTVCommandLoop: Running /var/lib/openhab/tmp/appletv-binding/bin/atvscript -i 86F37899E0E7 --raop-credentials 56211473591d5de6d426ae0a49cf76b0030b45c8b4bd8c7db97181219ce19302:9d7a02c59acc4302fb8cc439e61d1cbfd00175b308c83659dcb267ee59c4a522:38364633373839392d453045372d344541372d424339452d423337383635423344443546:65373333656336312d303530632d346335312d616239662d376232623263343163386537 --airplay-credentials 56211473591d5de6d426ae0a49cf76b0030b45c8b4bd8c7db97181219ce19302:d404ea7937ff459014cb8c47979b0ea61697d0fc08415530982bd2008b6296b0:38364633373839392d453045372d344541372d424339452d423337383635423344443546:38343736356264392d363566392d343636632d623564662d633333636237383933636232 --companion-credentials 56211473591d5de6d426ae0a49cf76b0030b45c8b4bd8c7db97181219ce19302:0b2928cdda3465ae4c75f425d0577859e687279d3621b819da19b6a3f8e6db01:38364633373839392d453045372d344541372d424339452d423337383635423344443546:66663361316465342d343462372d343363642d626665652d626466363032333662643530 command_loop
2025-08-24 17:01:06.349 [INFO ] [nding.appletv.internal.PyATV$Scanner] - queueing command: artwork
2025-08-24 17:01:06.594 [INFO ] [nding.appletv.internal.PyATV$Scanner] - AppleTVEventScanner: Command process=2919332 exited.
2025-08-24 17:01:06.594 [INFO ] [nding.appletv.internal.PyATV$Scanner] - Process 2919332 exists.
2025-08-24 17:01:06.598 [WARN ] [nding.appletv.internal.PyATV$Scanner] - PATH: /var/lib/openhab/tmp/appletv-binding/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/snap/bin

The last thing shown before thread exits is the sending of the artwork command. Unsure if it is related?

(appletv-binding) omr@shs3:~$ atvscript -s 192.168.1.107 artwork
{"result": "failure", "datetime": "2025-08-24T17:03:18.968240+02:00", "error": "unsupported_command"}
(appletv-binding) omr@shs3:~$

If you’re using the stock pyatv with the binding it won’t work as there are a number of things added to it. You’ll need to use the version that I maintain that includes the additional features. I’ve included the fix there but ran into some additional problems with the changes that came along, so I need a few days to test those out before it’s safe to update your copy.

1 Like