Closed sunbit closed 7 years ago
Following to this guide you can understand xiaomi rgb value format: https://github.com/louisZL/lumi-gateway-local-api/blob/master/网关.md
rgb = 0xFF000000 ( R << 16)( G << 8)B
As I can understand first 0xFF is brightness.
You can send value as "r,g,b" or xiaomi number; but it will return back as xiaomi number and you can't control brightness with it (it is only temporary fix). You can find needed xiaomi number if you turn on gateway light from mi home, choose your brightness and color and look at mqtt log.
I am temporary using it in my system as on\off bulb with fixed color:
- platform: mqtt
name: "Main Gateway"
state_topic: "home/gateway/main/rgb"
command_topic: "home/gateway/main/rgb/set"
payload_on: "1694301956"
payload_off: "0"
optimistic: false
Thank you, i'ts working now! This was my first attempt to send write commands (with my own node.js code) and i had a bug... i was sending the commands to the broadcast address instead of the gateway address.
Looking at you code helped a lot :)
After updating today to the latest firmware and see that I was receiving reports any time I changed color on the gateway, I tried to send write commands to the gateway, without success. Then I realized that comment on your readme:
"exclude Brightness+RGB value of gateway - you need to send it in xiaomi format"
What do you mean with "xiaomi format" ?
Thank you!