ZHA Xiaomi Aqara Vibration Sensor Settings

Yeah I miss it too since I switched to ZHA. However, in the Integrations and selecting the vibration device, you can select to create an automation upon “Device Tilted”. It won’t report the angle of tilt, just that a tilt did indeed happen.

1 Like

As far as I understand, vibration is only recorded in ZHA via the vibration binary_sensor and is not a zha_event. This sensor has a “cooldown” of about one minute and does not report the strength of the vibration.

Does anyone know to shorten the cooldown period, IE. record multiple vibrations and maybe even the strength?

2 Likes

I’m trying to adjust the sensitivity of my Aqara Vibration sensors, but I’m getting the following error. Any suggestions?

Logger: homeassistant.components.websocket_api.http.connection
Source: components/zha/api.py:679
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 3:14:54 PM (7 occurrences)
Last logged: 3:35:15 PM

[547317751760] Error handling message: Unknown error
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py”, line 27, in _handle_async_response
await func(hass, connection, msg)
File “/usr/src/homeassistant/homeassistant/components/zha/api.py”, line 679, in websocket_read_zigbee_cluster_attributes
success, failure = await cluster.read_attributes(
File “/usr/local/lib/python3.9/site-packages/zigpy/zcl/init.py”, line 297, in read_attributes
result = await self.read_attributes_raw(to_read, manufacturer=manufacturer)
File “/usr/local/lib/python3.9/site-packages/zigpy/quirks/init.py”, line 210, in read_attributes_raw
return await super().read_attributes_raw(
File “/usr/local/lib/python3.9/site-packages/zigpy/device.py”, line 287, in request
raise zigpy.exceptions.DeliveryError(
zigpy.exceptions.DeliveryError: [0x8204:1:0x0000]: Message send failure

Coincidentally I came on this when looking for something else but I had the same problem. I noticed I had to wake the sensor before setting the sensitivity. I was using Zigbee2MQTT to set and getting a timeout error. Doesn’t seem to match what you’re seeing but that might help

Hi there… where are these settings ? Do i have to change so advanced settings ? Didn’t get these informations on your screenshot.

grafik

Instructions updated for Home Assistant (tested on version 2022.4.4 using Conbee II Zibgee and ZHA)

Hope this is of use to anyone adjusting the sensitivity on the Aqara Vibration Sensor. The layout in Home Assistant layout has changed a good amount (for the better) and as a result, it’s not easy to navigate the useful info above as a result.

  • In Home Assistant, go into “Configuration” and then into “Devices and Services
  • Search for “Zigbee” and click on “** Devices
  • Search for your device and click on its name.Note: If you didn’t name it correctly on setup, the manuacturer should be “LUMI” and Model as “lumi.vibration.aq1
  • Click on “Manage Clusters
  • In the “Clusters” dropdown menu at the top, choose “VibrationBasicCluster (Endpoint id: 1, Id: 0x0000, Type: in)
    In the “Cluster Attributes” - “Attributes of the selected cluster" dropdown box, choose - sensitivity (id: 0xff0d)”,
  • Set the value as either “1” (very sensitive), “11” (medium) or “21” (low sensitivity)
  • Set the Manufacture code override as “4447
  • To complete click “Set Zigbee attribute”, wait for the spinning wheel to complete…and you’re done!

Hope I’ve all that documented correctly. Let me know if it works ok for you. Good luck!

11 Likes

What is the threshold that it has to pass to report a new angle?
I am not sure if vibration or tilt is better for my mailbox. Because the angle can be very small for a single letter. I can probably add some resistance/weight to the lid, so its has to be pushed back. :innocent:

       {% set doordir = states.binary_sensor.mailbox_vibration_sensor.attributes.tiltangle %}
       {% if doordir | float <= 45 %}Closed
       {% elif doordir | float > 45 %}Open
       {%- endif %}

I did not test it for granularity specifically but I do recall it was approx. 5 degrees.

Ok, how do you even get the value of the angle? I only have a binary sensor and a temperature sensor.

It’s not a separate entity, it’s an attribute of the binary sensor. You can see it’s current position by bringing up the Developer Tools/Current Entities/scroll down to find the binary sensor and look at the Attributes column.

Not with ZHA then. I only have on or off.

I don’t think any of the angle info is exposed In ZHA in a friendly manner. I think you have to use a trigger on zha_event and parse the event data. The x axis should be something like trigger.event.data.args[0]['X']. Maybe I missed something in ZHA, happy to be corrected.

The device is MUCH simpler to use in zigbee2mqtt, where each axis is exposed as an entity and as attributes.

1 Like

I am now using zigbee2mqtt as well.

But how can I set the sensitivity?

I thought sensitivity was exposed as an entity. Not where I can see right now. The HA entity may be disabled by default, but I generally set from the z2m “exposes” page.

Recommend setting from z2m so you will get the red popup if the setting attempt fails.

As a battery powered device, the sensor sleeps most of the time. You have to make sure the device is awake to receive the setting message. Try setting sensitivity from the z2m page while repeatedly pressing the button every few seconds, or otherwise keeping it awake(repeatedly rotate in your hand, drop it, slap it, etc).

If pressing the button, it should be a “single click” like press, not a long press - you don’t want the device to go into pairing mode.

1 Like

It is available in HA, but doesn’t change it.

I wake up the device, but no luck…

Publish 'set' 'sensitivity' to 'Waschmaschine' failed: 'Error: Write 0x00158d000725c2eb/1 genBasic({"65293":{"value":1,"type":32}}, {"sendWhen":"immediate","timeout":35000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":4447,"transactionSequenceNumber":null,"writeUndiv":false}) failed (no response received)'

Just tried changing settings on my spare. I had better luck pressing the button every second or so.

1 Like

Not working. It does register the button press, but I always get the error. It worked instantly with zha before.

Can I send the raw commands somehow?

when you set the sensitivity successfully. Do you see anything in the logs?
I’m not seeing anything.
Using ZHA.

ADDITIONAL INSTRUCTIONS ON SETTING & VALIDATING SENSITIVITY SETTINGS:

I wanted to report back for those that are having issues with the getting this sensor’s sensitivity set correctly….because well its a pain.

What worked for me is to press the wake button on the sensors twice, one second apart and then press the “Set Zigbee attribute” while its spinning press the wake button a third time.

To validate that the setting has took.
Clear out the “1” and “4447” keep the other settings.
Perform the same steps i listed above but click the Read attribute button. If it works you should see a “1” show up.

If “11” shows up that’s the default value so repeat your steps above to get it to take.
If nothing shows up, check your HA logs and you’ll probably show a bunch in the logs relating to the read failure. That’s basically saying that the device was not awake when you clicked the Read button.

I also had a few issues where the device would not even register vibrations. This usually happened after trying to write the “1” and failing a few times. I had to go into ZHA and register it again - you dont need to press and hold the wake button, just click it a few times.

It’s a big of a pain but i think i have it working now.

I hope this helps a few of you. Good Luck.

3 Likes

chrome_9BtOJte8OU
Here is how I found the cluster settings for ZHA in 2022.6

1 Like