Hi all,
This is a appleTV plugin for remote control and instant monitoring of activity of your appleTV devices. Hopefully with Karls blessing (well according to a User!) I have updated, started again in python3 the appleTV plugin. Using asyncio & python3.
Appears compatible with all appleTV devices, hopefully new 4k and OS16
https://github.com/Ghawken/appleTV-indigoPlugin
It uses the pyatv library (many thanks! https://github.com/postlund/pyatv) and this needs to be installed via a pip3 terminal command before usage. (Packaging it wasn't an option unfortunately as to many depencencies)
It use the pyatv PushListeners for playback activities to be immediately 'pushed' to the Indigo plugin devices. No polling required.
This means if have lights dimming up on pause and off on Play (as I do) - it should happen immediately!
New version 1.2.20 (only in Indigo 2023.2). No library or terminal commands needed, and no xattr unquarantine commands needed (!)
Potential issue:
pyatv and it’s dependencies need to compile some library code at install time. This compiling needs xcode command line tools installed on your system, if not already.
This is a potential issue for other libraries in the future as well - so installing xcode command line tools (free) advised to avoid other issues.
Install Xcode Command Line tools. (Google this for more advice - but easiest seems below)
- Code: Select all
xcode-select --installl
or
Can download directly from apple:
https://developer.apple.com/download/more/
(If you get errors (seems to stem from mini audio needing clang to compile - you may need to install xcode command line tools. Typically the pip above will prompt - but if not see end of post/FAQ for how to install manually without needing full xcode install.)
Double click the release indigoplugin File and install.
All going well - nothing will happen...
Steps:
Go to PluginConfig
This one above.
Press the "Generate AppleTV Devices"
This will search your network for appleTV device and generate plugin Devices corresponding.
These devices will be located in the main device folder, but can be moved anywhere you like later.
You can re-press and re-press the button (if you like), and new devices should not duplicate.
Devices
Next go to a Device:
Open a device, with the Edit Device Details
You should see the above.
Since OS16 and Apple4k you will need to pair your indigoplugin Device with your appleTV
Steps:
Press the Start Pairing Button.
The plugin should find and connect to your appleTV.
A pincode should be displayed on the screen.
Enter the Pincode in the box, and press submit Pincode (Press) Button.
You should receive confirmation that pairing has been successful.
Press the SAVE button on the Config Dialog.
(I believe we need to do this only once... but time will tell...)
Device Details
I expose a number of playback states (Thanks Karl for the typing on these!)
You will also see the device is an Indigo Relay - so there are Turn On/Turn Off/Toggle buttons that power down/power on the relevant appleTV.
Remote Control / Actions
The plugin exposes all remote control options via commands.
Launch App
I have also implemented Launch App - which allows you to launch a specific application of the appleTV.
Unfortunately it doesn't allow LiveTV within the app, or more detailed control - but this can be managed with a lauchApp command, and then, left, down, down, select remote commands for example
FAQ / Troubleshooting
pip3 install pyatv
Fails - with some red lines and an error about a dependency miniaudio (which we don't use...)
It appears to want to install some x-code "command line developer tools" -- commandline tools - to help build this dependency.
Install the xcode components, appears to be usr/bin/clang and hopefully will able to be installed.
Oh No - it looks like needs 14gig of Xcode for this to work. What a pain.
Try:
https://developer.apple.com/download/more/
Login and download Command Line Tools for Xcode and install.
The above worked for my production machine - which hit this issue. (avoided Xcode install thankfully)
Can't remote control certain device.
Currently I expose all airplay devices - Sonos included. I do not believe these can be controlled or report status - but have not specifically tested them.
The AppleTV devices are those we are aiming to support here.
PowerState reporting not always uptodate eg. On/Off
This is an known issue with the appleTVs particularly OS16 and above.
The removal of some of the protocols impacts this reporting, and On/Off state reporting is not always updated or correct.
This will likely vary by OS and appleTV itself.