Support for more Mi-Home Aqara items

(Ward) #41

I’ll try to deliver some wireshark logs within a few days. Don’t you own a gateway and some sensors yourself? It’s not that I don’t want to contribute, but it seems difficult to develop stuff without the hardware.

(Ward) #42

I’ve tested the jar file from

My feedback:

  • Discovery is not working, I’ve added them manually (just like @thecrater). Not a big deal for me, I add them all manually :slight_smile:

Thing mihome:sensor_switch_aq2:wireless_switch_aqara “Xiaomi Aqara Wireless Switch” @ “Xiaomi switch” [itemId=“158d000xxxxxxx”]
Thing mihome:water:water_sensor “Xiaomi Aqara Water Sensor” @ “Xiaomi water” [itemId=“158d000xxxxxxx”]

  • Maybe better to name the water sensor thing as sensor_wleak_aq1 instead of just water, just to keep everything the same.
  • Change description of the water sensor thing from Xiaomi Water Leak Sensor to Xiaomi Aqara Water Leak Sensor
  • There is no item available in the water sensor for the battery value. For such a device, this is quite important I think. I suppose this works the same as the other ones…?
  • all values from water sensor or motion sensor are looking good

@thecrater: My door/window sensor is still working fine (I have the Mi version, not (yet) the Aqara)

(Sergey M) #43

Tell us how you use wireshark? Where on the network is it installed and what interface are you listening to? Whose source or destination address do you filter, what filters do you use?

(Ward) #44

I don’t do anything special. Leave all settings by default. Afterwards I just looked up the IP of the gateway.

I tried to play a little with the radio on the gateway, but all I can see is this:


(Dimalo) #45

would be good to have a log showing the status message of the gas or smoke sensor…

(Andreas Cittlau) #46

I’m not sure if this is what you are looking for, but this is what I get when I just added the smoke sensor. I got the last three lines when pushing the test button on the smoke sensor itself.

2017-09-13 20:28:22.557 [DEBUG] [g.mihome.handler.XiaomiBridgeHandler] - Send to bridge mihome:bridge:f0b429cc59fa: {"cmd": "read", "sid": "158d00015b1a77"}
2017-09-13 20:28:22.723 [DEBUG] [g.mihome.handler.XiaomiBridgeHandler] - Device 158d00015b1a77 honored read request
2017-09-13 20:28:22.723 [DEBUG] [discovery.XiaomiItemDiscoveryService] - Detected Xiaomi smart device - sid: 158d00015b1a77 model: smoke
2017-09-13 20:28:33.893 [DEBUG] [g.mihome.handler.XiaomiBridgeHandler] - Adding item listener for device 158d00015b1a77
2017-09-13 20:29:09.244 [DEBUG] [home.handler.XiaomiDeviceBaseHandler] - Device 158d00015b1a77 on channel mihome:smoke:158d00015b1a77:alarm received command REFRESH
2017-09-13 20:29:09.244 [DEBUG] [home.handler.XiaomiDeviceBaseHandler] - Update Item 158d00015b1a77 with retented message
2017-09-13 20:29:09.244 [DEBUG] [home.handler.XiaomiDeviceBaseHandler] - Item got update: {"cmd":"read_ack","model":"smoke","sid":"158d00015b1a77","short_id":30476,"data":"{\"voltage\":3085}"}
2017-09-13 20:29:09.250 [DEBUG] [home.handler.XiaomiDeviceBaseHandler] - Device 158d00015b1a77 on channel mihome:smoke:158d00015b1a77:status received command REFRESH
2017-09-13 20:29:09.251 [DEBUG] [home.handler.XiaomiDeviceBaseHandler] - Device 158d00015b1a77 on channel mihome:smoke:158d00015b1a77:batteryLevel received command REFRESH
2017-09-13 20:29:39.748 [DEBUG] [home.handler.XiaomiDeviceBaseHandler] - Item got update: {"cmd":"report","model":"smoke","sid":"158d00015b1a77","short_id":30476,"data":"{\"density\":\"0\"}"}
2017-09-13 20:29:39.752 [DEBUG] [home.handler.XiaomiDeviceBaseHandler] - Item got update: {"cmd":"heartbeat","model":"smoke","sid":"158d00015b1a77","short_id":30476,"data":"{\"voltage\":3085}"}
2017-09-13 20:29:39.946 [DEBUG] [home.handler.XiaomiDeviceBaseHandler] - Item got update: {"cmd":"report","model":"smoke","sid":"158d00015b1a77","short_id":30476,"data":"{\"alarm\":\"0\"}"}

Also, when clicking the alarm switch ON/OFF through sitemap I got the following.

