Yeelight ceiling 650 API json


#1

I finally installed the ceiling 650 and everything is working great. So I started testing with my python addon for Kodi, which works with all other products- mono bulb, color bulb, led stripe… simple LAN control. It works with 650 as well. Except one thing - when I send command to turn it on or off - i.e.

{“id”:1,“method”:“set_power”,“params”:[“on”, “smooth”, 500]}

I should get

{“id”:1, “result”:[“ok”]}

And my app works with all other Yeelight products except ceiling 650? Is it also returning the “ok”???


#2

Ahh, to reply to my own question… there is a change:

when I send:
{“id”:1,“method”:“set_power”,“params”:[“off”, “sudden”, 0]}

i get:

{“method”:“props”,“params”:{“main_power”:“off”}}
{“id”:1, “result”:[“ok”]}
{“method”:“props”,“params”:{“power”:“off”,“bg_power”:“off”}}

when I send:

{“id”:1,“method”:“set_power”,“params”:[“on”, “sudden”, 0]}

I get:

{“method”:“props”,“params”:{“power”:“on”,“main_power”:“on”,“bg_power”:“on”}}
{“id”:1, “result”:[“ok”]}

So it returns MORE than just 1 message with “ok”…


#3

The result “OK” is to indicate the command has been executed successfully by the light.
The “props” method is to notify the properties of the lights has been changed accordingly. This method is to notify all connected clients that the state is changed and client should update their UI accordingly.


#4

Thank you Weiwei for your support!

One question - I noticed that when I turn off the 650 (main light) both main and ambi light turn off - is there no way to turn off only main light? At least it seems more logical that off turns off only main light in API, if not in Yeelight app.

Thanx
D.


#5

Regarding ambi light control command, please refer to the spec page 17 http://www.yeelight.com/download/Yeelight_Inter-Operation_Spec.pdf

Basically you can use bg_set_xxx (e.g. bg_set_power, bg_set_ct_abx) to control the background the light.


#6

Yes, I know, but when you send

{“id”:1,“method”:“set_power”,“params”:[“off”, “sudden”, 0]}

Both main light and ambi light turn off!

When I do

{“id”:1,“method”:“bg_set_power”,“params”:[“off”, “sudden”, 0]}

only ambi turns off. But with command without bg_ BOTH lights turn off!

D.


#7

There is an option in the App, you can choose whether background color turned on/off along with the main light.


#8

Thanks for your answer. I have found the option.

But still, this shouldn’t influence the API! There is logic to turn both main light and ambi with a single button from a remote control or App, but not from API! In my script/program, I can’t tell if the user selected this option in Yeelight app and there should be a way to turn each on and off individually.

Can this please be revised (ONLY!) in API? If you think about it, you’ll see it makes sense. App developers can’t rely on this option being on or off and it makes programming harder.


#9

@weiwei How about adding an API option to only turn off the main light without the bg?

Something like:
{"id":1,"method":"main_set_power","params":["off", "sudden", 0]}

So for both off:
{"id":1,"method":"set_power","params":["off", "sudden", 0]}

And for bg off:
{"id":1,"method":"bg_set_power","params":["off", "sudden", 0]}

Then you have all three cases.


#10

Hi,

The issue is not with the API; legacy API’s are used to control the main light, but we force the ‘background color turned on/off along with the main light’ feature to take effect whenever main light status changes, for reasons, such as simplicity in APP logic and scene management.

But there’s one (ugly) way out. To turn off the mainlight while keeping background light on, you could send a bg_set_power message to turn on the background light immediately after sending the set_power message. The device should behaves just like turning off the main light only.


#11

Yes, there’s always a way out, but it still doesn’t change the fact that in my app i can’t tell if the user selected this option or not :slight_smile:


#12

I wonder if that’s necessary (because you can always turn the background light on even if it’s already on).
But if you insists, try below method (you should get 1/0 if the option is enabled/disabled):
{“id”:1,“method”:“get_prop”,“params”:[“bg_proact”]}