Publishing to zigbee2mqtt (Aqara vibration sensor)

Hi

I have a Aqara vibration sensor connected using Zigbee2MqttAssistant. It works fine.

I would like to change the sensitivity of the device and can via the link below read how to do this.

Sensitivity #

The sensitivity can be changed by publishing to zigbee2mqtt/[FRIENDLY_NAME]/set {"sensitivity": "SENSITIVITY"} where SENSITIVITY is one of the following values: low , medium , high .

After setting the sensitivity you immediately have to start pressing the reset button with an interval of 1 second until you see Zigbee2MQTT publishing the new sensitivity to MQTT.

But how do i publishing to zigbee2mqtt? Where do I write zigbee2mqtt/[FRIENDLY_NAME]/set {“sensitivity”: “SENSITIVITY”} ?

I’m new to this, so sorry if the question is simple.

1 Like

Hello,

You can use the service mqtt.publish from the developer tools.
In the service data, you can for example write :

topic: zigbee2mqtt/[FRIENDLY_NAME]/set
payload: '{"sensitivity": "high"}'

Hope this helps :slight_smile:

5 Likes

Thank you very much, that was exactly the help I needed :+1:

ah, I was writing “set” as a part of the payload, not as a part of the topic :wink: thanks!

Once you’ve done this, how can you tell if the update “took”?

The binary_sensor that this device created has an attribute of “sensitivity: null”
Should that change if the published setting is applied?

Nevermind - I was mixing up which device I was publishing to. Also, I now see that there’s an entity called “select.DEVICENAME_vibration_sensor_sensitivity” that reflects the sensitivity.

Sorry, new to HA and i am having difficulty with the publishing process. This is what my service entry looks like, i have tried with the [ and ] on and off, and using and not using the _ between the words of the Friendly Name. The Friendly Name of the device is Aqara Vibration Sensor. I press publish and then continue to press the reset button on the device at 1 second intervals but i am not seeing any feedback on HA indicating that it is being published and the Exposes tab still shows no option selected. Thanks.

Ok, did more research, fixed my syntax and managed to get one of the sensors done after clicking a significant number of times. using the Developers Tools option I am not sure that one receives feedback as to whether the message has been processed as either there was none or I missed it during the clicking spam.

Success was elusive on the other 4 sensors as clicking dozens of time over and over again got me nowhere.

I am not sure how frequented these forums are but there is an alternative method of accomplishing this with literally two clicks, one to wake up the device and another to keep it alive. Here it is in case it saves anyone some clicking, time and hassle:

  • Settings>Devices & services>MQTT># devices, then look for your device, look for this on your device ui page

image

click on the selection dialog icon on the left, get to this

image

click once on the pairing button to wake up the device, change the sensitivity to high, click again and done.

1 Like

I tried this several times but it always just times out.
May I ask what your device model number is?
Mine is
image

Oh interesting I just found this in the instruction, see the second para. I’ll try that

Sorry, i just saw this.

Thst exact same model.

I did not experience any such issues.

I did start buying the Smaturl ones, no issues and so much more sensitive

1 Like

Hm my logs shows following error if I set the sensitivity in the home assistant device itself:

If I set it in zugbee2mqtt details page I see no update message in the logs.
Using mqtt.publish has no effect in the logs too…

You need to wake your device and keep it awake before changing the sensitivity settings.

There’s instructions how to do this 2 posts above yours

I pressed the reset button for 60 seconds each second. I’m pretty sure this does not cause my problem…