API Question: night mode


i’m currently creating a yeelight module for Crestron professional control systems, and I wonder if there is any possibility to tell if the Normal Mode or the Night-Mode (Moonshine) is currently enabled.

With the “get_prop” method I can only read out if power is on or off but not the current mode the ceiling light is in.

Is there a possibility or can this function be added to the API?

Also the limitation of 60 commands per minute per connection is a little bit annoying.
I really don’t want to open up an extra connection just to get 120 commands/minute out of it. Could this be raised a bit to say 100/minute?

The discovery message spits out some methods not mentioned in the API description.
The version online is from 2015… (http://www.yeelight.com/download/Yeelight_Inter-Operation_Spec.pdf)
Is there a more current version available?

thank you


There’s a prop named nl_br, 0 is in normal mode, otherwise is in night mode.
You can use the command below to switch lamp mode:

// switch lamp to night mode
// switch lamp to normal mode
Definition of mode (bold number above):

public static final int TURN_ON_TO_CT = 1;
public static final int TURN_ON_TO_COLOR = 2;
public static final int TURN_ON_TO_CF = 4;
public static final int TURN_ON_TO_NL = 5;

I don’t think so, I wonder in what case do you need control the bulb so frequently?

Cool, that’ll do the trick, thanks!

Let’s just say the customers always try to deliberately overload implementations and its quite easy to do so with exzessive dimming. Anyway no biggy I’m just limiting the dimmactions to one per second.

Regarding the other methods not mentioned in the API-description.

What does set_ps, set_wrgb, bg-set_wrgb, suicide and set_test do? Whats the Syntax here?

where did you find those commands "set_ps, set_wrgb, bg-set_wrgb, suicide and set_test "? It’s for internal use and should not be exposed to 3rd party.

The rate limit is put there to prevent excessive state change notification being sent to cloud and cause an unexpected DDOS attack.

It’s in the advertisment msg of the ceiling light. See screenshot…


Then it’s a firmware bug, those methods should never be exposed to 3rd party.