[SOLVED] Default white - HSBType error (Xioami Vacuum Binding)

So If I run the following command on of my Yeelights to get the default white state of my Yeelights:

var String currentState = Yeelightc_7.state as HSBType
logInfo(filename,currentState.toString())

I get Hue = 0, saturation= 100, Brightness = 100

But If I send a command like this:

var HSBType weiss = new HSBType(new DecimalType(0),new PercentType(100),new PercentType(100))
Yeelightc_7.sendCommand(weiss.toString)

The Yeelights turn actually red, does someone noticed this weird behaviour or did someone managed to turn them to their default “bright white” state?
Thanks in advantage :slight_smile:

note: I don’t really want to use the default Yeelight binding, since they’ve run perfectly with the robot vacuum binding …

Well… They don’t. Do they?
Why not use the binding?

I think this has to do with the colour mode setting.
If I recall well, the RGB is send, whereas you send a HSB.
You may try to change the colour mode first

Hey marcel,
thanks for the answer.
Where can I change the colour mode?

if you mean the yeelight channel:
image
I actually never used it, do I need a selection item with mapping for this channel and if yes, which inputs?

Thank you, reading myself a bit more into the docs solved my problem!

Could you post your solution, please?
It may help another user someday. Thanks

1 Like

Yeah of course:
with the actions#commands channel
.rules:

sendCommand(gYeelightAC,'set_power["on","sudden",0,1]')

When the item is know, as in your case, it is recommended to use the method instead of the action:

gYeelightAC.sendCommand('set_power["on","sudden",0,1]')

Please see: https://www.openhab.org/docs/configuration/rules-dsl.html#myitem-sendcommand-new-state-versus-sendcommand-myitem-new-state