Keypad Controller

A problem I faced after moving into this house, was the back garage door that leads to the garden.  The door has a motor, but there is no remote, only a button inside the garage.  Everytime I needed something in the garage while I was in the garden, I would need to walk through the house and to the garage to open the door and then back into the garden.

This problem can not be solved with a remote since that would mean I need to carry a remote around with me when I go into the garden.
A more elegant approach I feel is using a keypad and defining my own pin/pass codes to gain entry and even control other items.

Although you can buy these keypads for a couple bucks online, I managed to recyle one from the guts of an old airtime and data vending machine.  These are 4x4 matrix keypads, but also available in 3x4 layout as well.

Wiring the keypad up to a Node MCU and using some custom written firmware again, I managed to create my own keyless, cardless and remoteless access to the house.  Using an old Ipod box as a housing to mount the keypad into worked out perfect.  To add some nice user feedback I also added a piezo buzzer that can play any musical tone based on the code you right.  Coding a success or error tone, cancel tone or just normal button press tones for some user feedback when pressing keys.

Again using MQTT punching in a pin code there are certain validations done on the keypad level, but validating the code you put in will be done in openHAB.
This allows me to create as many pin codes as I like, in my usecase, I have codes to open the garage doors, to activate the irrigation, to topup the pool with water, to control the garden fountain pump and even the swimming pool pump

I understand there is some risk to having this keypad out side.  I could pretty easily do a random generated pincode and have that sent to my phone, but that is overkill, but it would work if this was for a front gate and say a garden service or security company needed access, these codes could be sent to them on a weekly bases.  I my case, when my home system detects we are not home the keypad disables as well as at night the keypad automatically disables, and again automatically enables in the morning again.  Should the keypad be fidled with and codes entered, I would be alerted of this on my phone, and multiple incorrect attemps can disable the keypad as well.

A simple way to control how these codes are used would be as the below example

switch(code){
	case "123456": {
		//open/close a door
	}
	case "654321" : {
		//Control swimming pool pump
	}
		...
	default:{
		//Add some default behaviour here
	}
}
       


That is pretty much it for this one.  From the hardware this one is simple just 3 things, keypad, NodeMCU and Buzzer, I guess some wire as well of course.  As for opening the doors, this device sends info to openHAB which validates, and then openHAB will tell another controller in the garage to open or close the correct door.  Also based on time of day, when the doors open or close the garage light will also be instructed to come on or switch off.
Endless possibilities