Problem getting scenes

  • 333 Views
  • Last Post 15 October 2014
Axial-User posted this 13 October 2014

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?

Order By: Standard | Newest | Votes
monkey-magic posted this 14 October 2014

What is the full text that you are using?

Josh

Axial-User posted this 14 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);

curl
setopt($ch, CURLOPTRETURNTRANSFER, true);
curl
setopt($ch, CURLOPTPUT, true);
curl
setopt($ch, CURLOPTHTTPHEADER, array('Content-Type: application/json','Content-Length: ' . $cl));

$response = curl
exec($ch);
curl_close($ch);
if(!$response) {
return false;
}
[/code]

Axial-User posted this 15 October 2014

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.

Close