Set HUE lights to certain color

Moderator: leecollings

Post Reply
User avatar
mvveelen
Posts: 687
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Set HUE lights to certain color

Post 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.
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
teha
Posts: 18
Joined: Wednesday 30 December 2015 20:23
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Lomma, Sweden
Contact:

Re: Set HUE lights to certain color

Post 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
RPi2 with RFXtrf433(E) at stable, RPi2 with AeonStick S2 on beta, 14*Sonos, Synology DS415play, Axis, D-link camera, PhilipsHue
User avatar
mvveelen
Posts: 687
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: Set HUE lights to certain color

Post 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 :)
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests