Support for more Mi-Home Aqara items

(Kim Skatun) #61

@wars how is the response time of the Home Aqara Human Body Sensor ? the phillips hue motion sensor only get feedback every 1s which is to slow for bathroom light.

Is it possible to install the binding git? Because it does not show up in paper UI?

(Brian M. Pedersen) #62

I think there are some hack you can use, I found this one and almost got it to work:

though this you can stream from the camera without using the cloud. I think you can find hacks for most of the xiaomi cameras.

(Thomas Binder) #63

It’s nearly realtime I guess. Depending on the network latencies…

(Ward) #64

I use it for my light in basement & storage room and for me the sensor reacts almost realtime.
When the lights turnoff after my predefined time, they doesn’t go on immediately when I’m still in the same room. But I didn’t took the time to find out why.

(Thomas Binder) #65

The sensor has an internal timer (3min default, if I remember correctly). The sensor works this way:

  • Sending ON at first movement
  • Waiting interval (regardless what happens)
  • Sending OFF after interval
  • Sending ON with next movement
  • repeat

So you have to use some kind of logic, which turns your light off with a delay. I use the sensor ON to trigger my item and oignore the OFF. the item itself had an expire set to 10min. In my case, this is sufficient to trigger movement until nobody is in the room. You have to find your settings depending on your room, the sensor’s location and how you use the room.

(Nuno Silva) #66


I just made a few search’s on the forum and it seems that “Xiaomi Mijia Aqara Smart IP Camera Smart Linkage Alarm 180 Degree 1080P HD Home Security Camera” is not compatible with OpenHab…

I tried the “easter egg” of enable network features but I got timeout operation.

Can someone help with this?


(Constantinos Contis) #67

do we have a feedback for Xiaomi Aqara Neutral Wall Switch (1 and 2 buttons)?At the xiaomi binding page says that they are supported but (not yet confirmed)…Anyone using one?I use the non Neutral version and they work just fine…Any feedback?

(Ward) #68

Today I received the new Aqara smart switch:

This one has an extra gesture feature, so in total 4:

  • Click
  • Double-click
  • Press and hold
  • Shake

I don’t have the knowledge to modify the binding with an extra thing, but maybe I can give info to the people who can?

the name of the switch is: lumi.sensor_switch.aq3

(Dimalo) #69

lets try :slight_smile:

please do debug logs of:

  • report message (comes in cyclic - every 15min or so)
  • every action (also try if it’s like the cube: rotate, fall, shake, etc.)
  • read_ack message (comes when binding starts up, so restart the binding over karaf console or restart openhab and search the log for “read_ack”)

here are the possible actions for the cube:

rule "Xiaomi Cube"
    Channel 'mihome:sensor_cube:<ID>:action' triggered
    var actionName = receivedEvent.getEvent()
    switch(actionName) {
        case "MOVE": {
        case "ROTATE_RIGHT": {
        case "ROTATE_LEFT": {
        case "FLIP90": {
        case "FLIP180": {
        case "TAP_TWICE": {
        case "SHAKE_AIR": {
        case "FREE_FALL": {
        case "ALERT": {


(Ward) #70

I think it will be easy :slight_smile:

I created 2 things for this device

  • mihome:sensor_switch_aq2
    All 3 actions are working (single press, double press, long press)

  • mihome:sensor_cube
    In openhab logs I see the ‘shake’ event.

Battery status is also reported (batteryLevel + lowBattery)
So a combination of these 2 things will do the trick. I guess…

I also noticed that LONG_PRESSED is implemented for the mihome:sensor_switch_aq2 thing, but this device only supports single & double press actions.

an overview of all three switches:
Xiaomi Switch (round one)

  • Double-click (DOUBLE_PRESSED)
  • Press and hold (LONG_PRESSED+ LONG_RELEASED)

Aqara Switch

  • Double-click (DOUBLE_PRESSED)

Aqara Switch with gyro

  • Double-click (DOUBLE_PRESSED)
  • Press and hold (LONG_PRESSED)
  • Shake (SHAKE)

There is also a rebranded Aqara Cube with the same functionality as the Mi version:

(Dimalo) #71

try just one “Xiaomi Mi Wireless Switch” (without aqara) - so the first generation, round one.
if I understand your summary correctly this should work already.
the channel just triggers on everything it receives. That’s why it doesn’t matter if mihome:sensor_switch_aq2 never sends LONG_PRESSED, it simply won’t trigger.
You just have to merge the shake rule template into the switch template.

rule "Xiaomi Switch"
    Channel "mihome:sensor_switch:<ID>:button" triggered
    var actionName = receivedEvent.getEvent()
    switch(actionName) {
        case "SHORT_PRESSED": {
        case "DOUBLE_PRESSED": {
        case "LONG_PRESSED": {
        case "LONG_RELEASED": {
        case "SHAKE_AIR": {

please report if this works out.

perhaps instead of "SHAKE_AIR" just "SHAKE"

(Ward) #72

The mihome:sensor_switch doesn’t have the skake action/event, openhab reports UNKNOWN_EVENT
I can get to new switch working if I combine 2 things (lumi.sensor_switch.aq3 & mihome:sensor_cube). But for easier handling, it should have its own thing, no?

I also received the smart wall switch (2buttons)
Everything is working, but with every buttonpress, I receive 2 events:
left button:
mihome:86sw2:wall_switch_2btn:ch1 triggered SHORT_PRESSED
mihome:86sw2:wall_switch_2btn:ch1 triggered UNKNOWN_EVENT
right button:
mihome:86sw2:wall_switch_2btn:ch2 triggered SHORT_PRESSED
mihome:86sw2:wall_switch_2btn:ch2 triggered UNKNOWN_EVENT
both buttons:
mihome:86sw2:wall_switch_2btn:dual_ch triggered SHORT_PRESSED
mihome:86sw2:wall_switch_2btn:dual_ch triggered SHORT_PRESSED

(Dimalo) #73

then please make the logs and I will understand…

(Ward) #74

New Aqara device:

(Thomas Binder) #75

Does it report the degree of an inclination? could come in handy for some kind of alarm based on degree of inclination (e.g. >10° will trigger an alarm for a roof window if there’s rain).

(Ward) #76

hi dimalo, I never used this new device anymore, but I just found it back in my closet :slight_smile:

To summarize:
this new Aqara switch (lumi.sensor_switch.aq3) has 4 actions

  • Click ( SHORT_PRESSED )
  • Double-click ( DOUBLE_PRESSED )
  • Press and hold ( LONG_PRESSED & ‘LONG_RELEASED’ )
  • Shake ( UNKNOWN_EVENT )

The first 3 are working fine (with mihome:sensor_switch), but OpenHAB reports for the shake action UNKNOWN_EVENT in the logs. I don’t know if this is comming from the binding or from the gateway?

If you need debug logs, I’ll try to grab them (never did this…)

(Gad Ofir) #77

Hi @Tribon please tell if you where able to add the gateway?
i would like to buy one also
and what do you think of it?

(Maciek B) #78

No I was not able to add camera as gateway. I verified also domoticz forum. This seems to be impossible for this part and is not related to home automation system.

(Gad Ofir) #79

thanks for the heads up almost orderd one…
i will wait, i still dont see why i need a gateway so i will hold

(Dimalo) #80

hi @wars, it should be working in the latest snapshot. I found the reason for UNKNOWN_EVENT. It should now report SHAKE correctly.