zerop Posted November 30, 2015 Posted November 30, 2015 Is it possible to run programs using the REST from a windows batch file? I've got Tasker working on my Android phone using REST to run several programs so I know the basic setup for it, but I don't know how to do it from a batch file on Windows 7 64-bit. If it's possible could someone point me in the right direction or is it pretty complicated?
Michel Kohanim Posted November 30, 2015 Posted November 30, 2015 Hi zerop, Yes, as long as you know the program ID: http://wiki.universal-devices.com/index.php?title=ISY_Developers:API:REST_Interface#Programs With kind regards, Michel
zerop Posted November 30, 2015 Author Posted November 30, 2015 Hi zerop, Yes, as long as you know the program ID: http://wiki.universal-devices.com/index.php?title=ISY_Developers:API:REST_Interface#Programs With kind regards, Michel I know the program ID but how exactly is it done? Could someone provide an example?
Michel Kohanim Posted November 30, 2015 Posted November 30, 2015 Hi zerop, /rest/programs// Example: /rest/programs/0032/runThen could be any of the following: run|runThen|runElse|stop|enable|disable|enableRunAtStartup|disableRunAtStartup With kind regards, Michel
zerop Posted November 30, 2015 Author Posted November 30, 2015 (edited) Hi zerop, /rest/programs/<id>/<cmd> Example: /rest/programs/0032/runThen <cmd> could be any of the following: run|runThen|runElse|stop|enable|disable|enableRunAtStartup|disableRunAtStartup With kind regards, Michel Yes, I understand that but how do you initiate this in the batch file? In Tasker I use the HTTP Get with the following: http://username:password@IP:port/rest/programs/programID/runThen I can't run this same thing from the command line/batch file, it doesn't work. Could someone provide example text for a batch file? Edited November 30, 2015 by zerop
gregf Posted November 30, 2015 Posted November 30, 2015 If you are wanting to use PowerShell here is an example. http://www.sytone.com/2014/10/home-automation-with-isy-and-powershell/
MWareman Posted December 1, 2015 Posted December 1, 2015 (edited) Batch files cannot themselves call a rest api. You'll need to find a helper binary, such as curl or wget (compiled for windows) and then use that as a command in your batch file to call the api. Edited December 1, 2015 by MWareman
Recommended Posts