Hi there, I am encountering unexpected behaviour when using IKEA E1745 motion sensor with Deconz
I have all the sensors in the same room for testing below in screenshot
Motion sensor 1, Drax Room Motion sensor 1, Kitchen Sensor 2 are connected to HA via Deconz
Motion Sensor Test occupancy is connected to HA via zigbee2mttt
Because there is a 60 sec for duration defined and cooldown period for sensor to 90sec, sensors goes to OFF state. Resulting sensor going ON-OFF-ON-OFF where it should actually be constant ON. That creates issues when building automation in HA.
zigbee2mqtt has already 90sec for the duration to match the delay, so there is a constant ON state whilst there is a motion
What I have tried is to set the duration to more than 60 sec or to 0.
As suggested setting config.duration to 0 would match the duration to delay which should solve the issue but I get an error “invalid value, 0, for parameter duration” when setting via rest or HA
Its IKEA E1745 motion sensor. Yes that is the code for this sensor. There was a guy who commented this bit out and recompiled, it worked for him… I unfortunately do not know how to recompile etc…and would rather have it changed and updated from Deconz guys side. Before I suppose you could set it to 0 and sort this out but not it will throw an error as evident in the code
Hi Samanar,
yes, my model is a TRADFRI motion sensor. Yes, that is the issue that I created on GitHub.
That comment is not helpful. Whilst it might be for him setting config.duration to 1 makes things worse and sets the sensor from ON to OFF state after 1 sec and then you have the delay.
Thanks Smanar, I can test for sure… For some reason, I suppose setting config.duration to 0 was taken out at some point, if we can set to match the duration to the delay that would solve this issue…
And if I m understand we need to disable config/duration to use config/delay instead, no ?
So if it’s that, the correctif is easy, we just need to remove config/duration in the device json.
Do you know how to use DDF ? DDF cheat sheet · dresden-elektronik/deconz-rest-plugin Wiki · GitHub
Will be nice If you can share me the “actual automatic DDF”, less work for me to edit it.
In deconz, select the node, then take “edit DDF” and share to me the last tab “preview”.
Else you can to just remove it yourself from the DDF (with selecting it and press delete) then save the DDF, and make “hot reload”.
Hi Smanar, here is the Preview tab from DDF Editor. As I see it, the duration time should match the delay time. Otherwise, the sensor will go to off state before the delay in the sensor runs out.
Ok I have found the code part, and you need to state/dark. And from the code, you need to have them added in the device json by the code, idk why you don’t have them …
I discovered that after upgrading to 2.19.1 deCONZ failed to recognize the IKEA Motion sensor delay entity:
[OBS Bad in Norwegian means bathroom]
This occurred for all my IKEA motion sensors. It is a very important setting as it can be used to overcome the 3min default delay in these sensors, which is way too short.
However, after activating the sensors (moving around in front of them), until they triggered, and then reload the deCONZ integration, everything came back to normal again.
At first I thought that the upgrade to 2.19.01 broke this entity. The error message from HA suggests that. I’ve never experienced anything like this before.
HI Smanar, I have changed DDF and added config/delay and state/dark. Would that change anything by itself or do we need to do more to solve this delay issue? Sensor still behaves as it was before, see below. Kitchen sensor 2 is the same model but connected via Zigbee2Mqtt.
Yes, and it will include it only with data on the DDF, so you will be sure the issue is not from the previous inclusion with legacy code.
To be sure you can take a look on the API (for exemple on phoscon/help/API Information/Sesnsors) you need to have in the JSON “state/dark” and no “state/duration”.
From ebaauw
The Trådfri motion sensors do not send anything when motion is no longer detected. When they detect motion, they send an On with Timed Off command to the associated group. The REST API plugin eavesdrops on this command, and sets state.presence on the sensor resource to true. It also sets config.delay to the time specified in the command: between 1 and 10 minutes for the old model (depending on the dial setting), and 3 minutes for the new model. The sensor will not register new motion, until shortly before this time has passed. The REST API plugin sets state.presence to false automatically, config.duration seconds after it set state.presence to true. I think config.duration is initialised to 60, leading to two minutes in the dark for the new model. Set config.duration to 0 and the REST API plugin will use config.delay instead, making sure state.presence is set to false at the same moment the lights in the associated group turn off automatically.
And for the solution part
All deCONZ does is reset state.presence to false automatically, config.duration seconds after the sensor has reported motion. This is because the sensor does not report when it no longer detects motion. You need to align config.duration to the sensor’s interval. This is done by a PUT to the sensor’s config with a body of {"duration": 0} (to use config.delay) or "{"duration": 180} (for three minutes).
Problem the API don’t permit value 0 or > 60.
Someone have perhaps a solution using DDF too, but making the reverse of me, I remove duration, and him add it with a fixed value
If I have understand the code, if the device haven’t config/duration, it use delay value.
Edit:
Ok So I m wrong, on this part delay is a return from the zigbee request, not something you can set. And you can put the value you want, this code update the value you set with the value in the zigbee request.
I don’t understand, config/delay is totaly useless for this device ?
Edit 2:
So forget all I have said before, the only way I m seing to make this device working is using duration, and with a bigger value.