Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aqara Vibration Sensor Set Sensitivity #1396

Closed
m50434 opened this issue Mar 30, 2019 · 26 comments
Closed

Aqara Vibration Sensor Set Sensitivity #1396

m50434 opened this issue Mar 30, 2019 · 26 comments

Comments

@m50434
Copy link

m50434 commented Mar 30, 2019

Hi,
I just add the Aqara Vibration Sensor (https://www.gearbest.com/goods/pp_009661787808.html?lang=en&wid=1433363) and wonder how I can set the sensitivtiy-value in the phoscon-App. In the original Xiaomi-App there are there values for sensitivity: low, medium and high.
At the moment it is obviously not supported in phoscon-app. Is it planed for future?!

@chimpy
Copy link

chimpy commented Apr 1, 2019

It is possible to set this via the API. I can't remember how though. Search the issues here.

@ghost
Copy link

ghost commented Apr 1, 2019

curl -H 'Content-Type: application/json' -X PUT -d '{"sensitivity": 1}' http://yourIP/api/yourKEY/sensors/yourSensorID/config

Sensitivity is from 1 to 21 where 1 is the most sensitive.

@m50434
Copy link
Author

m50434 commented Apr 1, 2019

Great. That worked.
Thanks.

@m50434 m50434 closed this as completed Apr 1, 2019
@jladefoged
Copy link

I just did the same for a Hue motion sensor.
The REST API guide is here: http://dresden-elektronik.github.io/deconz-rest-doc/

@gekomax
Copy link

gekomax commented Jun 17, 2019

Hi, where I can find the api key? is the number wrote in the HA integration tab?

@Stig1987
Copy link

Stig1987 commented Jul 4, 2019

I got it working with help of gpl1998 comment above despite no pre-knowledge. Below some hints that had saved time for me:

  1. Finding API key and understanding the concept: I used the guide http://dresden-elektronik.github.io/deconz-rest-doc/getting_started/ and http://dresden-elektronik.github.io/deconz-rest-doc/sensors/. I used the firefox rest client https://addons.mozilla.org/de/firefox/addon/restclient/

  2. Getting yourSensorID right: I tried with the name I choose for the sensor inte the Phoscon APP. but in my case it was a number, "60". Not all numbers where linked to sensors so try and error was not successful for me. Instead, I sent a GET to http://<ip>:<port>/api/<api-key>/sensors , downloaded the big chunc of text, opened it in visual studio code, searched for the sensor name, in my case "back_door_vibration" and sorted out which chunc of text that belonged to this sensor. The number in the beginning, was then the id.

The chunc of thxt for my vibration sensor:
"60":{"config":{"battery":98,"on":true,"pending":[],"reachable":true,"sensitivity":11,"sensitivitymax":21,"temperature":2500},"ep":1,"etag":"31b154ca59c1ea415ddeba9177089e01","manufacturername":"LUMI","mode":1,"modelid":"lumi.vibration.aq1","name":"back_door_vibration","state":{"buttonevent":1009,"lastupdated":"2019-07-04T19:39:22"},"swversion":"20180130","type":"ZHASwitch","uniqueid":"00:15:8d:00:02:c4:e5:0c-01-0101"},"

  1. Understanding what command to send: I used "Method" PUT, URL "http://<ip>:<port>/api/<api-key>/sensors/<sensor id> and "Body" { "sensitivity": 1 } in firefox rest client. I think the command in gpl1998 includes all of this for some more command-line like format

No guarante that I have got it right but the response on GET is now at least ""sensitivity":1". I hope this comment (my first on GitHub) is recieved well and can save time for someone.

@HansOHG
Copy link

HansOHG commented Jul 26, 2019

Hello Stig and thank you for the explanation.
I have managed to get the api and the sensor id for my vibration sensor but when I try to send the PUT command with body: { "sensitivity": 1 }
I get a error message:
[ { "error": { "address": "/sensors/sensitivity", "description": "parameter, sensitivity, not available", "type": 6 } } ]

Any thoughts what I might be doing wrong?

@Smanar
Copy link
Collaborator

Smanar commented Jul 27, 2019

Are you sure for the id ?
wich one adress have you used ("address": "/sensors/sensitivity" is strange) ?

@HansOHG
Copy link

HansOHG commented Jul 27, 2019

My sensor has the id: 20 if I understand correct.

Rest API vibrationsensor – Kopi
Rest API vibrationsensor PUT

@ebaauw
Copy link
Collaborator

ebaauw commented Jul 27, 2019

I wouldn’t try and make sense of the error message, but it does indicate an error: you need to PUT to /api/xxxxxx/sensors/20/config

@Smanar
Copy link
Collaborator

Smanar commented Jul 27, 2019

Yep, you are using bad url, your is finishing by "sensors/20"

@HansOHG
Copy link

HansOHG commented Jul 27, 2019

Thank you guys.
adding /config to the end of the url did work. My sensitivity is now 1

@00lex
Copy link

00lex commented Aug 25, 2019

I spent 2h on testing and this doesn't work!
I used a servo on different speeds for movement and glued the sensor on a speaker membrane for testing impulse with a 50hz tone on various volumes.

the results are identical. sensitivity 1 = 11 = 21

two options:

  • the api command has no effect
  • the sensor sensitivity can't be changed

@Smanar
Copy link
Collaborator

Smanar commented Aug 25, 2019

Put the sensor on a table, and knock the table with different sensitivity. It don't work for mouvement, or frequency. And you will have always the same value, true instead of false.

@00lex
Copy link

00lex commented Aug 25, 2019

Knocking on a table is not precise enough and not reproducible.
because of that I use the Membran of a speaker to get exact the same intensity.
If play/pause a 50hz tone, you get every time the same knock which you can de increase by volume

@MHOMEASS
Copy link

MHOMEASS commented Aug 28, 2020

Knocking on a table is not precise enough and not reproducible.
because of that I use the Membran of a speaker to get exact the same intensity.
If play/pause a 50hz tone, you get every time the same knock which you can de increase by volume

I had the same experience. I set the sensitivity to '1' and '21' but didn't notice any difference. When I looked at the status of the sensor I saw that 'sensitivity' was 'pending'. Then I read a post that you have to press the reset button for a few times for 1 second directly after you set the sensitivity. The pending status disappeared and now the sensitivity appeared to be more sensitive.

@Spanishu
Copy link

I have just updated my Sensor according to the instructions. However, I have had the same experience than @MHOMEASS and there is not difference in the real sensitivity of the sensor. The sensitivity is 21. Any suggestions?

@Smanar
Copy link
Collaborator

Smanar commented Nov 10, 2020

Are you testing the vibration or the tilt ?
Put the sensor on a table, and knock the table.

@Spanishu
Copy link

I have changed the value to 1 and it is much more sensitive. Not as much as I would like but it works!

@fr1cklr
Copy link

fr1cklr commented Apr 23, 2023

Please help me!

I had the same experience. I set the sensitivity to '1' and '21' but didn't notice any difference. When I looked at the status of the sensor I saw that 'sensitivity' was 'pending'. Then I read a post that you have to press the reset button for a few times for 1 second directly after you set the sensitivity. The pending status disappeared and now the sensitivity appeared to be more sensitive.

What exactly means "a few times for 1 second"?

I can't get rid of the ""pending":["sensitivity"]" regardless how often I press the button :(

@Smanar
Copy link
Collaborator

Smanar commented Apr 24, 2023

If i m right, you can just set the value you want, and wait for deconz be able to change it, can take 1 hour.

@Nisbo
Copy link

Nisbo commented Dec 7, 2023

I also have an Aqara Vibration Sensor.
Pairing with Phoscon worked and I was able to see the value in Home Assistant.
However, I am not able to change the sensitivity.

I googled around and they always say, change sensitivity from 2 to 1. Some people had null for sensitivity. sensitivitymax was always 21

If I query the sensor
http://192.168.178.145:80/api/EDIT/sensors/00:15:8d:00:09:6f:d1:06-01-0101

I get this response:

{"config":{"battery":100,"duration":65,"on":true,"pending":[],"reachable":true,"sensitivity":-8,"sensitivitymax":2,"temperature":2300},"ep":1,"etag":"01287233f1f41fea295d7eb07a49d804","lastannounced":null,"lastseen":"2023-12-07T16:54Z","manufacturername":"LUMI","modelid":"lumi.vibration.aq1","name":"Vibrationssensor","state":{"lastupdated":"2023-12-07T16:53:31.115","orientation":[-3,82,8],"tiltangle":144,"vibration":false,"vibrationstrength":167},"type":"ZHAVibration","uniqueid":"00:15:8d:00:09:6f:d1:06-01-0101"}}

