Mi(Xiaomi) Smart home bindings?

please help, how to set up an item for managing the gateway

is it really the sid of your gateway? Can you paste here your gateway hearbeat packet please?

2017-01-24 03:29:24.982 [INFO ] [ateway.internal.XiaomiGatewayBinding] - Discovered Xiaomi Gateway - sid: f0b4299a4eec ip: 192.168.10.104 port: 9898
2017-01-24 03:29:24.989 [INFO ] [ateway.internal.XiaomiGatewayBinding] - Xiaomi received packet: {“cmd”:“get_id_list_ack”,“sid”:“f0b4299a4eec”,“token”:“tQQDDlUC0F1EcPuL”,“data”:“["158d000117ef3b"]”}
2017-01-24 03:29:24.991 [INFO ] [ateway.internal.XiaomiGatewayBinding] - Discovered total of 1 Xiaomi smart devices
2017-01-24 03:29:25.391 [INFO ] [ateway.internal.XiaomiGatewayBinding] - Xiaomi received packet: {“cmd”:“read_ack”,“model”:“sensor_ht”,“sid”:“158d000117ef3b”,“short_id”:1353,“data”:“{"temperature":"2763","humidity":"3276"}”}
2017-01-24 03:29:25.393 [INFO ] [ateway.internal.XiaomiGatewayBinding] - Detected Xiaomi smart device - sid: 158d000117ef3b model: sensor_ht
2017-01-24 03:29:26.919 [INFO ] [ateway.internal.XiaomiGatewayBinding] - Xiaomi received packet: {“cmd”:“heartbeat”,“model”:“gateway”,“sid”:“f0b4299a4eec”,“short_id”:“0”,“token”:“UI3N2Mrvbm2OKSgV”,“data”:“{"ip":"192.168.10.104"}”}
2017-01-24 03:29:26.921 [INFO ] [ateway.internal.XiaomiGatewayBinding] - Xiaomi received packet: {“cmd”:“heartbeat”,“model”:“gateway”,“sid”:“f0b4299a4eec”,“short_id”:“0”,“token”:“UI3N2Mrvbm2OKSgV”,“data”:“{"ip":"192.168.10.104"}”}

items

Number RoomTemperature “Xiaomi Temperature [%.1f °C]” { xiaomigateway=“158d000117ef3b.temperature” }
Number RoomHumidity “Xiaomi Humidity [%.1f %%]” { xiaomigateway=“158d000117ef3b.humidity” }
Switch XiaomiGatewayLight “Gateway light” { xiaomigateway=“f0b4299a4eec.color” }
Color XiaomiGatewayLightColor “Gateway light color” { xiaomigateway=“f0b4299a4eec.color” }
Dimmer XiaomiGatewayBrightness “Gateway brightness” { xiaomigateway=“f0b4299a4eec.brightness” }

status to get the gateway, and I can not manage

sorry, i’m very new to openhub… i installed your plugin and configured the key… now i’ve this :slight_smile:

12:59:07.737 [INFO ] [ateway.internal.XiaomiGatewayBinding] - Xiaomi received packet: {"cmd":"heartbeat","model":"motion","sid":"158d0001051eed" ,"short_id":41037,"data":"{\"status\":\"no_motion\"}"} 12:59:10.389 [INFO ] [ateway.internal.XiaomiGatewayBinding] - Xiaomi received packet: {"cmd":"heartbeat","model":"gateway","sid":"f0b4299ab68b", "short_id":"0","token":"9C86Zt2LEYIsm5Ui","data":"{\"ip\":\"192.168.1.6\"}"} 12:59:20.371 [INFO ] [ateway.internal.XiaomiGatewayBinding] - Xiaomi received packet: {"cmd":"heartbeat","model":"gateway","sid":"f0b4299ab68b", "short_id":"0","token":"roCMAqjUg9fHw74E","data":"{\"ip\":\"192.168.1.6\"}"} 12:59:30.358 [INFO ] [ateway.internal.XiaomiGatewayBinding] - Xiaomi received packet: {"cmd":"heartbeat","model":"gateway","sid":"f0b4299ab68b", "short_id":"0","token":"jBjmwBNLIIAjrsYf","data":"{\"ip\":\"192.168.1.6\"}"} 12:59:40.340 [INFO ] [ateway.internal.XiaomiGatewayBinding] - Xiaomi received packet: {"cmd":"heartbeat","model":"gateway","sid":"f0b4299ab68b", "short_id":"0","token":"zic9VGgkvjPJETO2","data":"{\"ip\":\"192.168.1.6\"}"} 12:59:49.708 [INFO ] [ateway.internal.XiaomiGatewayBinding] - Xiaomi received packet: {"cmd":"report","model":"motion","sid":"158d0001051eed","s hort_id":41037,"data":"{\"status\":\"motion\"}"} 12:59:50.323 [INFO ] [ateway.internal.XiaomiGatewayBinding] - Xiaomi received packet: {"cmd":"heartbeat","model":"gateway","sid":"f0b4299ab68b", "short_id":"0","token":"sOjP4qFiM976WCXI","data":"{\"ip\":\"192.168.1.6\"}"} 13:00:00.307 [INFO ] [ateway.internal.XiaomiGatewayBinding] - Xiaomi received packet: {"cmd":"heartbeat","model":"gateway","sid":"f0b4299ab68b", "short_id":"0","token":"gPps6Leh7UiKDt8E","data":"{\"ip\":\"192.168.1.6\"}"}

so i think is working… but when i try to add things the screen remain blank… it’s normal? i’ve 22 sensors… motions, doors, temperatures, wireless button… thanks for help

@Ondrej_Pecta great binding, works well for me, thanks a lot.
One question, is there a regular heartbeat from the gateway connected to an item?
I´d like to have a “last message received” item in openhab, like {xiaomigateway="f0b42xxxxxxxx.heartbeat}?

This is an Openhab 1 binding, so thre is no detection of things.

You need to define items in a items file, check the openhab1 docs and the binding github docs

How often does the temp sensor send an update to the gateway?

Is this intervall hardcoded or can i change this in the xiaomi app or with this binding?

On banggood there a seller wrote, the battery only lasts 1-2 months. This must be a mistake, i hope?

With the release of OH2, hope you will be able to add it to the list of installable bindings soon!

about every 50 minutes, I don’t think this can be changed.

50 minutes? Really?

Bad Joke I think…

Damn, I bought some of this stuff… But 50 Minutes is a deal-breaker.

How should I use this in a bathroom for ventilation with this big time difference?!

sorry my mistake. :confused:

This is the interval when there is no significant temperature change.

It also reports when there is a a temp difference of about 0,5°C to the last message.
For humidity I do not know the minimal difference for reporting

Hi @pboos,

Where can I find the binary build of your binding?
I’m setting up oh2 and would love to try yours.

Thanks

very interesting, xiaomi, protocol description
https://louiszl.gitbooks.io/lumi-gateway-local-api/content/motion.html

1 Like

I think there is no binary until the pull request is approved and the addon is gets merged into master so we have it in the snapshots

Hi,

Do you know some reason why the binding cant detect my Xiaomi gateway on local network?

The log only show: XiaomiGateway Refresh Service has been started but anything else.

Thank you
J.

OK, I think the problem is because I’ve set my pi3 wired (no WIFI)

OK, All works perfectly!

The problem is when i put both, ethernet and wifi connection.

Works fine only with wifi interface.

Thanks!

could this be useful?
https://open.home.mi.com/guide.html#/4

Chinese required :frowning:

apart recognition of objects. once the items are defined will it work in OH2.
Sorry if answer is in thread , I am at work now… will read all thread tonight

It is possible send write a command from openhab to the gateway?
I switch a wireless button over openhab,this switch send a command to the xiaomi zigbee plug.
The gateway support at the moment only read commands?

Thanks