Xiaomi Gateway Change light color

Hi All,

Im attempting to send a command through a rule to change the Xiaomi Gateway LED Color.

I have everything setup and working as it should with the Basic UI setup, I have also created a fake item and setup a rule on status change of this item to turn on the Gateway so I know my rule so far is working.

What is the command to send to change the Gateway Color ?

Any help is appreciated :slight_smile:

Link the color channel to a color item type:

Color Gateway_Color <rgb> { channel="mihome:gateway:34ce008d5a25:color" }

Hi thanks for the reply,
Yes in my items file I have the color setup and this is working I can create a color picker in my sitemap and change the color of the gateway LED.
The thing I cannot do is change the color via a rule …

Why didn’t you say so? :rofl:

YourItem.sendCommand("30,100,100")

Perfect ! Thank you, I was on the right track but had the syntax slightly incorrect.

Hi all,

I’m new in OH world. I have a problem with controling Gateway light in rules so I decided to use this thread.
Here is my issue: I try to change Gateway color to red (Item.sendCommand(“255,0,0”)) in the rule but it always changes to white. Log extract below:

2018-04-02 23:37:56.653 [vent.ItemStateChangedEvent] - MiAirPurifier2_Aqi changed from 30 to 35
2018-04-02 23:37:56.674 [ome.event.ItemCommandEvent] - Item 'XiaomiGateway_Color' received command 255,0,0
2018-04-02 23:37:56.694 [ome.event.ItemCommandEvent] - Item 'XiaomiGateway_Brightness' received command 50
2018-04-02 23:37:56.789 [vent.ItemStateChangedEvent] - XiaomiGateway_Color changed from 0,0,0 to 255,0,0
2018-04-02 23:37:56.795 [vent.ItemStateChangedEvent] - XiaomiGateway_Color changed from 255,0,0 to 0,0,0

and here is my test rule:

rule "test2"
when
    Item MiAirPurifier2_Aqi changed
then
    XiaomiGateway_Color.sendCommand("255,0,0")
    XiaomiGateway_Brightness.sendCommand(50)
end

Please advice something.

Hey,
try

.sendCommand(“0,100,100”)

Im currently using this in a rule to change the LED color to RED when my Garage door is open.

Note: it does not use RGB it uses HSB values for color. A good reference is http://colorizer.org/ and look at the HSV/HSB section to get your color values.

1 Like

Hi,

Thanks for advice. Good to know this. But this does not change the fact something keeps changing the color to 0,0,0 just after I set my own (see log extract in my previous post).

Do you have any other rules setup that could be changing it back?

No. I just started using OH2. I’m playing around with this. I have few test rules but they are uncommented. I’ve never changed color to 0,0,0.

I’m wondering if Mi Home/Gateway android app can override my values somehow.

EDIT:
crockernr, I get your point now. HSB 0,100,100 is RGB 255,0,0. Will try this leater at home.
Thanks!

EDIT2:
0,100,100 works fine. Thanks a lot!

weird Question, but I took all channel information from my PaperUI and can’t controll my gateway.
Mi Home app works fine. Do I miss something?

The same for me, have you found a solution ?