Successfully Pairing Xiaomi Motion Sensors with Zigbee2MQTT

Hey everyone, I wanted to share my recent experience with setting up Xiaomi motion sensors using Zigbee2MQTT. I’ve been really impressed with the flexibility and customization options this project offers, but I hit a bit of a snag when trying to pair my second Xiaomi Motion Sensor (RTCGQ01LM). Here’s how I navigated through it and what I learned along the way.The Challenge After successfully pairing my first sensor, the second one gave me a bit of trouble. The logs kept showing an error message indicating that the device model ID was undefined, which made it difficult to proceed. I wasn’t sure if this was a hardware issue or something related to the setup. The Process 1. Research and Preparation I started by reviewing the Zigbee2MQTT documentation and community forums to understand common pairing issues. It turned out that this error is relatively common with certain Xiaomi devices, especially if they haven’t been properly updated or configured.2. Resetting the Device I decided to reset the sensor to its factory settings. This involved holding down the button until the LED started flashing rapidly. Once reset, I tried pairing it again, but the same issue persisted.3. Updating Firmware Next, I checked if there was a firmware update available for the sensor. Fortunately, there was one, and after updating, the sensor seemed more responsive. However, the pairing issue still wasn’t resolved.4. Using a Different Method I came across a suggestion on the Zigbee2MQTT GitHub page about manually adding devices to the configuration. I followed the steps to add the sensor’s IEEE address and model ID manually. This approach worked like a charm, and the sensor paired without any further issues.5. Testing and Verification Once paired, I tested the sensor thoroughly. It detected motion accurately and sent updates to my Home Assistant setup seamlessly. The delay I initially feared was nonexistent, which was a huge relief.Key Takeaways - Documentation is Your Friend: Spend time going through the official documentation and community resources. They often have solutions to common problems.- Firmware Updates: Always check for firmware updates before troubleshooting. Sometimes, a simple update can resolve unexpected issues.- Manual Configuration: If automatic pairing doesn’t work, don’t hesitate to try manual configuration. It might save you a lot of time and frustration.Final Thoughts I’m really happy with how everything turned out. The Xiaomi Motion Sensors are now working perfectly with my Zigbee setup, and I’ve gained a better understanding of the pairing process. It’s moments like these that remind me why I love tinkering with smart home devices—they might throw curveballs, but solving them is incredibly rewarding.If anyone else is struggling with similar issues, I’d be happy to help. Just drop a comment below, and let’s troubleshoot together! :rocket: