We’ll format this into a DDK update, but this content should be what you need:
Roomie Agent is able to trigger an activity in response to an HTTP POST request submitted to Roomie Agent’s built-in web server. The URL used to run an activity is as follows:
:47147/api/v1/runactivity
(Replace in the above URL with the IP address of your OS X system running Roomie Agent.)
The data POSTed to the above URL is a JSON data structure of the form:
{
‘activity_uuid' : '637668FB-89BC-49D1-B43C-7D081088C93C',
‘toggle_state' : ‘on',
‘delay' : 60
}
The ‘toggle_state’ parameter is only applicable to toggle activities (those with an on or off setting). To toggle the activity off, specify a value of ‘off’ instead of ‘on’. If the activity is not a toggle activity, the entire ‘toggle_state’ line should be omitted.
The ‘delay’ parameter is optional, and if present, specifies how many seconds to wait before triggering the activity. If a delay is specified, it’s value must be greater than or equal to 1.0.
JSON’s formatting is somewhat fragile, so care should be taken to properly quote the parameter names and values, and also ensure that commas appear after each value (except for the last — 60 in this example).
The value 637668FB-89BC-49D1-B43C-7D081088C93C should be replaced with the UUID of the activity that you would like trigger. The activity UUID can be found in Roomie.plist (Roomie Agent’s “Backup Configuration…” menu command is useful for creating a copy of the configuration). A text editor such as TextMate should be able to display Roomie.plist, wherein the activities for each room will appear in a “sources” section. Here’s the activity from the current example:
{ actions = ( );
guideUUID = "B1E7837D-8132-4718-8828-3512E81D0B73";
icon = "logo-roku";
name = "Watch Roku";
open = "1CA6C27B-2AC8-4E73-9F64-1490EE5931C5";
transition = 1;
uuid = "637668FB-89BC-49D1-B43C-7D081088C93C";
volume = 3;
vuuid = "E15A12CC-BB93-4673-AB1F-AEDB91B297D4";
},
Note the “uuid” for the above activity is "637668FB-89BC-49D1-B43C-7D081088C93C”.
As an alternative to opening Roomie’s configuration, the list of activities and their UUIDs can be obtained from Roomie Agent’s web server by using the following URL (this can be opened in a web browser such as Safari):
:47147/api/v1/activities
Each activity listed in the output will look something like:
{
"icon" : "logo-roku",
"roomuuid" : "AB4B9EC8-2BC2-48BA-8A9F-4868281E2249",
"name" : "Home: Watch Roku",
"uuid" : "637668FB-89BC-49D1-B43C-7D081088C93C"
},
Note: The uuid will contain a ‘+’ or ‘-‘ at the end of the string for toggle-based activities. This extra character may be removed or left intact as it is ignored by Roomie Agent.
Putting it all together, the following can be run from a command line to run an activity:
$ curl ‘http://10.0.0.50:47147/api/v1/runactivity'; -d ‘{ “activity_uuid” : "637668FB-89BC-49D1-B43C-7D081088C93C” }'
Thank you.