15
submitted 1 year ago* (last edited 1 year ago) by DeltaTangoLima@reddrefuge.com to c/homeassistant@lemmy.world

Hi all - I have a sectional garage door, that I'm currently automating with a relay to trigger button press on the garage door motor, and a simple reed switch for open/closed state, using esphome on a Wemos D1 mini.

Lately, I've been thinking about finding/building a door position sensor, instead of the reed switch.

If I had position data being sent reliably, I could very easily determine if the door is opening, as well as open/close state. I have a number of automations in mind that would benefit from such data.

So far, my searches for "garage door position sensor", and variations thereof, aren't bearing much fruit. I've been pondering of couple of home-brewed approaches:

  1. A series of reed switches on a track that a magnet on the door will trip as it moves along.

    I guess it's theoretically doable, but they'd have to be sensitive enough to be tripped by a moving magnet, but not so sensitive that too many of them are tripped at the same time, which might confuse my "moving mathematics" to determine door movement direction.

     

  2. An ultrasonic sensor could possibly do the job.

    I'm mulling over exact placement of it so it has a reliable surface to reflect off, to give me an accurate read on position. Nothing (yet) comes to mind on that front.

It's not that I wouldn't enjoy going down the very enjoyable rabbit hole of prototyping something, but I thought I'd just ask first.

Is anyone aware of an off-the shelf sensor that might give me what I'm looking for, please? If it needs something beefier than an ESP board, I've got a couple of RasPis lying around doing nothing.

Cheers in advance for any suggestions.

top 13 comments
sorted by: hot top controversial new old

If you have access to any of the rotating parts a hall effect rotary encoder could do what you need. Stick a magnet to the rotating axle of the motor, the sensor next to it and you can encode the position of your door exactly.

[-] DeltaTangoLima@reddrefuge.com 4 points 1 year ago* (last edited 1 year ago)

Lol - you read my mind! I literally just went into my garage and took some photos of the door, and realised the axle is sticking out the perfect amount, in front of my plywood tool board.

A hall effect sensor is exactly what I'm going to look into. Cheers!

[-] sxan@midwest.social 6 points 1 year ago

It sounds as if you're interested in the extreme DIY, but: my solution was to buy cheap ZWave tilt sensors.

[-] jefff@lemmy.world 3 points 1 year ago

I've been thinking about this recently too!

I kind of have a very crude version of this, by simply mounting my garage door tilt sensor as high up on the door as I could. Since it would go horizontal along with the very first section of the door, it triggers as soon as the door is open about 1/5 of the way.

Response isn't very fast, though, so if I wanted more precise control I was thinking about building 3 ESP distance/ultrasonic sensors mounted to the ceiling pointed downwards, one at the end of the track, one about 1/4 of the way from the end of the track, and one at the start (where the top of the door stops when it's completely open).

So the sensors would detect in order of sensors triggered, "closed -> cracked -> slightly open/ing -> open".

Tracking the previous state of the door in a variable would let me know the direction the door is moving as the sensors get triggered too.

[-] DeltaTangoLima@reddrefuge.com 2 points 1 year ago

That's sorta where I was thinking with the ultrasonic sensor, but the other comment here has me thinking about a hall effect sensor now.

[-] jefff@lemmy.world 2 points 1 year ago

Cool, I've never used hall effect sensors but I'll look into them too. Let us know how it works 😁

[-] cedeho@feddit.de 2 points 1 year ago

I installed an ultrasonic Sensor at the lowest segment of the garage door. It mostly does it's job, though it is unreliable when the door is fully open, as the sensor tilts towards the open end and the distance is then too long. Also someone standing in the opening might block the sensor.

[-] DeltaTangoLima@reddrefuge.com 1 points 1 year ago

Yeah - this is the part I was trying to puzzle through. I guess you could combine it with a tilt sensor so, when tilted past a certain point, ignore the reading in HA and use that to determine the door is open.

[-] cedeho@feddit.de 1 points 1 year ago

To be honest having an information about the actual percentage state of opening is actually useless anyway. I just need the information if it's properly closed which could be achieved with a simple reed relay.

Having the sensor on the moving parts also comes with other challenges anyway. I used a cheap curly telephone cord to connect the sensor to the ESP8266 but it's actually already worn out and thus hanging low when the door is open, as the normal state is that it is extended when the door closed

Out of curiosity: what would be an automation that would benefit from knowing if it's opening or closing?

I'm quite happy with this: https://opensprinkler.com/product/opengarage/ It doesn't know whether the door is opening but has the benefit of knowing whether or not the car is in the garage when then door is closed.

[-] DeltaTangoLima@reddrefuge.com 1 points 1 year ago

It's probably more that I'd benefit from knowing the position of the door - my garage gets stupid hot in summer (where my server rack is) and simply cracking it open a couple of inches and turning on a oscillating fan makes the world of difference in there.

Re the opening/closing thing, I could use some simple calcs to determine that based on change in position data, and then do some fancy animations on my HA panel. Just because. :D

[-] qupada@kbin.social 1 points 1 year ago

It's a shame that even "cheap" versions are hundreds of dollars, because the perfect absolute position sensor would be a "draw wire displacement sensor" (goes by a few variations on that name).

https://appmeas.co.uk/products/draw-wire-position-sensors/compact-long-range-draw-wire-displacement-sensor-low-cost-mk120/

Basically a spring-loaded spool of wire with a multi-turn position sensor, rolls in and out like a tape measure.

[-] nukeworker10@lemmy.world 1 points 1 year ago

I had one of those for a couple years. I replaced it with a yolink garage door controller as I was trying to get everything into one ecosystem. Pretty happy with it so far.

this post was submitted on 07 Sep 2023
15 points (94.1% liked)

homeassistant

11921 readers
17 users here now

Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. Available for free at home-assistant.io

founded 1 year ago
MODERATORS