Ideas for backyard door lock sensor

Hey folks, I’m trying to find a way to monitor whether my backyard door is locked. It is a step lock (amazon link), like this:


Do you have any recommendations on what type of sensors I should look at? All surfaces are relatively small, so I couldn’t really find a solution, even looking at reed switches available. Should I look into some sort of beams (instead of magnets) that would be blocked by the lower metal part when it’s locked?

Any help is appreciated! And happy new year!

Never seen a lock like that, so difficult to give best suggestion. Probably the easiest way is battery operated (magnetic) door/window sensor on top of the piston.

Thanks for your suggestion. I thought about this, but there are some issues: the piston’s head is about 3/4 inches, and I didn’t find anything even close to that (for example, Sonoff’s sensor is 1 1/4 long). Besides that, having something on top of the piston might make it hard to use the lock, since you are supposed to push down with your feet to lock the door.

I edited the original post with the Amazon’s listing and measurements.

Two ideas:

  1. Set up a microswitch below the step-on part that’s fixed to the door and which is pushed in when the piston comes out; it looks like there’s a few mm of space between the piston and the frame.

  2. Set up one wire on either side of the bottom of the step-on part so that a circuit will be closed when the piston comes out.

Both approaches will need a battery-powered sensor (like this Aqara MCCGQ11LM control via MQTT | Zigbee2MQTT might just be small enough) where you replace the Reed switch with one of the mechanisms above.

The last post in this thread describes how to replace the Reed switch in the Aqara sensor:
How I made my dumb locks a little smarter! - Share your Projects! - Home Assistant Community

And there are a few other ‘food for thought’-like items earlier in the thread as well.

Rather than trying to attach 1 or multiple sensors to get the door state, why not just replace that manual lock with an electric one? Then you can lock/unlock it from HA and see whether its locked/unlocked for its state. Electric locks to have a drawback obviously… during a power outage it will Unlock itself because atleast these type, they need a constant source of power to hold it in the Lock position and no power, no locking. They may make “latching/locking” styles that dont require that constant power source because, when it goes to Lock position, there’s a mechanism that holds it there without needing power and wont unlock untill you toggle power to it a second time.

That makes more sense to me personally, but its up to you. If you go with sensors you cold use a microswitch.

You could glue a round magnet on top of the cylinder and then use a reed switch above it so when its unlocked, the magnet is almost touching the reed sensor.

A better option may be to use something like an IR sensor with a laser to make a break beam sensor and install it towards the bottom so that when the cylinder closes/locks the beam is broken and you can know for sure the door is locked instead of the other options that only verify an unlocked state because the other 2 sensors will show locked before the cylinder moves all the way down and you could get false states if for some reason someone failed to push it down completely and instead it was in the middle which those sensors cant tell the difference between stuck in the middle and fully locked, because they only detect when its fully unlocked and assume the Locked state.

This is a 1 piece sensor setup.

This is a 2 piece transmitter and sensor setup.

Here is a cool “people counter” project that uses the IR break beam sensor in doorways to count people as they come and go. I highly recommend atleast checking it out and even his other projects. Hes a pretty well known contributor and has some cool projects if your the DIY type.

2 Likes

Can the door except deadbolt style lock? If so you could add off the shelf smart lock.

My Shelly door sensor for example is only 7mm thick, I think it would fit there without disturbing the use.
For the piston you can use a small normal disk magnet instead of the rectangular “stock one”.
image

image

1 Like

Could the steel bolt make contact with something like this at the bottom when it is locked if there is space to mount it at the bottom?

E.g the bottom of the bolt bridges two contacts.

You could also look into various microswitches/buttons.

“Surface Mount Spring Contacts” also brings up some interesting options.

I wouldn’t be looking at ESPHome solutions for this BTW. I would be looking for low power battery solutions (hacking zigbee reed switches etc)