Page 1 of 1

Set HUE lights to certain color

Posted: Thursday 30 March 2017 12:16
by mvveelen
Hi,

in Domoticz I can only set a Hue light to a specific Brightness and a specific Hue value. But I need to set it also to a certain Saturation value.

How can I accomplish this for a light AND also (more important) when this Hue ligt is part of a Group?

When I use the Hue api (PUT) with

Code: Select all

{
"on": true,
"hue": 6165,
"sat": 186
}
it works fine. But as said, I can't use "sat" anywhere in Domoticz as far I can see.

Re: Set HUE lights to certain color

Posted: Thursday 30 March 2017 12:27
by teha
I use to go with a bash script

Code: Select all

#!/bin/bash
curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"bri": 232,"hue": 45232,"sat": 254,"xy": [0.1880,0.0816],"ct": 153}' http://yourIPadress/api/yourAPIuserkey/lights/HueLampID/state;\
Then you also have the funny tag "trasitiontime" that you can use for dimming down the lights to 0 in 600 sek

trigger this from a dummy switch

Re: Set HUE lights to certain color

Posted: Thursday 30 March 2017 13:11
by mvveelen
OK, I made a bash script with this code and changed it to my likings. When I use it in the CLI it switches ON.
How can I use it with a dummy switch? And how can I use it to switch the light off?

Added the line:

Code: Select all

script:///volume1/@appstore/domoticz/var/scripts/hue_lamp_lage_kast.sh
to the dummy switch and made the script executable. When I press the switch, nothing happens. The dummy switch turns ON, but the light stays off.

Edit: it works. Made a mistake with the URL and in the file the line was 'broken'

Edit 2: I even use the transition in the script to dim the light slowly :)