Ikea Trafdri Motion Sensor + Zigbee2MQTT - entity not behaving as expected

Hi all,

I am using an ikea Trafdri Motion Sensor (latest model) home assistant core + Zigbee2MQTT + nodered with a conbee ii stick.

In nodered I can put in an mqtt node and see messages from the motion sensor.

In home assistant I can also see a binary sensor for the motion device.

I have a few issues at present:

  1. When using the binary sensor (via the event state node in node red) I can see that the sensor turns “on” when motion is detected. However, after 2 minutes my light turns off and then a few seconds later comes back on again. It looks like the sensor fires a message to say there is no more motion. What is weird is that the even state node fires out both and on and off in rapid succession.

  2. The binary sensor says it is active for a long while. When I watch the mqtt traffic, I can see the IKEA sensor is back in action after 90 seconds. This means I can’t prolong the time the lights are on for if people are in front of the sensor. Is there a way to alter the timeout for the binary sensor? The devices were automatically setup by Zigbee2MQTT so I’m not sure where to edit.

  3. The sensor randomly fires events e.g.:

{"linkquality":81,"occupancy":false,"requested_brightness_level":254,"requested_brightness_percent":100,"update":{"state":"idle"},"update_available":false}"

and to this, the sensor in home assistant responds with:

{"topic":"binary_sensor.motion1_occupancy","payload":"on","data":{"entity_id":"binary_sensor.motion1_occupancy","old_state":{"entity_id":"binary_sensor.motion1_occupancy","state":"on","attributes":{"linkquality":81,"occupancy":true,"requested_brightness_level":254,"requested_brightness_percent":100,"update":{"state":"idle"},"update_available":false,"friendly_name":"motion1_occupancy","device_class":"motion"},"last_changed":"2020-12-23T20:30:54.866393+00:00","last_updated":"2020-12-23T20:30:54.866393+00:00","context":{"id":"a76152ee3df3e6fa4c6c789928c9370b","parent_id":null,"user_id":null},"original_state":"on"},"new_state":{"entity_id":"binary_sensor.motion1_occupancy","state":"on","attributes":{"linkquality":81,"occupancy":false,"requested_brightness_level":254,"requested_brightness_percent":100,"update":{"state":"idle"},"update_available":false,"friendly_name":"motion1_occupancy","device_class":"motion"},"last_changed":"2020-12-23T20:30:54.866393+00:00","last_updated":"2020-12-23T20:37:20.393108+00:00","context":{"id":"97496529168df288cbe3c7547a232642","parent_id":null,"user_id":null},"original_state":"on","timeSinceChangedMs":385656}},"_msgid":"22a9b020.cf6cf"}

Would appreciate your thoughts and guidance. Thanks,
C

I can’t answer the first one, but I use 2 of them, with just Zigbee2MQTT and HA MQTT self-discovery and they seem to work fine.

For the second one, the IKEA motions sensors have a 3 minute recycle time, and stay ‘occupied’ during that time. During this period they do not sense motion, and they do this for battery conservation.

If you want something faster, you need to use Hue motion sensors, these have a recycle time of about 20 seconds; I’ve yet to see what the battery life is like yet as I’ve only had them a month. They are generally much more sensitive but they are twice the price.

I’m pretty sure I am seeing the IKEA device sense motion and fire an event after 90seconds.

You’re right that after 3 mins it does fire an message to say all clear. I just set it up with a trigger node that waits for 2 mins and resets if there are any further messages from the sensor. This stops the lights going off while people are standing in front of the sensor and moving.

Can you post your flow please? I am interesting in the ‘reset’ bit.