IKEA Motion sensor duration

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

Hello, what is the model id of this device ?

I can see something in code but perhaps not used for this one


                    else if (sensor->modelId() == QLatin1String("TRADFRI motion sensor"))
                    {
                        if (data.uinteger < 1 || data.uinteger > 60)
                        {
                            rsp.list.append(errorToMap(ERR_INVALID_VALUE, QString("/sensors/%1/config/%2").arg(id).arg(pi.key()),
                                                       QString("invalid value, %1, for parameter %2").arg(map[pi.key()].toString()).arg(pi.key())));
                            continue;
                        }
                    }

and value need to be < 60 ?

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

But your model is “TRADFRI motion sensor” ?

Set config.duration to 0 to prevent deCONZ from clearing state.presence based on that setting, using config.delay as reported by the sensor instead.

There was a guy who commented this bit out and recompiled, it worked for him

It’s this issue ? IKEA TRADFRI motion E1745 sensor duration · Issue #6336 · dresden-elektronik/deconz-rest-plugin · GitHub
So this device don’t use config/duration but config/delay instead ?

Can I just mention here you cannot set the duration to 0

Yes … But there is perhaps a comment usefull here TRADFRI motion sensor wrong timing in Deconz · Issue #1970 · dresden-elektronik/deconz-rest-plugin · GitHub

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.

Sorry, I m going on holiday in some hours, be back in 1 week.
I will give this issue to others devs, I hope one of them have the device too.

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…