[SOLVED] Item 'Xiaomi_Brightness' received command 0

I have this item linked to my Xiaomi Aqara gateway’s brightness:

Dimmer Xiaomi_Brightness "Brightness" {channel="mihome:gateway:34ce00907400:brightness", mqtt=">[mosquitto:xiaomi/brightness:command:*:default],<[mosquitto:xiaomi/brightness:command:default]"}

I can set the brightness of my gateway with an mqtt command:

mosquitto_pub -u mqtt_user -P password -t xiaomi/brightness -m 20

But simultaneously I get endless Item ‘Xiaomi_Brightness’ received command 0 log in my openhab and the gateway start to flicker (change its brightness from 0 to 20). I don’t know why I get command 0 ! Where does this command come ?

This is because of the configuration of your binding
Let me explain what happens.

When the binding receives a command it sends a brightnexx command to the gateway with the Xiaomi binding
It also sends the value via MQTT with the second binding
The third binding reacts on a value received and sends a command, which starts the cycle again
In the mean time the Xiaomi binding has replied with it’s state (which was 0)
So your binding start again send, receive, send received…

I am going to ask the same question as in your other thread. What is the purpose on the MQTT binding?

1 Like