2017-09-13 20:30:20.297 [DEBUG] [home.handler.XiaomiDeviceBaseHandler] - Device 158d00015b1a77 on channel mihome:smoke:158d00015b1a77:alarm received command ON
2017-09-13 20:30:20.297 [WARN ] [home.handler.XiaomiSensorBaseHandler] - Channel mihome:smoke:158d00015b1a77:alarm does not exist
2017-09-13 20:30:21.323 [DEBUG] [home.handler.XiaomiDeviceBaseHandler] - Device 158d00015b1a77 on channel mihome:smoke:158d00015b1a77:alarm received command OFF
2017-09-13 20:30:21.323 [WARN ] [home.handler.XiaomiSensorBaseHandler] - Channel mihome:smoke:158d00015b1a77:alarm does not exist

(Dimalo) #47

Hey Andreas thanks for the perfect log! There is an undocumented channel “density” showing.
here you go :smile:

(Greg) #48

The gateway firmware has been updated - and the issue i had with the second button not sending has been fixed!

Now to block the gateway from the internet!

(marcolino) #49

just received my Water Leak sensor.
It work very fine, but I cannot get battery voltage channel:


I tried to use batteryLevel instead of voltage, and I get a strange value, 81. It mean 81% ? Is it possible to have also the voltage?
Do you have some examples for this sensors?
At this link miss some example for Water Leak and Smoke Sensors.

Many thanks in advance

(Antonio) #50

Could you indicate the steps you took to operate the “aqara” door sensor? I’m a rookie yet. Thank you

Mi(Xiaomi) Smart home bindings?
(Maciek B) #51

I just bought Xiaomi Mijia Aqara Smart IP Camera
It is camera with getaway functionality. Could you update the binding to support new aqara member?

(Dimalo) #52

Hi @Tribon
The binding uses the developer mode of the gateway. Does the new camera support developer mode?
Please check by doing the same as for the gateway described in the readme.
If the camera has no developer mode, then its a case for the miio binding - have a look here

(Maciek B) #53

I’m waiting for delivery of camera. Will give some more info when received.
To be honest this camera was advertised as getaway = I hope I will be able to use it instead of getaway. As I don’t need Chinese radio or led lamp I thought to order some door/window sensors and connect them to over zigbee to new camera.

(Anders Borgen Nielsen) #54

I have received this camera. It is possible to perform the first steps to enable developer mode, but the camera device doesn’t support the feature to change network mode.

Besides this it seems to work as a gateway. My ordered gateway v2 still hasn’t arrived. I also hope that the extra gateway could be awoided.

(Maciek B) #55

AndersBN, I had the same idea. I was looking to add 2 cameras that will act as getaways. I was able to turn ON developer mode. Could see “local area network communication protocol” and “gateway information” but after choosing first option it states that “current device don’t support this feature”. When picking “gateway information” I can see detailed information about network, camera. I found there token that will try to use with Mi IO Binding.

(Thomas Binder) #56

I have both a MiHome Gateway v2 and two IP Cams (which I initially thought also would be managed by the Gateway. I didn’t find a way to connect the Cameras with the Gateway - they do connect with the MiHome App - but they don’t seem to be connected to the Gateway.
I’m curious for Controlling the IP Cams with openHAB - as they don’t seem to have an API or ONVIF-Support.

@AndersBN: you said, you could set the camera to developer mode? how did you do that? and what can you do with that?

My two cameras are:

  • XIAOMI CHUANGMI 720P Smart Camera IR
  • Xiaomi mijia Smart 720P WiFi IP Camera Pan-tilt Version

(Anders Borgen Nielsen) #57

Hi Thomas

I think I read that this camera still is in beta, therefore the software still might have to be updated fully.

In the MI Home app, I selected the camera, then settings. Under About I clicked on the Version number 5-6 times and then I get the info as discribed for the normal gateway, 2 new menu items: 1) local area network comm protocol 2) gateway information.

It is not possible to select Local area network, a popup states: Current device does not support this feature

Under Gateway information I can see the Token and multiple other info. I did try to enter the Token into OpenHAB, but it was not accepted as a valid developer key.

As I ordered an extra, I’ll be happy to sponsor 1 device if this would make it easier/faster to have a go at? Unfortunately my skillset in coding+chinese doesn’t provide the necessary tools to solve this.

(Thomas Binder) #58

Thanks! But unfortunately both my cameras lack that entry (no “Setting” and no “About”) - they don’t have the word “Aqara” in it. Perhaps that’s the point. Can you point me to your camera? I only find These:

(Anders Borgen Nielsen) #59

Yes, this one:

For some reason it is not listed as Xiaomi, but only Aqara smart IP camera. FYI, I found this comparison on youtube quite good:

(Olivier Leplus) #60

I just bought an Aqara Smart IP Camera.
Is there any progress on the integration with OpenHab? I would love to see the video stream on OH :slight_smile: