myServer 6 supports AppleTV (4Gen and newer) via IP

The myServer user interface mimics the handheld IR remote control.

It also adds in support to view / click on all of your popular media "Apps" that are installed on the AppleTV.

Prerequisites:

IP Control of an AppleTV requires that the Python package called ATVRemote is installed on the same device where myServer is running. If you have purchased a controller from us the atvremote package is preinstalled. There is nothing to do.

If you are running myServer on your own hardware you will have to manually install the Python and the ATVRemote software on your controller.

Please see the documentation on the pyatv website for instructions on installing ATVRemote.  (https://pyatv.dev/)

 

 

Installation:

Install the AppleTV driver, navigate to the AppleTV driver page and click on the Discover button on the bottom of the page.

Note: the AppleTV must be on same "control" subnet network as myServer 6.

For security, the AppleTV will require for you to perform two separate pairing operations pair with myServer6.  The first for Airplay and the second for Companion protocols.

From the AppleTV drivers page click on the Driver command testing button and select the PairAirplay command from the drop down.

From the Target Device dropdown select the AppleTV device that needs to be paired. 

Please make sure you are performing these operations from the same PC that myServer is running on. Also have a TV connected to the AppleTV that will be paired and have the AppleTV sitting on the top menu screen.

AppleTVPair 1

Click on the Execute command button and a new dialog will appear.

AppleTVPair 2

Open up a new terminal window and grab the text displayed in the textbox that starts with atvremote and ends with pair. Copy and paste this text into the terminal window you just opened.

AppleTVPair 3

Press enter and watch the screen on the TV where AppleTV is playing. You will see a 4 digit pin code pop up on the screen.

Enter those 4 digits at the "Enter PIN on Screen:" prompt in the terminal window. This will generate the final Airplay authentication token.

AppleTVPair 4

Next grab that token by highlighting the entire token and right-click and select copy.

AppleTVPair 5

Now go back to the dashboard and close the Driver Command Testing window and click on the pencil icon next to the AppleTV device you are pairing. This will bring up that device editing window.

AppleTVPair 6

 Paste the authentication token you just copied into the Notes field in the editor window and click save.

Next go back into the Driver Command Testing and this time select the PairCompanion command. We are going to repeat the same process for the companion token.

AppleTVPair 7

Click Execute Command and the new pairing instructions window will display.

AppleTVPair 8

Once again open a terminal window and copy and paste the command into the terminal window.

AppleTVPair 9

Press enter and then get the new 4 digit code off the TV and enter it at the PIN code prompt to generate the companion authentication token.

AppleTVPair 10

Once again copy this new token like the previous one.

AppleTVPair 11

and then close the Command testing window and re-edit the AppleTV device. This time paste the new token into the Members field in the editor window.

AppleTVPair 12

Press save.

Next to test everything has worked properly once again open the Command Testing window and this time select the SelectDevice command. You can then try clicking on the buttons in the AppleTV testing widow. Click on the cursor keys to prove that you can navigate the AppleTV interface. 

AppleTVPair 13

If you can navigate the display then you can successfully paired the AppleTV.

This process will need to be repeated for every AppleTV you want to control.

 

You can also control the AppleTV via IR:

 Installation Info:

Typically the IR would be via a Global Cache IP2IR hardware.

4K Apple TV IR Sensor location

On the 4th generation AppleTV the IR sensor was located about ½ inch to the left of the LED on the box's front side. Through experimentation we have found that it has been moved on the 4K AppleTV. The new location is about 1" in from the left side edge of the box on the front.

 

3/15/2024: We have now implemented a .Net to Python bridge and the driver now has a permanent connection to the AppleTV via the bridge. Commands are now just as good as using the apple remote. (At least in our office.)

The latest server update has the bridge and the latest AppleTV driver will use it. It should just work. If it does not we will have to remote into your server to investigate. It has worked for us on three systems co far.

Please note if you are running myServer on a Windows PC this will not work for you unless you have installed Python on your PC and you manually start the bridge. Same caveat holds true for any customer that has rolled their own hardware. Some user intervention will be required.

 

If the Device Address field is blank and the Serial Number file has the Device Address in it:  Usually on a successful discover the serial number should contain a long GUID unique identifier and the Device Address field will have the AppleTV  mac address.

With the Device Address file blank the driver is not able to authenticate with the AppleTV.  Edited the AppleTV entry and copy the Server number field over to the Device address field and now the driver sees all your apps.

So, check to see if your Device Address field is  blank. If it is make the save changes as per above. If you still have issues then let Allonis remote in and have a look.

If you are interested in building your own app launcher page the driver supports a Launch command that you can use to run any app on the AppleTV.

The general syntax of the command is AV|<appletv id>~Launch~<name of appletv app to run>
If your AppleTV's id was 7 and you wanted a launch netflix button the command would look like.

AV|7~Launch~com.netflix.Netflix

You can get the actual name of the app by watching the myServer event log when you launch the app from the default page.

Some common AppleTV aps and their names are

Emby (emby.media.emby-tvos)
Arcade (com.apple.Arcade)
Hulu (com.hulu.plus)
TCM (com.tcm.tcm)
TV Shows (com.apple.TVShows)
DIRECTV (com.att.tv)
Music (com.apple.TVMusic)
Discovery GO (com.discovery.mobile.discoverygo)
Tubi (com.adrise.tubitv)
TV (com.apple.TVWatchList)
YouTube (com.google.ios.youtube)
Movies (com.apple.TVMovies)
TNT (com.turner.TNT)
The CW (com.cw.fullepisodes.ios)
Fitness (com.apple.Fitness)
A&E (com.aetn.aetv.ios.watch)
Freeform (com.abcfamily.videoplayer)
AMC (com.amctve.amcfullepisodes)
ABC (com.abcdigital.abc.videoplayer)
CNN (com.cnn.iphone)
Tennis Channel (com.tennischannel.tceverywhere)
Netflix (com.netflix.Netflix)
NBC (com.nbcuni.nbc.portal)
SYFY (com.nbcuni.syfy.syfychannel)
Comedy Central (com.mtvn.ccnetwork)
Crackle (com.crackle.crackle-iphone)
EPIX (com.epix.epixhd),
Prime Video (com.amazon.aiv.AIVApp)
Plex (com.plexapp.plex)
Podcasts (com.apple.podcasts)