Zigbee Deadbolt Sensors

So my wife and I just bought a new house a few months ago and I’ve completely fallen into the ever-expanding abyss of IoT and Smart Home devices. We lovingly describe our home as “IoT-core”. As of this post our Home Assistant environment includes 24 automations, a combined 41 lights and switches, and 236 sensor entities. What began as a hobby to find what could be automated has quickly become a quest to find anything that can’t be automated.

While I would love to create a post for every project I’ve worked on recently (and I hope to write about at least a few more) I’m just going to focus on one for now–deadbolt position sensors. While monitoring the state of doors and windows is trivial with off-the-shelf sensors from Ring, Aqara, and others, I couldn’t find a simple way to know if a door was locked without installing expensive smart locks. Fortuitously, the aforementioned window sensors are actually a fairly elegant solution to this problem as well.

Enter the Universal Electronics XHS2-UE, aka the Xfinity MCT-350 from Comcast.

XHS2-UE, often sold as MCT-350

This door sensor is perfect for this project. They are low-cost (a pack of 10 on eBay goes for about $45), small, low-power, and use Zigbee for communications.

“But wait, how does a door sensor work with a deadbolt?”

Not in a way that may be immediately obvious. Door sensors like these work by using a reed switch in the main body, and a magnet in the smaller shell. When the magnet is near the reed switch, the switch is closed. When the magnet moves away, the switch opens. The cool part is, you can remove the reed switch completely and replace it with nearly any type of switch you want! This works well for this project because we can replace the magnetic reed switch with a simple mechanical switch and install it in the lock body of the deadbolt that will be triggered when the bolt is engaged.

It should make more sense explained with the images below:

I began by opening a switch to get to the hardware inside. They are fairly simple to open. The cover protecting the battery just slides off and the CR2450 cell inside can be removed. A spudger or scraper can be used to pry the two halves of the case apart, they’re just held together by a few clips.

Inner electronics with reed switch exposed.

Thankfully these sensors aren’t too complicated inside. There’s a small tamper notification switch on one side and the reed switch on the other. It can easily be de-soldered and replaced.

I swapped the reed switch for two short lengths of wire and passed them through the side of the sensor case by burning a small hole with my soldering iron (don’t inhale fumes!). To the opposite ends of the wires I attached a microswitch in the Normally Open (NO) position. Now when the switch is pressed, the sensor reads as “closed”.

Switch installed with 3D printed arm

I removed the indoor half of the lock assembly and positioned the switch inside with some hot glue. I needed a way to press the switch more reliably when the lock was turned, so I designed a small 3D printed arm that fit over the shaft. This could easily be replaced with a small piece of metal or plastic that is glued on. The odd shape is to keep the arm out of the way of the bolts that go through the lock when fully assembled.

The finished sensor installed

The end result is inexpensive, reliable, and reasonably unobtrusive. I connect all of my Zigbee sensors to Home Assistant using the excellent Zigbee2MQTT integration. These sensors have all paired without issue and seem to work well. I’ve now created a few automations that will notify our phones if any doors are unlocked before going to bed, or leaving the house. I don’t have much data on battery life yet, and the batteries these sensors come with are fairly hit or miss from what I’ve seen so far. At some point I’ll replace them all with known fresh batteries for comparison.

Sensors as they appear in Home Assistant

One additional note: I originally tried to fit the entire sensor inside the lock by disassembling it completely, but ran into an issue where it couldn’t connect to the Zigbee network after the lock was reassembled. Who knew wireless devices didn’t work well when fully enclosed by metal?

That’s it! Each sensor ended up being about $4.50 to build and–not counting the few hours of test fitting and re-printing parts for the first lock–only a few minutes to install. Thanks for reading!

Comments

One response to “Zigbee Deadbolt Sensors”

  1. pierrotsc Avatar

    Very cool and ingenious

Leave a Reply

Your email address will not be published. Required fields are marked *