Fully Programmable Garage Door Keypade w/ ESPHome and Node-Red

Also posted on r/HomeAssistant

TL;DR I built and programmed a garage door keypad that is fully controllable and programable in HA/Node-Red

Ever since I purchased an August lock a few years ago, I’ve been interested in their Smart Keypad. I like the idea of being able to program different codes for different individuals and program temporary and expiring codes for one time use. My “dumb” garage door keypad has the ability to program temporary codes based on time and usage, but it must be done at the keypad. I haven’t been able to find any HA compatible keypads that are not already part of a security system, and I havent seen anyone who has successfully done this before.

I’ve already automated the garage door opener with a Sonoff SV, and I have also already added a Grow Fingerprint Sensor to open the door with a fingerprint. However, i wanted to ditch the “dumb” keypad in favor of one that I could program with ESPHome and Node-Red.

Materials

  • 4x3 Keypad - These are all over amazon and ebay, with varying reviews. I bought direct from Adafruit.
  • ESP board of choice, i went with a ES8622 NodeMCU that i am familiar with
  • Lots of jumper wires
  • solder, soldering iron and header pins
  • SX1509 I/O Expander This device takes the inputs from the keypad and translates them for the ESP.

You may also need some sort of enclosure. I chose a single gang electrical box, and a exterior cover. I had to modify the aluminum cover to fit the keypad, as well as 3d print a small filler piece.

Wiring diagram for Keypad/SX1509/NodeMCU - Note, the SX1509 and NodeMCU communicate via I2C, so you must use the SDA/SCL pins on the NodeMCU. This may vary on different boards (i.e. D1Mini).

ESPHome Configuration: posted on pastebin to save space in this post

This configuration will bring each button on the keypad into HA as a binary sensor.

Next, i created an input_text helper called input_text.keypad_code. This will be updated by Node-Red whenever a key is pressed.

Node-Red configurations

  • input_text updater - This piece waits for any keypad number to be pressed, grabs the current input_text.keypad_code, joins the button that was pressed, and updates the input_text.keypad_code
  • asterisk closes door - Asterisk flow checks door status, and if it is OPEN, fires a Close door service. It also clears the input_text.keypad_code.
  • # runs code check - This flow probably looks a little confusing because it is doing a few things at the same time.
    • first it grabs the input_text.keypad_code, and makes sure that it is NOT BLANK.
    • it simultaneously runs the entered code through the “code bank” as well as the “temporary code”.
    • It checks the entered code against the saved “temporary code” and then checks if the “temporary code” is activated, if so. It drops the temporary code counter by 1 and continues.
    • It also runs the entered code thru a switch node with the saved codes. Depending on which code matches, a change node adds the code owners name to the payload for use later.
    • In either case, before opening the door, it checks to see if the house alarm is set, this is just for security purposes.
    • If all conditions are met the following happens.
      • Open Garage door
      • Send a service call to the fingerprint sensor to pulse blue, showing that the code was accepted
      • Use the name in the payload to drop a timestamp in a log file
      • Use the name in the payload to update an MQTT sensor with last triggered

The whole project took about a week from conception to installation. Hope this helps anyone who was looking to do something similar. Feel free to ask any questions!! Yes, i realize that the codes are all stored in plain text in Node-Red. If someone has access to my Node-Red instance, they also have access to Home Assistant, and can just open the door from there.

More Photos of the process:

4 Likes

This is nice, but (personally) I wish people would stop using Node Red. PS this is not an excuse for another NR/HA thread. I just prefer one over the other, not a criticism at all.

I really don’t think I cold recreate the same detailed automations in the base HA automation engine. I’m curious why you want people to stop using NR. I use both NR and HA built in automations for different tasks.

Well I don’t like NR so every time I see some NR automations it turns me off. Just a personal view. Let’s not start that thread though. I’d be far better implementing this in HA and posting my alternative :slight_smile:

You did yourself… I love NR!

Hi, could i still add fingerprint reader to the same esp8266 board for the keypad?
I’m planning to get kwikset convert, and build keypad with fingerprint reader to lock/unlock it.

There should be enough gpios left.

@mdezzi Cool project. I’m trying to solve the same problem. I hadn’t heard of August - it seems like their premade lock & keypad could be integrated relatively easily with HA.

Question: Why did you build your own? Did you figure out that August couldn’t work? Or did you want a cheaper or homemade solution? (I’m not a hardware guy, so I’d rather stick with off the shelf hardware if I can.)

the august keypad is specifically for their august deadbolt lock. I needed a programmable keyboard for my garage door, so i decided to make one myself.

Oh, drat.

It’s amazing to me that an open zWave or wifi garage controller with keypad doesn’t exist. Oh well.

Thanks for the response.