I'm having a problem using getScenes. I am doing a PUT request with the password as a parameter, but getting no response. I tried several different CURL options with no luck. getRooms uses the GET method, and that works fine and my thermostat PUT requests also work fine. What could I be doing wrong?
Problem getting scenes
- 145 Views
- Last Post 15 October 2014
This is what I use for setting thermostat values and modes, which works fine for that. It doesn't work with the getScenes command.
[code]$data['password'] = $pass;
$fields = httpbuildquery($data);
$cl = strlen($fields);
$url="http://" . $host . ":" . $port . "/zwave/" . $command . '?' . $fields;
$ch = curlinit($url);
curlsetopt($ch, CURLOPTRETURNTRANSFER, true);
curlsetopt($ch, CURLOPTPUT, true);
curlsetopt($ch, CURLOPTHTTPHEADER, array('Content-Type: application/json','Content-Length: ' . $cl));
$response = curlexec($ch);
I got it working. The parameters need to be in json format for getScenes, http query format for thermostat commands.
It seems like every request requires a different format - like getRooms is a straightforward GET request.