My sensitivitymax is 2 instead 21 and sensitivity is negative -8 instead 2

When I try to change the value

curl -H 'Content-Type: application/json' -X PUT -d '{"sensitivity": 1}' http://192.168.178.145:80/api/EDIT/sensors/00:15:8d:00:09:6f:d1:06-01-0101/config

I get success

[{"success":{"/sensors/00:15:8d:00:09:6f:d1:06-01-0101/config/sensitivity":1}}]

So I send the command, and pushed 2 times the button on the sensor. The blue LED was flashing short, but the value for sensitivity did not change.

I also tied other values like -21, -11, -1, -2, 1, 2 ....
sensitivitymax is readonly

Any ideas ?

PS: running Gateway 2.24.1

@Smanar
Copy link
Collaborator

Smanar commented Dec 7, 2023

From last version, value can be only 0/1/2.
Just set a value and wait, deconz will wait the device be alive to send the request. If I m right a short press alone is enought to wake up the device.

The -8 value is more worrying ...

Edit:
Have you a recent deconz version ? On the last DDF I can see

        {
          "name": "config/sensitivitymax",
          "static": 2
        },

So you can't have 21 with last version.

@Nisbo
Copy link

Nisbo commented Dec 7, 2023

My Gateway is 2.24.1 (pre installed with the raspberry image)
Firmware of the Conbee II stick is 26720700
Or which version do you mean ?

I tried again with 0 and pushed the button only once, no change

@Nisbo
Copy link

Nisbo commented Dec 7, 2023

I updated to 2.24.2, still not successful.

@Mimiix
Copy link
Collaborator

Mimiix commented Dec 7, 2023

These questions don't belong here. Please use the forums.

@dresden-elektronik dresden-elektronik locked and limited conversation to collaborators Dec 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests