help with command line / web service use in batch files using curl

  • 61 Views
  • Last Post 27 February 2013
MadSci posted this 23 February 2013

I'm learning how to write batch files which use curl to execute InControl commands. I was able to get the activatescene example to work in a .bat with curl. I'm trying to use the SetDeviceState command and it's not working. I'm seeing "Endpoint not found".

curl -X PUT -H "Content-Type:application/json;charset=utf-8" -d "{""password"":""12345"",""nodeId"":""c142780a-5e60-4a13-8b93-075a63314a22"",""powered"":""True""}" http://localhost:1178/zwave/setDeviceStateByGuid


If I try the command using the webpage-based command, everything works:

http://localhost:1178/zwave//setDeviceState?nodeId=c142780a-5e60-4a13-8b93-075a63314a22&powered=true&password=12345

Any ideas?


In this case you'd want to use a GET instead of PUT.

Something like this:

curl -X GET -H "Content-Type:application/json;charset=utf-8" http://localhost:1178/zwave//setDeviceState?nodeId=c142780a-5e60-4a13-8b93-075a63314a22&powered=true&password=12345

Also, for what it's worth, one of our users AdamCaz has a cmd line utility he wrote to handle all this stuff automatically. He saw a post within the last 24 hours with a link to download it.

Order By: Standard | Newest | Votes
Ryan-Scott posted this 25 February 2013

I'm learning how to write batch files which use curl to execute InControl commands. I was able to get the activatescene example to work in a .bat with curl. I'm trying to use the SetDeviceState command and it's not working. I'm seeing "Endpoint not found".

curl -X PUT -H "Content-Type:application/json;charset=utf-8" -d "{""password"":""12345"",""nodeId"":""c142780a-5e60-4a13-8b93-075a63314a22"",""powered"":""True""}" http://localhost:1178/zwave/setDeviceStateByGuid


If I try the command using the webpage-based command, everything works:

http://localhost:1178/zwave//setDeviceState?nodeId=c142780a-5e60-4a13-8b93-075a63314a22&powered=true&password=12345

Any ideas?


In this case you'd want to use a GET instead of PUT.

Something like this:

curl -X GET -H "Content-Type:application/json;charset=utf-8" http://localhost:1178/zwave//setDeviceState?nodeId=c142780a-5e60-4a13-8b93-075a63314a22&powered=true&password=12345

Also, for what it's worth, one of our users AdamCaz has a cmd line utility he wrote to handle all this stuff automatically. He saw a post within the last 24 hours with a link to download it.

MadSci posted this 27 February 2013

Thanks Works now.

I was the one who asked Adam for the utility. I'm it now in EventGhost to link up my Universal remote to InControl. For some reason it was choking on the .bat.

Close