AppleTV IP control?

Has anyone thought about developing a binding for IP control of (non jail broken) Apple TV’s?

Several of the expensive home automation companies offer this (Crestron, RTI) and so does Roomie and iRule.

The protocol is not public, and would require a lot of reverse engineering. This article http://www.cepro.com/article/apple_tv_gen_2_and_3_cracked_rti_gets_two-way_ip_control discusses how RTI did it.

The pairing process for iTunes was reverse engineered around 2008. The article has links to http://dacp.jsharkey.org/ and http://blog.mycroes.nl/2008/08/pairing-itunes-remote-app-with-your-own.html. This blog is also interesting http://jinxidoru.blogspot.com/2009/06/itunes-remote-pairing-code.html

The article suggests, that a lot of the code in iTunes and Airplay was reused in AppleTV. There is an iphone app that controls the AppleTV over IP, which can be wiresharked. I could be a tester of this binding, if anyone is up for the challenge.

2 Likes

Seconded - would be very handy to have this control.

I found another useful reference to this:
http://stackoverflow.com/questions/35355807/has-anyone-reversed-engineered-the-protocol-used-by-apples-ios-remote-app-for-c
(We need to recruit this guy to work on openHAB!)

Also, in this Podcast interview, Will Price of Roomie Remote talks about how they got IP control of AppleTV. Basically, he says that once you have iTunes control, getting AppleTV control isn’t that much harder.
http://www.htguys.com/podcasts/2014/9/12/podcast-652-interview-with-will-price-of-roomie-remote.html

By searching google for “github” and “appletv, airplay, daap, mdns”, there are is lots of information about the appletv communication protocol. For reference, I’ll post several of the most promising.

  1. https://github.com/benumc/Apple-TV-Basic-IP This is for integration with Savant home automation systems.
  2. https://github.com/jeanregisser/mediaremotetv-protocol This link describes the protocol, with emphasis on the latest gen 4 Apple TV.
  3. https://github.com/skevy/atlas-backend/blob/master/atlas/services/appletv.coffee This appears to be a module for a different automation program.
  4. https://github.com/jkiddo/jolivia Not really Apple TV, but has java implementation of several apple protocols.

Any developers interested in taking this on?

  1. There is an iPad only app called ytrack, that is still available, but not actively maintained. This app is designed to control iTunes, not Apple TV. But,I was able to pair my Apple TV, gen 2. The app has play/pause toggle button and forward and reverse buttons, which do work when an Apple TV video is playing. Also, the “album art” from the show I was watching shows up on the ipad, in the app. Several of the control buttons (left, right, up, down, select, home, menu) are not available. The source code for the app is available in the google code archives. It is written in objective C. https://code.google.com/archive/p/ytrack/wikis

  2. I noticed that the original Sharkey code had a login of

http://192.168.254.128:3689/login?pairing-guid=0x0000000000000001

but the newer versions do this:

http://#{@ip}:3689/login?hasFP=1&hsgid=#{@remote_guid}

I speculate that the “hasFP” stands for Fairplay DRM encryption.

  1. The protocol in the mediaremotetv-protocol mentioned above appears to be a brand new protocol that is unique to the generation 4 Apple TV.