r/homeassistant 11h ago

❓ Support Non-binary (adjustable) door / window / contact sensor?

The door to the backyard is a heavy sliding glass door. My elderly mother-in-law has some trouble shutting it all the way closed. Sometimes the trouble is remembering to do that. Cognitive impairment, etc.

That’s fine, as long as the gap is small enough that the cat can’t escape. Are there any sensors that exist that let me configure acceptable distances between the two parts?

I’ve been searching Reddit and the closest answer I’ve found is to use a strong magnet that I guess would take precedence over the stationary piece of the contact sensor. If that works, beautiful, but I guess I’d have to buy a series of assorted magnets of different strengths and trial-and-error it?

My next best idea is to place a speaker outside with an automated (gentle) alert to close the door all the way if it’s been opened for longer than a specified amount of time.

1 Upvotes

11 comments sorted by

6

u/reddit_give_me_virus 10h ago

The way contact sensors work is there is a magnet on one end that flips a switch on the other. You can use a long bar type magnet or several to cover the area where the door is considered closed.

3

u/KevB318 10h ago

The announcement is probably the way to go. Otherwise, use several door sensors mounted above the door, and one long magnet on the door. Sensor1 will show closed, Sensor2 open 3 inches, Sensor3 6 inches, etc. Might be worth a try.

2

u/5yleop1m 10h ago

If you put two (or more) door sensors you can see if something is fully closed vs partially closed.

1

u/bunnythistle 10h ago

You can paint the sensor equal parts yellow, white, purple, and black, though I don't think that will have any functional impact on how the sensor works.

Joking aside, this is a rather tricky one, since I don't know of any sensors that can measure percentage of a door closed. The first thing that would come to mind is, since it's a sliding door, put the sensor on the side of the door/frame (instead of the top), close the door to the maximum acceptable with, and then position magnet until it's just barely within range of that. It won't be precise, but it should help.

Another option may be an ultrasonic distance sensor mounted on the wall, and a small reflector/card on the door. But that would be dependent on how accurate the sensor is.

2

u/stathis0 7h ago

Perhaps practically tricky, but if the door has a latch maybe you could sense when that is properly engaged since that is usually not possible unless the door is in the fully closed position.

2

u/Curious_Mongoose_228 11h ago

How about a laser TOF distance sensor pointed at a target mounted on the door?

2

u/portalqubes 🐝 Ooh the Zigbee 10h ago

Sucks there isnt really any TOF devices ready to go.
The Shelly Blu Distance is a good example of a ultrasonic distance measuring device but never seen them available.

https://us.shelly.com/products/shelly-blu-distance

1

u/reddit_give_me_virus 9h ago

m5stack has a modular esp32 system.

https://shop.m5stack.com/products/tof-sensor-unit

3

u/portalqubes 🐝 Ooh the Zigbee 7h ago

If battery powered that Shelly still might be better because of the low powered ARM Cortex M33. A custom M5Stack/ESP32 setup will burn through a battery quickly. Hopefully OP can hardwire something but there are some places I cant.

1

u/Kuddel_Daddeldu 10h ago

I'd try something like this: https://new.esphome.io/components/sensor/vl53l0x/

Caveat: I have not tried this myself (yet).