LAN API - color flow with ignored brightness


#1

Hello, I’ve been developing app that uses LAN control, and got an issue with color flows.

Docs specify that:

Brightness: Brightness value, -1 or 1 ~ 100. Ignored when mode is 7.
When this value is -1, brightness in this tuple is ignored (only color or CT change takes
effect).

However neither my light strip nor rgb bulb accept -1 as value.

If I send (simple red into green into blue)

 {"id":0,"method":"start_cf","params":[0,0,"2000,1,255,-1,2000,1,16711680,-1,2000,1,65280,-1"]} 

I receive
{"id":0, "error":{"code":-5000,"message":"general error"}}

works if I explicitly include brightness:

{"id":0,"method":"set_scene","params":["cf",0,0,"2000,1,255,100,2000,1,16711680,100,2000,1,65280,100"]}

Does -1 need to be escaped in some way? Anyone got sample command where it works? Tried this with both start_cf command and set_scene with color flow.


#2

@liufei


#3

Which device do you have? Do you update firmware to the latest?

I have tested with Mijia bedside lamp, and the result shows:

andyding$ telnet 192.168.50.74 55443
Trying 192.168.50.74...
Connected to 192.168.50.74.
Escape character is '^]'.
{"method":"props","params":{"flowing":0,"ct":3986}}
{"id":0,"method":"start_cf","params":[0,0,"2000,1,255,-1,2000,1,16711680,-1,2000,1,65280,-1"]}
{"method":"props","params":{"flowing":1}}
{"id":0, "result":["ok"]}

#4

It just doesn’t go through with -1 as brightness… My devices are
RGB bulb (fw 61)
LED stripe (fw 44)

Tried sending commands thru telnet, same result.

{"id":0,"method":"set_scene","params":["cf",0,0,"2000,1,255,100,2000,1,16711680,100,2000,1,65280,100"]}
{"id":0, "result":["ok"]}
{"method":"props","params":{"flowing":1}}
{"id":0,"method":"start_cf","params":[0,0,"2000,1,255,-1,2000,1,16711680,-1,2000,1,65280,-1"]}
{"id":0, "error":{"code":-5000,"message":"general error"}}
{"id":0,"method":"set_scene","params":["cf",0,0,"2000,1,255,-1,2000,1,16711680,-1,2000,1,65280,-1"]}
{"id":0, "error":{"code":-5000,"message":"general error"}}

#5

I have the same issue in our lab with RGB bulb and LED strip, we are looking at the issue.

Please provider your xiaomi account ID, I will add you into firmware beta test to try.
Thanks for your feedback!


#6

Sent ID in PM.