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!
Philips Hue Color - setting color with LUA but without http?
Moderator: leecollings
-
- 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?
Have you try this for dimming ?
/json.htm?type=command¶m=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
/json.htm?type=command¶m=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
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
-
- 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?
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...
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...
-
- 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?
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
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
-
- 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?
Did you find any solution to this?
-
- 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?
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
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
Who is online
Users browsing this forum: No registered users and 1 guest