Hello,@dimlao.
Your “Ankleide_Yeelight_CustomScene.sendCommand(“nightlight”,100”)" is actually part of the following command:
"set_scene [\"nightlight\",100]"
send to command channel.
Here’s another example:
Items:
Switch Some_Switch "Some Switch"
String MyCeiling_Scene "My Ceiling Scene" {channel="miio:generic:07XXX1B:customScene"}
String MyCeiling_Command "My Ceiling Command" {channel="miio:generic:07XXX1B:command"}
Rules:
rule "test 1"
when
Some_Switch received command
then
if (Some_Switch.state == ON) {
MyCeiling_Scene.sendCommand("nightlight\",100")
} else {
MyCeiling_Scene.sendCommand("ct\",5400,100")
}
end
You can do exactly the same using the command channel:
Rules:
rule "test 2"
when
Some_Switch received command
then
if (Some_Switch.state == ON) {
MyCeiling_Command.sendCommand("set_scene [\"nightlight\",100]")
} else {
MyCeiling_Command.sendCommand("set_scene [\"ct\",5400,100]")
}
end
The “miio:generic:07XXX1B:command” channel is not detected automaticly by Mi IO, so you have to add it manually, similarly to the scene channel.
The “5400” value is a color temperature for the ct scene. “100” is brightness in %.
Obviously you have much more options to controll your lamp via command channel, according to the Yellight Inter Operation Spec.
You can learn current states of your lamp by doing:
MyCeiling_Command.sendCommand("get_prop [\"power\",\"bright\",\"ct\",\"rgb\",\"color_mode\",\"active_mode\"]")
and then checking the log files.
You can find more clues how to figure it out on the other yeelight thread.