Page 1 of 1

URL to set the temperature for a thermostat..

Posted: 19 Nov 2016 05:25
by golaonline
Hi,

I am trying to find out the URL that I can use the set the temperature of a thermostat via code. I understand, I should be using the Virtual Device (/ZAutomation) APIs for that... I can get the device information by http://<IP>:8083/ZAutomation/api/v1/devices/<DEVICE_ID>, but cannot find anywhere what other commands are supported and how they are supported.

1. Is there any documentation that is available? I read http://razberry.z-wave.me/docs/zway.pdf, but could not find any details.
2. I am using the correct layer of API?
3. Also, my 'one' thermostat resulted into 8 devices on UI as below, how do I find the co-relation between virtual devices and thermostat.
Screen Shot 2016-11-18 at 6.21.17 PM.png
Screen Shot 2016-11-18 at 6.21.17 PM.png (234.19 KiB) Viewed 10820 times

Re: URL to set the temperature for a thermostat..

Posted: 21 Dec 2016 01:42
by kWave
Hi,

the UI is doing nothing else than accessing the API from within your Browser when you change the value of your Thermostat.

That makes it pretty easy to "sniff" HTTP commands sent to the API.

Try this:
1.) Open the UI (http://IP:8083/smarthome/) in FIrefox or Chrome.
2.) Navigate to your Device you want to change (or Scene to activate, that also works!).
3.) Open the Web Development Console of your Browser (either via settings or just do a right-click somewhere and click on "Inspect Element". You may have to scale up the Console to see everything.
4.) Go to the Network Tab of the Web Development Concole.
5.) Now change the Value of your Device as you would normally do.
6.) While you do this, have a sharp look at your Network Tab.
There should come up something like "exact?level=22.5" or "devices[9].instances[0].commandClasses[32].Set(50)".
7.) Click on this line and it will show you the full URL like
"http://IP:8083/ZAutomation/api/v1/devic ... level=22.5" or
"http://IP:8083/ZWave.zway/Run/devices[9 ... .Set(22.5)" (most likely to be seen in Expert Mode)

The 22.5 at the end of the URL is the value you have just set.
You can open this Address from every Device in your network and engage the desired action.

If you want to read out a Sensors value you can use the second URL and just cut off everything behind "devices[x]".
"http://IP:8083/ZWave.zway/Run/devices[9]".
This will give you all information about this device in JSON-Format.
Just look for "level" and go up the JSON-Tree to build the address.
For example:
"http://IP:8083/ZWave.zway/Run/devices[9 ... evel.value"
This will show the value of the Sensor in your Browser.

Have fun!

Re: URL to set the temperature for a thermostat..

Posted: 03 Jan 2017 22:33
by golaonline
Thanks for the reply, I was able to use these details to see what calls are being made and what parameters are being passed for specific actions.