Aqara Vibration Sensor random triggering

I’m using an Aqara Vibration sensor with Home Assistant and ZHA, but am getting random triggering several times a day - even on a solid concrete windowsill (and we don’t get earthquakes in my part of the U.K.!). As I want to use it as part of an intruder alert this problem makes it unusable for the purpose.

This post show a method of changing the sensitivity, but I don’t thinks that it’s working with my setup, because I am unable to read back the setting to confirm any changes:

Does anyone have any ideas, please?
Jim

‘And answer came there none!’

OK - let’s try it this way: Is there anyone using the Aqara Vibration Sensor successfully with Home Assistant and ZHA?
Jim

Checkout this video by The Hook Up, it might help you if your behaviour comes from retaining-errors:

You won’t be able to read back the setting unless you wake the sensor. Try querying it while pushing the link button every couple seconds. This is the same proccess when writing the setting.

1 Like

Many thanks ‘PrairieSnpr’ - that did it!
(But how did you know that - there seems to be very little information on the net?)

I can now set and read the sensitivity settings, but I’m not sure if the random triggering will be cured. I’ll run the sensor for a few days and report back.
Jim

I learned about it on the ha discord server, I thought there was a pairing guide on the zha device handlers github, but don’t see it anymore.

have you finally solved with random triggering several times a day?
I’m using those sensors too as part of an intruder alert and I found it works correclty (no random triggering) only with this config:

- alias: Alarm
  trigger:
  - platform: event
    event_type: zha_event
    event_data:
      device_ieee: 'XX:XX:XX:XX:XX:XX:XX:XX'

anyway this works only with tilt and/or drop event but is missing the vibration event.
I see the vibration only with this setup:

- alias: Alarm
  trigger:
  - platform: state
    entity_id: binary_sensor.lumi_vibration_sensor
    from: 'off'
    to: 'on'

…but it gives me also random triggering, like this:

Dunno how to capture vibration event with zha_event…

I think my sensor might be OK now.

When I first got it I had great difficulty in pairing it, and gave up a couple of times. When I eventually got it paired I had random triggering - frequently several times a day. I tried reading and setting the sensitivity but was unable to do so until ‘PrairieSnpr’ posted the technique (above).

Since I’ve been able to set and read the sensitivity I don’t seem to have random triggering, but I’m still giving it a bit more time.

When I tried the sensor with HA I assumed that it would be like the Sonoff Button and only trigger a zha_event and not show up as an entity, but I found that it in fact showed up as an entity and in operation didn’t trigger a zha_event. So far I can only get vibration, but not tilt or drop.

I’m testing the sensor using the Node-Red integration in HA. I find yaml very opaque and frustrating even though I’ve programmed in several languages (but not Java of Python).

FWIW, this is the Node-Red flow I’m using to test the device:

[{"id":"d0a83d36.35d8e8","type":"pushover","z":"bd0eed73.cd1508","name":"","device":"","title":"","priority":0,"sound":"bugle","url":"","url_title":"","html":false,"x":540,"y":180,"wires":[]}]

As you can see, I get an alert on my mobile 'phone if the sensor is triggered. If I decide that the device is reliable, like you I intend to use it in an intruder alert set-up.

I’m not very satisfied with the Aqara sensor, and look forward to Sonoff releasing one.
Jim

Are you using ZHA or deCONZ integration?

The ZHA integration.

Solved!
I switched to zigbee2mqtt + conbee2 cofig instead of ZHA integration / deCONZ integration and now I can manage tilt, drop and vibration without random triggering, and it’s easier to set and read the sensitivity. I’ve tested for 48h and I no longer had random triggering.

Since I’ve placed my vibration sensors outside but they are not waterproof, I 3dprinted a box. Here the link to download .stl file (just in case!) > https://www.thingiverse.com/thing:4668065
Setted all down and ready to test the new intruder alarm version!!

UPDATE!!
I have fixed this issue by removing this string:
before

            elif attrid == RECENT_ACTIVITY_LEVEL_ATTR:
                # these seem to be sent every minute when vibration is active
                self.endpoint.device.motion_bus.listener_event(MOTION_EVENT)

In this file:
/usr/local/lib/python3.8/site-packages/zhaquirks/xiaomi/aqara/vibration_aq1.py

Remeber to access at this file via portainer using homeassistant docker console!!!

Best Regards
Stefano

Thanks Stefano - it looks like a good fix.

“Remeber to access at this file via portainer using homeassistant docker console!!!”

Not sure how t do the above! I’ve got Portainer that’s part of a Nextcloud installation, and I think that my installation of H.A. is Docker, but apart from that Portainer and Docker are mysteries to me!
Jim

Hi @jimford
You need to access in the portainer and click here:


Then click here
image

Do you know linux command from here?

Thanks again Stefano.

I installed the HACS Portainer addon and explored it, but can’t find the Container Status page you show above. I can only see in the Container List odd names like ‘serene_greider’ etc…

I’m fine with the Linux cli.
Jim

Sorry i have no experience with HACS portainer addon, can you send some screen?

Thanks Stefano.

I feel that I need to get a better understanding of docker, containers and portainer - I know very little about any of them and they appear to be an extra layer of complexity in handling programs. I find it very off-putting!
Jim

@jimford
No problem I have also created a pull request, you can see and monitor here:

So you just need an HA upgrade I think
Best regards
Stefano

Thanks for the update, Stefano - I’ll keep a look-out for it.
Jim