New AppleTV control API - aircontrol

It is now finally possible to contol the AppleTV (2nd generation) using http requests.
Firecore has released a new API which enables to send IR commands via http requests.
See API documentation here http://support.firecore.com/entries/21375902

It required a jailbroken ATV and firecore’s ATV flash $29.95

This is a great news!!! Could you give us some instruction to set it up in Vera?

To send an IR command to the AppleTV use the following code in a scene:

 luup.inet.wget("http://<IP Address of AppleTV>/remoteAction=XX")

Where XX is the following:
Menu = 1
Menu Hold = 2
Arrow Up = 3
Arrow Down = 4
Select = 5
Arrow Left = 6
Arrow Right = 7
Play/Pause = 10
Pause = 15
Play = 16
Stop = 17
Fast Forward = 18
Rewind = 19
Chapter Skip Forward = 20
Chapter Skip Backwards = 21
List/Select Hold = 22

Additional commands (undocumented):

luup.inet.wget("http://<IP Address of AppleTV>/wake=1")    -- wake AppleTV
luup.inet.wget("http://<IP Address of AppleTV>/sleep=1")    -- Sleep AppleTV
luup.inet.wget("http://<IP Address of AppleTV>/plugin=com.apple.frontrow.appliance.settings")  -- Navigate to settings menu
luup.inet.wget("http://<IP Address of AppleTV>/plugin=com.apple.frontrow.appliance.media/LocalSources")  -- Navigate to My Files menu
luup.inet.wget("http://<IP Address of AppleTV>/kf=1")      -- relaunch AppleTV (reset)
luup.inet.wget("http://<IP Address of AppleTV>/np=0")     -- ?? unknown command ??

Note: this will only work on jailbroken AppleTV G2 with ATVFlash black installed, and AirControl enabled.

Hi

Does anyone know if this can be made into a device and if it would work as an Vera AV remote control? (either web or UI5 based)

Yes, if you can find a similar http based plugin then it should be quite easy.

As starting point you may wish to look at the Tivo plugin on this thread
http://forum.micasaverde.com/index.php/topic,8835.msg72335.html#msg72335

And here is an example of it being used in Window Coverings
http://forum.micasaverde.com/index.php/topic,10556.msg73191.html#msg73191

It would be great if we can play directly a specific file or playlist. This is te common use of player In the domotic.

Do you think that is it possbile?

Otherwise we should send a macro of command without be sure that it will work.

Thank you
Matteo

Following @drag0n’s OP and @parkerc’s request for a Vera remote control, here’s a D_ and I_AppleTV2.xml file to do that. I’ve also attached a one page document describing functionality and installation.

The virtual device implements the DiscretePower, MenuNavigation, and MediaNavigation services defined by micasaverde.com. No Vera user interface is provided (because there are far better alternatives, and I consider the Vera UI to be just an installation, configuration, and maintenance tool, not a real user interface).

The two main ways of using this are by invoking the service actions from Vera scenes (or Lua code), or by accessing the service end points from a UPnP control point. I’m currently doing the former (and invoking the scenes from the excellent HomeWave app) but I’m searching for a good multi-purpose UPnP control app. Suggestions?

Also, to address @teonebello’s request for a specific file/playlist command, it turns out that an out-of-the-box Apple TV2 does have that functionality, as described here [url=http://xyrion.org/appletv/]http://xyrion.org/appletv/[/url] but this plugin doesn’t do that just now, as I’m saving that as a project for later.

I see that AppleTV has not been looked at in over 120 days. I’m wanting to setup a slow waking alarm that would play music through my apple tv or through my airport express. I would love to see something in the way of integration there and would love to see if anything has happened in the past 6 months on this topic!

:smiley:

If you have it Jail broken, then the efforts going on with XBMC should work for your needs.

[quote=“akbooer, post:8, topic:172052”]Following @drag0n’s OP and @parkerc’s request for a Vera remote control, here’s a D_ and I_AppleTV2.xml file to do that. I’ve also attached a one page document describing functionality and installation.

The virtual device implements the DiscretePower, MenuNavigation, and MediaNavigation services defined by micasaverde.com. No Vera user interface is provided (because there are far better alternatives, and I consider the Vera UI to be just an installation, configuration, and maintenance tool, not a real user interface).

The two main ways of using this are by invoking the service actions from Vera scenes (or Lua code), or by accessing the service end points from a UPnP control point. I’m currently doing the former (and invoking the scenes from the excellent HomeWave app) but I’m searching for a good multi-purpose UPnP control app. Suggestions?

Also, to address @teonebello’s request for a specific file/playlist command, it turns out that an out-of-the-box Apple TV2 does have that functionality, as described here [url=http://xyrion.org/appletv/]http://xyrion.org/appletv/[/url] but this plugin doesn’t do that just now, as I’m saving that as a project for later.[/quote]

Hi,

I get an “Invalid JSON for device #112” error message and can’t add the device in a scene. Any thoughts?

There shouldn’t be any JSON file related to this device. I take it that device 112 is indeed the one you created for this. Did you follow this installation instructions as per the documentation?

I must admit that I haven’t used this for quite a while, so I’m not sure if anything on the MiOS side has changed. What machine, what firmware are you running? WHEN do you get the error message?

[quote=“ajbaab, post:9, topic:172052”]I see that AppleTV has not been looked at in over 120 days. I’m wanting to setup a slow waking alarm that would play music through my apple tv or through my airport express. I would love to see something in the way of integration there and would love to see if anything has happened in the past 6 months on this topic!
:D[/quote]

i have had a lot of success triggering applescript with Vera. Things like starting iTunes, getting it to play over AirPlay devices, pausing and resuming play, TTS, etc. Is that what you are looking to do?

Sort of, I would be interested in looking at the applescripts however if I did that I would almost require a MacMini dedicated server…

What I would like to use since the Vera is already a server is to control my apple tv over the ip so that it could play music and turn up and down the volume based on scenes. I already have a light that dims on based on whatever time I put my wakeup alarm calendar event on google.

Set calendar to 630am light > Event starts 15 minutes prior and dims on the light. > I would like to include a slow fade in music with that.

[quote=“Bulldoglowell, post:13, topic:172052”][quote=“ajbaab, post:9, topic:172052”]I see that AppleTV has not been looked at in over 120 days. I’m wanting to setup a slow waking alarm that would play music through my apple tv or through my airport express. I would love to see something in the way of integration there and would love to see if anything has happened in the past 6 months on this topic!
:D[/quote]

i have had a lot of success triggering applescript with Vera. Things like starting iTunes, getting it to play over AirPlay devices, pausing and resuming play, TTS, etc. Is that what you are looking to do?[/quote]

I think your right, you would need a MAC as a server talking to the Apple TV or Airport as Airplay devices.

SONOS can do what you are looking for… but of course … that’s $$

But man do I love my Sonos!

[quote=“akbooer, post:12, topic:172052”]There shouldn’t be any JSON file related to this device. I take it that device 112 is indeed the one you created for this. Did you follow this installation instructions as per the documentation?

I must admit that I haven’t used this for quite a while, so I’m not sure if anything on the MiOS side has changed. What machine, what firmware are you running? WHEN do you get the error message?[/quote]

The device 112 is indeed the one I created following the instructions in the documentation. I’m on UI5 (1.5.622) using a vera2.
I get this error message when I try to add the AppleTV device. In other words in the instructions under
“Operation from a scene: Under the ADVANCED tab Pick the Apple TV device and press Add.” This gives me the error mentioned earlier.
Is there a way to delete the .xml files ? I tried to upload the files again, assuming they would just overwrite the existing ones. All I get is the same error.