Support for more Mi-Home Aqara items

@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?

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.

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

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.

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.

Hi,

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?

Regards,
Nuno

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?

Today I received the new Aqara smart switch:
https://www.aliexpress.com/item/2018-New-Xiaomi-Aqara-Smart-Wireless-Switch-Key-Intelligent-Application-Remote-Control-Built-In-Gyro-ZigBee/32860822768.html

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

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"
when
    Channel 'mihome:sensor_cube:<ID>:action' triggered
then
    var actionName = receivedEvent.getEvent()
    switch(actionName) {
        case "MOVE": {
            <ACTION>
        }
        case "ROTATE_RIGHT": {
            <ACTION>
        }
        case "ROTATE_LEFT": {
            <ACTION>
        }
        case "FLIP90": {
            <ACTION>
        }
        case "FLIP180": {
            <ACTION>
        }
        case "TAP_TWICE": {
            <ACTION>
        }
        case "SHAKE_AIR": {
            <ACTION>
        }
        case "FREE_FALL": {
            <ACTION>
        }
        case "ALERT": {
            <ACTION>
        }
    }
end

cheers!

1 Like

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) https://www.gearbest.com/smart-light-bulb/pp_257679.html
lumi.sensor_switch.v2

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

Aqara Switch https://www.gearbest.com/access-control/pp_626695.html
lumi.sensor_switch.aq2

  • Click (SHORT_PRESSED)
  • Double-click (DOUBLE_PRESSED)

Aqara Switch with gyro
lumi.sensor_switch.aq3

  • Click (SHORT_PRESSED)
  • 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: https://www.gearbest.com/access-control/pp_1845856.html?wid=1433363
https://www.banggood.com/Original-Xiaomi-Aqara-Magic-Cube-Remote-Controller-Sensor-Remote-Control-Switch-p-1293289.html

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"
when
    Channel "mihome:sensor_switch:<ID>:button" triggered
then
    var actionName = receivedEvent.getEvent()
    switch(actionName) {
        case "SHORT_PRESSED": {
            <ACTION>
        }
        case "DOUBLE_PRESSED": {
            <ACTION>
        }
        case "LONG_PRESSED": {
            <ACTION>
        }
        case "LONG_RELEASED": {
            <ACTION>
        }
        case "SHAKE_AIR": {
            <ACTION>
        }
    }
end

please report if this works out.

edit:
perhaps instead of "SHAKE_AIR" just "SHAKE"

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

then please make the logs and I will understand…

New Aqara device:


https://www.aliexpress.com/item/32893651794.html

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).

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…)

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?

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.

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

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