Philips Hue Color - setting color with LUA but without http?

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

Post Reply
Toumal
Posts: 8
Joined: Thursday 11 February 2016 11:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Philips Hue Color - setting color with LUA but without http?

Post by Toumal »

Hey there,

I read through all the hue-related wiki entries and forum posts but everyone is talking about how to write a script that sends http requests to the hue bridge...

I don't care about any of that, and I see that the Hue color is supported in the latest stable of Domoticz just fine. All I want to know is how to control the color via LUA script.

I know how to send brightness changes (commandArray[Light]="Set Level 100") but how do I change the color in the same manner? I see the web interface of domoticz supports this already, so surely this should also be exposed to lua scripting, no?
Any clues would be appreciated!
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: Philips Hue Color - setting color with LUA but without http?

Post by deennoo »

Have you try this for dimming ?

/json.htm?type=command&param=switchlight&idx=99&switchcmd=Set%20Level&level=6

Source : https://www.domoticz.com/wiki/Domoticz_ ... tain_level

Nothing is explain for color, on my side i create some scène with specific color, a scène/groupe can be activate via JSON

https://www.domoticz.com/wiki/Domoticz_ ... .2F_Groups
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Toumal
Posts: 8
Joined: Thursday 11 February 2016 11:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Philips Hue Color - setting color with LUA but without http?

Post by Toumal »

Dimming works without any tricks, just "Set Level 100" without any need for using the REST API. It's just the colors I was wondering about.

Right now I'm using the REST API of the Hue bridge. It works, but of course it's yet another external configuration dependency in the LUA code...
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: Philips Hue Color - setting color with LUA but without http?

Post by deennoo »

ok sorry, don't understand you try to set "saturation/hue"
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Clemen
Posts: 75
Joined: Saturday 05 December 2015 15:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Europe
Contact:

Re: Philips Hue Color - setting color with LUA but without http?

Post by Clemen »

Did you find any solution to this?
Toumal
Posts: 8
Joined: Thursday 11 February 2016 11:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Philips Hue Color - setting color with LUA but without http?

Post by Toumal »

Yeah I use curl to hit the rest api of the Hue controller. Not great but it does the job.

function hueAlarm()
os.execute('/usr/bin/curl -s -H "Accept: application/json" -X PUT --data \'{"alert": "lselect", "bri":255, "hue":0, "sat":255}\' http://'..hueip..'/api/'..hueusername..'/lights/'..huelight..'/state;')
end

function hueDisarm()
os.execute('/usr/bin/curl -s -H "Accept: application/json" -X PUT --data \'{"alert": "none", "bri":100, "hue":14910, "sat":144}\' http://'..hueip..'/api/'..hueusername..'/lights/'..huelight..'/state;')
end

function hueArm()
os.execute('/usr/bin/curl -s -H "Accept: application/json" -X PUT --data \'{"alert": "none", "bri":255, "hue":25500, "sat":255}\' http://'..hueip..'/api/'..hueusername..'/lights/'..huelight..'/state;')
end
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest