# Mi(Xiaomi) Smart home bindings?

**URL:** <https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711>\
**Category:** Home Automation\
**Created:** [December 2, 2015, 1:16pm UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711 "2015-12-02T13:16:10Z")\
**Posts on this page:** 20\
**Page:** 10

<div class="post-metadata">

**Author:** ![dimalo](https://community.openhab.org/user_avatar/community.openhab.org/dimalo/32/9098_2.png) [@dimalo](https://community.openhab.org/u/dimalo)\
**Post date:** [April 13, 2017, 11:44pm UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/183 "2017-04-13T23:44:29Z")

</div>

Triggering scenes is not possible at the moment. the gateway does no report this back. I just activated the alarm and logged the messages the openHAB binding reveiced. nothing to find there.

perhaps things will develop as with the voltage values…

---

<div class="post-metadata">

**Author:** ![mawa](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/51bf81/32.png) [@mawa](https://community.openhab.org/u/mawa)\
**Post date:** [April 14, 2017, 4:55pm UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/184 "2017-04-14T16:55:34Z")

</div>

Thanks for your great efforts here.

What I don’t understand with the Things:  
Whats the difference between “Xiaomi Mi Smart Home Bridge” and “Xiaomi Mi Smart Home Gateway” ? Isn’t this the same device ?

---

<div class="post-metadata">

**Author:** ![dimalo](https://community.openhab.org/user_avatar/community.openhab.org/dimalo/32/9098_2.png) [@dimalo](https://community.openhab.org/u/dimalo)\
**Post date:** [April 14, 2017, 7:41pm UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/185 "2017-04-14T19:41:55Z")

</div>

yeah this one is a bit strange, but @pboos answered this sometime ago in the [PR discussion](https://github.com/openhab/openhab2-addons/pull/1660) over at github

> About Gateway/Bridge. I know that is kind of weird. The problem is that one. The BRIDGE (speaking in openhab/smarthome terms) can only route to other devices, but has no functionality. Now the xiaomi gateway has lights! So it is a BRIDGE + A THING. So I needed to create two different ones. Or at least I didn’t figure out how to do it in one. Because adding channels to the bridge gave me errors.

---

<div class="post-metadata">

**Author:** ![mawa](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/51bf81/32.png) [@mawa](https://community.openhab.org/u/mawa)\
**Post date:** [April 14, 2017, 8:09pm UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/186 "2017-04-14T20:09:24Z")

</div>

thanks for clarification 👍

---

<div class="post-metadata">

**Author:** ![exomarty](https://community.openhab.org/user_avatar/community.openhab.org/exomarty/32/72091_2.png) [@exomarty](https://community.openhab.org/u/exomarty)\
**Post date:** [April 14, 2017, 8:44pm UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/187 "2017-04-14T20:44:35Z")

</div>

Just updated to last bridge firmware and motion sensor stopped working. I had it linked with hue lights

---

<div class="post-metadata">

**Author:** ![dimalo](https://community.openhab.org/user_avatar/community.openhab.org/dimalo/32/9098_2.png) [@dimalo](https://community.openhab.org/u/dimalo)\
**Post date:** [April 14, 2017, 9:49pm UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/188 "2017-04-14T21:49:55Z")

</div>

Which version is it? 1.4.1. 145?  
I have motion sensors myself and everything is fine with them…

---

<div class="post-metadata">

**Author:** ![exomarty](https://community.openhab.org/user_avatar/community.openhab.org/exomarty/32/72091_2.png) [@exomarty](https://community.openhab.org/u/exomarty)\
**Post date:** [April 14, 2017, 10:39pm UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/189 "2017-04-14T22:39:40Z")

</div>

![](https://community-openhab-org.s3-eu-central-1.amazonaws.com/original/2X/1/168cc67c6cc1d9ceda6121c962f903ec24fb2d87.png)

---

<div class="post-metadata">

**Author:** ![atraversi](https://community.openhab.org/letter_avatar_proxy/v4/letter/a/b9e5f3/32.png) [@atraversi](https://community.openhab.org/u/atraversi)\
**Post date:** [April 17, 2017, 5:47pm UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/190 "2017-04-17T17:47:25Z")

</div>

Hi

Does anyone know the xiaomi IR Blaster device (all-in-one media control center [http://files.xiaomi-mi.com/files/All\_in\_one/All\_in\_one-EN.pdf](http://files.xiaomi-mi.com/files/All_in_one/All_in_one-EN.pdf))?  
It would be great to be able to integrate openHAB and be able to handle air conditioning, tv, portraits, audio equipment, etc.  
Do you know if there is an API to be able to integrate it?

---

<div class="post-metadata">

**Author:** ![dimalo](https://community.openhab.org/user_avatar/community.openhab.org/dimalo/32/9098_2.png) [@dimalo](https://community.openhab.org/u/dimalo)\
**Post date:** [April 17, 2017, 10:03pm UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/191 "2017-04-17T22:03:35Z")

</div>

The only “open” devices I know of are Yeelights and MiHome ZigBee devices…  
There is some possibility to include every wifi enabled device but complex. have a look at this previous [post](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/174)

---

<div class="post-metadata">

**Author:** ![dimalo](https://community.openhab.org/user_avatar/community.openhab.org/dimalo/32/9098_2.png) [@dimalo](https://community.openhab.org/u/dimalo)\
**Post date:** [April 17, 2017, 10:04pm UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/192 "2017-04-17T22:04:32Z")

</div>

strange. tried removing all things and readding them again?

---

<div class="post-metadata">

**Author:** ![exomarty](https://community.openhab.org/user_avatar/community.openhab.org/exomarty/32/72091_2.png) [@exomarty](https://community.openhab.org/u/exomarty)\
**Post date:** [April 17, 2017, 10:26pm UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/193 "2017-04-17T22:26:38Z")

</div>

It worked again after some time 😕

---

<div class="post-metadata">

**Author:** ![Origin8](https://community.openhab.org/letter_avatar_proxy/v4/letter/o/f6c823/32.png) [@Origin8](https://community.openhab.org/u/Origin8)\
**Post date:** [April 18, 2017, 10:07am UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/194 "2017-04-18T10:07:02Z")

</div>

I just update home bindings with the last version, but since then the temperature and humidity values stanys constant (not updated anymore). I tried to remove things in Paper UI and restart openHab but I still have this issue.

The only error I have in the logs is:

“[ERROR] [nternal.DiscoveryServiceRegistryImpl] - Cannot trigger scan for thing types ‘[mihome:bridge]’ on ‘XiaomiBridgeDiscoveryService’!”

Any idea about this problem?

Thanks.

---

<div class="post-metadata">

**Author:** ![dimalo](https://community.openhab.org/user_avatar/community.openhab.org/dimalo/32/9098_2.png) [@dimalo](https://community.openhab.org/u/dimalo)\
**Post date:** [April 18, 2017, 9:55pm UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/195 "2017-04-18T21:55:16Z")

</div>

We had this issue over at github in the [PR discussion](https://github.com/openhab/openhab2-addons/pull/1660)  
The user there managed to get rid of it by reinstalling the binding.  
But still it was a bug in the code.  
I have made a bugfix for that and opened a pull request on @pboos repository.

**NEWS**

The OH2 binding will be available on the new [IOT Marketplace](https://community.openhab.org/t/distributing-bindings-through-the-iot-marketplace/24491)!  
Follow the instruction provided in the link above to get the IOT Marketplace binding.

_ **At the moment the jar in the marketplace is old** _, it will get updated as soon as @pboos merges something in or closes and reopens his PR on the openHAB repo.

For now please be patient, you can check if its up to date on comparing [the date of the build](https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.mihome/2.1.0-SNAPSHOT/) to this post 😄

---

<div class="post-metadata">

**Author:** ![marcolino7](https://community.openhab.org/user_avatar/community.openhab.org/marcolino7/32/94005_2.png) [@marcolino7](https://community.openhab.org/u/marcolino7)\
**Post date:** [April 19, 2017, 10:48am UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/196 "2017-04-19T10:48:02Z")

</div>

Hi,  
Just installed last JAR available, 2.1.0 SNAPSHOT.  
I can see the gateway and all sensors in InBox and I can add things.  
I added a Temperature/Humidity Sensor and a Windows Contact, but opening detail I got NaN for Umidity and Temp and no status for window:

![](https://community-openhab-org.s3-eu-central-1.amazonaws.com/original/2X/6/62689986eab83425a4e32d03d5b333448da51fd0.png)

Perhaps I miss something in Item config:

```csv
Contact MANSARDA_FINESTRA_BAGNO "Finestra Bagno [%s]" <flash> { channel="mihome:sensor_magnet:158d000183724f:isOpen" }

Number CUCINA_TEMP "Temperatura Cucina [%.1f °C]" <temperature> { channel = "mihome:sensor_ht:158d000187234a:temperature" } 
Number CUCINA_HUMI "Umidità Cucina [%d %%]" <water> { channel = "mihome:sensor_ht:158d000187234a:humidity" }

```

And I do not have Battery Voltage. I have latest firmware version on the gateway.

Someone can help me?

Thanks

---

<div class="post-metadata">

**Author:** ![marcolino7](https://community.openhab.org/user_avatar/community.openhab.org/marcolino7/32/94005_2.png) [@marcolino7](https://community.openhab.org/u/marcolino7)\
**Post date:** [April 19, 2017, 4:46pm UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/197 "2017-04-19T16:46:54Z")

</div>

Hi,  
I installed latest OH2 snapshot and installed latest Bindings from IOT Market.  
I have this isseues:

1. Temperature and Humidity are NaN, and contact have no value as for screenshoot  
 ![](https://community-openhab-org.s3-eu-central-1.amazonaws.com/original/2X/5/51efc99833fd1cf823642f1e6727d5d2cc67cee9.jpg)
2. Opening Things I cannot get voltage channel  
 ![](https://community-openhab-org.s3-eu-central-1.amazonaws.com/original/2X/7/701bdd6561eb1bb42e1684d6d4d10654e5c79427.png)

but in the log I see value was read:  
Item got update: {“cmd”:“read\_ack”,“model”:“sensor\_ht”,“sid”:“158d000187234a”,“short\_id”:50889,“data”:“{"voltage":3085,"temperature":"2097","humidity":"3800"}”}

1. For Magnet sensor same thing. I got only 1 channel and value isOpen was not retrieved:  
 ![](https://community-openhab-org.s3-eu-central-1.amazonaws.com/original/2X/f/f0916402ace3c280f2accccbefdb48946adfcd54.png)  
but in the log I can see values arriving:  
Item got update: {“cmd”:“read\_ack”,“model”:“magnet”,“sid”:“158d000183724f”,“short\_id”:60271,“data”:“{"voltage":3095,"status":"close"}”}

I just removed and added binding and things 10 times, but result is always the same.

Marco

---

<div class="post-metadata">

**Author:** ![dimalo](https://community.openhab.org/user_avatar/community.openhab.org/dimalo/32/9098_2.png) [@dimalo](https://community.openhab.org/u/dimalo)\
**Post date:** [April 19, 2017, 5:51pm UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/198 "2017-04-19T17:51:28Z")

</div>

Hi @marcolino7, please read carefully and don’t repeat yourself. As I already wrote, please be patient and wait for the latest build in IOT marketplace. it will be updated the next few days…

---

<div class="post-metadata">

**Author:** ![Olymp](https://community.openhab.org/user_avatar/community.openhab.org/olymp/32/5553_2.png) [@Olymp](https://community.openhab.org/u/Olymp)\
**Post date:** [April 20, 2017, 8:06am UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/199 "2017-04-20T08:06:35Z")

</div>

> [@marcolino7](#):
>
> Contact MANSARDA\_FINESTRA\_BAGNO “Finestra Bagno [%s]” \<flash\> { channel=“mihome:sensor\_magnet:158d000183724f:isOpen” }

Hello!  
Try it this way:

```csv
Contact MANSARDA_FINESTRA_BAGNO "Finestra Bagno" <flash> { channel="mihome:sensor_magnet:158d000183724f:isOpen" }

```

If you finish [%s] it works in BasicUI  
But does not work in the PaperUI to work there and there,  
Then in the item without [%s]  
But in the sitemap file:

```csv
Text item=MANSARDA_FINESTRA_BAGNO label="Finestra Bagno [%s]"

```

Correct me if I’m wrong, but I only work in this version.

---

<div class="post-metadata">

**Author:** ![Olymp](https://community.openhab.org/user_avatar/community.openhab.org/olymp/32/5553_2.png) [@Olymp](https://community.openhab.org/u/Olymp)\
**Post date:** [April 20, 2017, 8:21am UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/200 "2017-04-20T08:21:39Z")

</div>

```csv
Number WindowSwitch_AlarmTimer <clock> { channel="mihome:sensor_magnet:158d00013e5f82:isOpenAlarmTimer" }
Number MotionSensor_MotionTimer <clock> { channel="mihome:sensor_motion:158d000128b345:motionOffTimer" }

```

What here should be?  
I could not get the values to change here …

```csv
Switch Gateway_LightSwitch <light> { channel="mihome:gateway:286c078921f5:brightness" }

```

If you press this button, the light goes out, no more how to turn it off, only through the application, I’m doing something wrong?

---

<div class="post-metadata">

**Author:** ![dimalo](https://community.openhab.org/user_avatar/community.openhab.org/dimalo/32/9098_2.png) [@dimalo](https://community.openhab.org/u/dimalo)\
**Post date:** [April 20, 2017, 10:56pm UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/201 "2017-04-20T22:56:15Z")

</div>

@Olymp  
with the Timer values you can change the time, after which the motion sensor switches off again. default (if no value is set) is 120sec for motion. with window sensors, an alarm event is triggered, when the sensor report “open” but not “closed” in a certain time, default is 300sec.  
There is a desciption text in paperUI for these channels.  
But we should make it more clear in the readme, thanks for your feedback!

The thing with the switch is, it comes together with a dimmer on the same channel, see next line in the readme example. function is: set some dimmer value, the switch can then switch off and on and will retain the brightness value you set before. If you don’t have anything set, it should switch to full brightness. it seems that doesn’t happen. will have to fix that…

---

<div class="post-metadata">

**Author:** ![Gudszent\_Otto](https://community.openhab.org/user_avatar/community.openhab.org/gudszent_otto/32/38536_2.png) [@Gudszent\_Otto](https://community.openhab.org/u/Gudszent_Otto)\
**Post date:** [April 22, 2017, 6:54pm UTC](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711/202 "2017-04-22T18:54:32Z")

</div>

Hi Everybody,

First of all, thank you for this binding.

## Anybody try this, when have 2 vlan? I have the server in 192.18.0.0/24 [A vlan] but the Chines stuff(like this) in 192.168.10.0/24 [B vlan] When the server and the gateway in the same vlan,work as expected. But when I move it to secure vlan, its stop working. The Openhab say its “Online”, but when I change for example the lamp, I get this error:

## 20:47:17.584 [INFO] [smarthome.event.ItemCommandEvent] - Item ‘Gateway\_Brightness’ received command 53 20:47:17.587 [INFO] [marthome.event.ItemStateChangedEvent] - Gateway\_Brightness changed from 16 to 53 java.lang.NullPointerException at org.openhab.binding.mihome.internal.EncryptionHelper.encrypt(EncryptionHelper.java:35) at org.openhab.binding.mihome.internal.EncryptionHelper.encrypt(EncryptionHelper.java:25) at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.getEncryptedKey(XiaomiBridgeHandler.java:282) at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.createDataJsonString(XiaomiBridgeHandler.java:267) at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.writeToBridge(XiaomiBridgeHandler.java:263) at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.writeBridgeLightColor(XiaomiActorGatewayHandler.java:191) at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.writeBridgeLightColor(XiaomiActorGatewayHandler.java:187) at org.openhab.binding.mihome.handler.XiaomiActorGatewayHandler.execute(XiaomiActorGatewayHandler.java:53) at org.openhab.binding.mihome.handler.XiaomiDeviceBaseHandler.handleCommand(XiaomiDeviceBaseHandler.java:100) at org.eclipse.smarthome.core.thing.internal.ThingManager$4.call(ThingManager.java:374) at org.eclipse.smarthome.core.thing.internal.ThingManager$4.call(ThingManager.java:1) at org.eclipse.smarthome.core.common.SafeMethodCaller.executeDirectly(SafeMethodCaller.java:218) at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:189) at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:83) at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:67) at org.eclipse.smarthome.core.thing.internal.ThingManager.receiveCommand(ThingManager.java:371) at org.eclipse.smarthome.core.items.events.AbstractItemEventSubscriber.receive(AbstractItemEventSubscriber.java:46) at org.eclipse.smarthome.core.internal.events.OSGiEventManager$1.call(OSGiEventManager.java:192) at org.eclipse.smarthome.core.internal.events.OSGiEventManager$1.call(OSGiEventManager.java:1) at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:181) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

Any idea?  
THX

BR,  
O.

[Previous page](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711.md?page=9)

[Next page](https://community.openhab.org/t/mi-xiaomi-smart-home-bindings/4711.md?page=11)
