sqmk / Phue

Philips Hue client for PHP
Other
203 stars 45 forks source link

Error on tempColor #100

Closed zoic21 closed 8 years ago

zoic21 commented 8 years ago

Hi, I got an error on set color temp :

invalid value, 177 }, for parameter, ct

Here my code :

$command = new \Phue\Command\SetLightState(3);
$command->on(true);
$command->colorTemp(177);
$hue->sendCommand($command);

I don't understand why....

sqmk commented 8 years ago

What light model are you trying to update? The model you may be trying to set color temp may not support that.

zoic21 commented 8 years ago

It's from starter kit (E27 Color led) so maybe I don't have this. I need to check this, thank for your reponse

sqmk commented 8 years ago

If you can provide a dump for me that contains all of the following, that would help my investigation:

zoic21 commented 8 years ago

Here request informations :

Additional question : what is hue ? I test on my lamp and if it's white hue make it red but after that change of hue value do nothing....

sqmk commented 8 years ago

I'd suggest looking at the Philips Hue api documentation to understand what certain values will do for lights.

zoic21 commented 8 years ago

Ok I understand. So I can close this.

sqmk commented 8 years ago

Can you let me know what the lowest and highest value you can set on colorTemp on that bulb?

zoic21 commented 8 years ago

I test 0 and 65535 and it's ok, I change from xy to hsv, for me it is more accurate (even if conversion hexa to hsv is not perfect)

sqmk commented 8 years ago

I'm asking what the lowest and highest values you can set for colorTemp (Mired Color), not for xy/hsv.

You'll need to remove the min/max value checks on colorTemp method on SetLightState.php to be able to test min and max values.