Skip to content

Roomtrol Daemon and Curl

rchristensen edited this page Oct 7, 2011 · 2 revisions

Checking the status of Roomtrol via curl $

The HTTP server that is parsing these HTTP requests lives at: [lib/roomtrol/wescontrol_http.rb]

Confirming that roomtrol is running

One way to check that the roomtrol daemon is running to curl localhost:1412

$ curl localhost:1412/devices
{"devices":["Extron","dvdplayer","projector",null]}

Check status of projector via curl

You can check the value of any state_var by querying /devices/projector with the vvalue you want to know about. So, for example, if you want to check if the projector's power field is on (true) send a GET HTTP request:

curl -XGET localhost:1412/devices/projector/power

Turning projector on or off via curl

To turn a projector on send a post request to devices/projector/power curl -XPOST -d '{"value": true}' localhost:1412/devices/projector/power

To turn a projector off send a post request to devices/projector/power curl -XPOST -d '{"value": false}' localhost:1412/devices/projector/power