Page 1 of 1

Xiaomi RGB Gateway

Posted: Wednesday 26 September 2018 10:41
by marcot
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

Re: Xiaomi RGB Gateway

Posted: Friday 28 September 2018 10:28
by marcot
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&param=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