Garage door status sensors ideas

Hi guys, Happy New Year!

I’m working on building a garage door opener. I’m trying to find a sensor to detect if the garage door is open or closed. I don’t want to use a reed switch as I want it to be wireless.

Any ideas of what sensors I could use to detect the status of the garage door?

I looked at a tilt sensor but it doesn’t help with 90 degree angles, it detects 0 and 180 degrees.

Thanks!

What about a wireless reed switch? Could buy a 433mhz reed switch and capture its status with a receiver on the micro controller side.

I’m not sure what garage door you have but most are vertical when closed. That would be 0 degrees. and open would be 90. Most detect they are closed and any other tilt is not closed. 180 would be the exception because the sensor would be upside down?

If that is still perplexing, ultrasonic sensors would be what you would want.Check out https://opengarage.io/ That sounds exactly like what you are looking for.

Wait, tilt sensor only detects 0 and 180 degrees? I bought the Monoprice Z-Wave garage door (tilt) sensor and that detects 0 and 90 degrees. It works for me, but there was one time when it incorrectly reported the status.

I bought this one:

It works great.

I haven’t used them but they definitely look like a robust solution. Not only will it give you status, but control via HA.

I used an ultrasonic range sensor like this: https://www.sparkfun.com/products/13959
It’s mounted on the ceiling of the garage such that when the door is open the range is about 30cm, and when it is closed it’s about 150cm. I can also determine the presence of the car with this same sensor.

I also have a reed switch in place, but the range sensor would be sufficient.

Why do you need wireless? A cheap nodeMCU hooked up to the same mains power as the garage door opener means you never need to replace batteries. I just ran 20ft of cheap 22 gauge wire nailed to the garage ceiling to a reed switch and it works fine. I’d take that over a battery operated sensor any day.

Although, I’m liking the idea of a ultrasonic sensor. If setup right I could just measure how far open/closed the garage door is… Maybe it is time for an upgrade.

There are Z-Wave tilt sensors for garage doors, though I’m just using normal door/window sensors. You can have one for the open position, one for the closed position, and then if both are off you know the door is between open and closed.

I use a standard door sensor for mine. Hasn’t failed me yet.

This is a great idea, thanks!

Old thread but I just did this project after ‘threatening’ to do it for half a year. I used the cheapest components. HC-SR04 ultrasonic sensors. When I was shopping, I thought, WTH? I can get 5 for less than $5? I’m in! I recommend getting at least double the # of sensors you expect to need for any project when ordering from china if not cost prohibitive.

So like treno suggested, a sensor on the ceiling that becomes obstructed with the door open (reporting ~20cm in my garage b/c of high ceiling and high lift doors). With a car it reports around 180cm which is the upper limit of reliable for this cheapo sensor, and since longer echos were really unreliable in my case due to distance, I just call those timed out with a reported distance of ‘0’.

Some critical tips. For the ESP, use the newping library. These sensors are very prone to spurious readings. When I was doing the old “Sean Connery - One Ping Only”, the distances were all over and even a lowpass and moving average didn’t help. But with the 10 ping median algorithm, spurious echos are almost gone.
gd
I have HA reporting 3 states, “Open”, “Closed with Car” and “Closed Empty” using templating. During the trial, I’m recording the distance data but that will only be for troubleshooting.

Shortcomings:

  • It doesn’t sense if the door is a little open.
  • Doesn’t do any angular sensing like suggestions above.

You could implement these features if you wanted with a second sensor. My beef with the reed switches was that you’d need a lot if you wanted various positions reported. They are great for “door is in position X or Y”. I considered using a combination of a reeds triggering the sono, but decided to KISS, keep it simple.

2 Likes

Hi @jumblies,
I’m assuming you using MQTT to report these states?
How did you set up your HA to do this (which is effectively a 3 state sensor / switch / whatever)

Care to share your “template”? I know I should probably just go read up on it… but your input will go a long way I’m sure

Thanks

It required a two step template. One for the MQTT data, and I watched and graphed that data for about a week to make sure it was reliable, then a template sensor that is trinary with a 0 distance (exceeding the range of the sensor b/c my garage has 14ft ceilings). With the newping library any echo that isn’t returned is given a distance of 0.

Honestly, if I were to do it again, I’d use 2 bare esp8266-12e/f (2 wemos d1 would work but have vampire drain) tied to power and run tasmota on both of them. The telemetry and management facilities in tasmota are outstanding and far exceed my code.

  - platform: mqtt
    name: "Door Dist"
    state_topic: "GarDrSens"
    unit_of_measurement: "cm"
  - platform: template
    sensors:
      garage:
        friendly_name: Door State
        value_template: >-
          {% if states.sensor.door_dist.state | int == 0 %}
          Closed Empty
          {% elif (states.sensor.door_dist.state | int > 10) and (states.sensor.door_dist.state | int < 30) %}
          Open
          {% elif (states.sensor.door_dist.state | int > 60) and (states.sensor._door_dist.state | int <250) %}
          Closed with car
          {% else %} 
          Closed
          {% endif %}

Perfect.
Thanks @jumblies. The template part is what I was after.

Thanks man

How did you get this to pair to ZWave? I have this same one and can’t get zwave to recognize it. I have excluded it from the Wink Hub2 it was on and trying to include it to my HA with the GoControl ZWave / Zigbee USB stick

Honestly, it’s been so long I don’t remember. But it was one of the first wave devices I got and if I had any problems I would have remembered them.

Just like with the linear zwave garage door opener I tried before I moved to this system I remember that I had all kinds of troubles getting it to pair and never could do it. So I gave up on it and went this route.

From what I remember it was fairly straight forward.

Sorry I can’t help more.

Corey, I have the same device but cant get it to pair? Do you remember how you did it?

I found the instructions. If that isn’t working I would try to exclude it and re-pair (if you have not already). I had an issue with the switch I was using and replaced the whole setup with an ESP getup.

IF you going for the KISS methology then hard wiring something like a reed switch seems way to start. Still use the ultrasonic sensors for object detection.
Point of the garage door opener is to open and close it, We sometimes want to overcomplicate things.
I have a garage door magnetic reed switch, made for commericial use connected to a Sonoff SV running Tasmota it has been rock solid at determine door status. I’m not worried whats in it or how open the door is if I’m at work, just needs to be closed unless someong else is home.

Rest of the stuff is triggers for automation. If door is not closed and ultrasonic sensor detects no objects, alert to close garage if no one is home…etc…That doesn’t have to be done