I've a Domoticz version 4.9700 running and a Xiaomi RGB Gateway on firmware 1.4.1_157.0143.
What I did found out is that you can control the brightness of build-in RGB light with:
commandArray['Xiaomi RGB Gateway']='Set Level:'..tostring(10) -
You can turn on/off the light with:
commandArray['Xiaomi RGB Gateway']='On'
But how do you change the color of the RGB gateway via Lua?
Thanks!
Marco
Xiaomi RGB Gateway
Moderator: leecollings
-
- Posts: 2
- Joined: Wednesday 26 September 2018 10:20
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Xiaomi RGB Gateway
Ok will answer my own question then:
function changeRGBGatewayColor(rgbColor, brightness)
gatewayName = '<NAME OF YOUR XIAOMI RGB GATEWAY>'
gatewayIDX = otherdevices_idx[gatewayName]
url = 'http://<YOUR DOMOTICZ IP ADDRESS>:<YOUR DOMOTICZ PORT NUMBBER>/json.htm?type=command¶m=setcolbrightnessvalue&idx='..tostring(gatewayIDX)..'&hex='..rgbColor..'&brightness='..tostring(brightness)..'&iswhite=false'
commandArray['OpenURL']= url
commandArray[gatewayName] ='Off AFTER 10' -- switch it off after 10 seconds
end
function changeRGBGatewayColor(rgbColor, brightness)
gatewayName = '<NAME OF YOUR XIAOMI RGB GATEWAY>'
gatewayIDX = otherdevices_idx[gatewayName]
url = 'http://<YOUR DOMOTICZ IP ADDRESS>:<YOUR DOMOTICZ PORT NUMBBER>/json.htm?type=command¶m=setcolbrightnessvalue&idx='..tostring(gatewayIDX)..'&hex='..rgbColor..'&brightness='..tostring(brightness)..'&iswhite=false'
commandArray['OpenURL']= url
commandArray[gatewayName] ='Off AFTER 10' -- switch it off after 10 seconds
end
Who is online
Users browsing this forum: No registered users and 1 guest