deConz + Hue motion sensor - adjust senisitivity

https://dresden-elektronik.github.io/deconz-rest-doc/

Did you get this sorted out? Tried reading the docs but I didn’t fully understand…
If you could share the JSON I wwould be grateful.

No unfortunately. I briefly looked at it, and then put it on the to-do-later list, as it wasn’t obvious to me either how to the JSON.

Ahh… I see.
I need to get this sortet out somehow because my sensor is detecting motion everytime the wind is blowing…

I read the docs again and followed the steps. Now my outdoor sensor is on “sensitivity: 1”. Lets hope it works…

Installed Firefox REST addon
Found my gateway
Got the API by opening the authentication in deCONZ web gui and made the REST “GET”
Made a “GET” request and found the id for my sensor
Configed the sensitivity via a “PUT”

Took me about ten minutes.

1 Like

So I have moved to Deconz recently and whilst it’s been working great I have been suffering with too many false positives because the sensitivity of the Hue motion sensors is too high.

So what I did to remedy this was:

  1. Discover the API key which Home Assistant is using to access Deconz. This can be found in the config/.storage/core.config_entries file. Search for "deconz" and then you’ll find the "api_key". You could of course create a new api key in Deconz but for me I only needed to make this change once.

  2. Download a REST tool for Chrome - I am using YARC - Yet Another Rest Client

  3. Open YARC and in the URL field type http://<deconz-ip-address>:<deconz-http-port-number>/api/<api_key>/sensors and make a GET request.

  4. You’ll then be presented with a list of sensors. Search the JSON output for “sensitivity”. Mine were al lset to 2. Make note of the id number in the example below it is sensor id 5.

  "5": {
    "config": {
      "alert": "none",
      "battery": 100,
      "delay": 0,
      "ledindication": false,
      "on": true,
      "pending": [],
      "reachable": true,
      "sensitivity": 2,
      "sensitivitymax": 2,
      "usertest": false
    },
    "ep": 2,
    "etag": "<removed>",
    "manufacturername": "Philips",
    "modelid": "SML001",
    "name": "Landing Motion Sensor",
    "state": {
      "lastupdated": "2019-09-17T08:45:54",
      "presence": false
    },
    "swversion": "6.1.1.27575",
    "type": "ZHAPresence",
    "uniqueid": "<removed>"
  },
  1. Change the URL to http://<deconz-ip-address>:<deconz-http-port-number>/api/<api_key>/sensors/<sensor_id>/config , add the JSON payload and choose a PUT request.
{
       "sensitivity": 1,
}
  1. Verify the change has been made by making a GET request to http://<deconz-ip-address>:<deconz-http-port-number>/api/<api_key>/sensors/<sensor_id>
{
  "config": {
    "alert": "none",
    "battery": 100,
    "delay": 0,
    "ledindication": false,
    "on": true,
    "pending": [],
    "reachable": true,
    "sensitivity": 1,
    "sensitivitymax": 2,
    "usertest": false
  },
  "ep": 2,
  "etag": "<removed>",
  "manufacturername": "Philips",
  "modelid": "SML001",
  "name": "Landing Motion Sensor",
  "state": {
    "lastupdated": "2019-09-17T08:55:52",
    "presence": false
  },
  "swversion": "6.1.1.27575",
  "type": "ZHAPresence",
  "uniqueid": "<removed>"
}

I hope this helps other people on the forums.

11 Likes

HI @qlqheixs , sorry for pushing that old thread. I followed your steps but have difficulties with user rights.
My result is alwas “unauthorized user” even I used my normal credentials for Phoscon login
this is my request - what is wrong?

{
  "method": "GET",
  "transformRequest": [
    null
  ],
  "transformResponse": [
    null
  ],
  "url": "http://xxx.xxx.xxx.xx:40850/api/bbb5c510b3544e9181768c7532050b26/sensors",
  "headers": {
    "Authorization": "Basic cG9zdEBqb2VyZy1uYXVlbi5kZTpQaXJvbDYyMA==",
    "Accept": "application/json, text/plain, */*"
  },
  "data": "",
  "timeout": {}
}

What is your deconz IP adress? The normal Home Assistant IP adress? Or the IP adress seen in the Hassio add-on? And what port number is deconz when using ingress? I tried the one stated in the config file “40850”, but I get a request failed.

I am using deconz via it’s own Docker container and just expose it through a bridged network.
I know Hassio uses Docker underneath so presumably it is similar. How do you connect to the Phoscon app - perhaps use that IP address?

Using Phoscon is via Hassio ingress, but when I am in Phoscon it states the IP adress is " 172.30.33.0", but if I use that instead and then use:“http://172.30.33.0:8080/api/54678998EA/sensors then” then I still get Request failed

You can use the home assistant service like:

entity: binary_sensor.bewegung_aussen_ug
field: /config
data:
  sensitivity: 0
4 Likes

@qlqheixs, Thanks for posting this. It was hugely helpful. You may want to edit your post with the two points below.

@Morten_DK, What I did to make it work was first go to the Deconz add-on (click “Supervisor” on the left and then click Deconz on the right) and make sure that port 40850 is past through to port 40850. This is not enabled by default. Second, The IP you need is the IP of your HA server. The 172.30.33.0 is the IP for the Docker that is running the Deconz app and cannot be reached outside of the HA server itself.

Strangely, I am trying to do the same thing, but with “sensitivitymax” and getting the error below.

[
  {
    "error": {
      "address": "/sensors/23/config/sensitivitymax",
      "description": "parameter, sensitivitymax, not available",
      "type": 6
    }
  }
]

Maybe it is a readonly parameter. What else would it mean if there is also a plain sensitivity parameter?

It is posible. My value for sensitivitymax is set to “4” and in the example from @qlqheixs has it set to “2”, both with Philips motion sensors, so I was hoping that it was possible to change. I set my sensitivity to “1” and I am still getting a lot of notifications so I thought I would check into lowering the sensitivitymax, it see if that changed any thing.

Like I said above, you can simple use the services on HA

I did a bit of Googling

And I found a discussion that confirmed what I suggested above. The sensitivitymax is a readonly value that tells the software that interface to it what the range is.

And it seems Philips motion sensors has this hardcoded to 2 for the indoor version and 4 for the outdoor version.

This tells us that the sensitivy valid range is 0 to 2 for the indoor and 0 to 4 for the outdoor

is that a random example or that the actual code to use in this instance?

Just sharing another solution in case others find this topic. I still hope configuring the motion sensors connected to deconz will become possible at any time. In the meanwhile you could also use the (android) app Hue Essentials. You can link in to the deconz API and gives you easy configuration of things like motion and light sensitivity.

3 Likes

iOS app works as well,

In the configuration page for the deconz addon, put 40850 in the top network field called “40820/tcp” and restart the add on

then in the hue essentials app, add a bridge manually, select deconz and put in the IP address of your device running HA (most likely a pi, but it is whatever you’re hosting on, not the IP shown in the phoscon app) and use 40850 for the port.

once it asks you for a username and password just don’t touch it and from your computer go the phoscon app from the add ons page in HA. Open the advanced section of the gateway page and click authenticate app.

2 Likes