This project documents the development of my own personal and lightweight IoT and automation implementation. Certain details are certain to be left out to protect the security of my household.
I needed a way to monitor the status of my driveway gate and my garage door. There are many reasons for this:
- On occasion, we would leave them open at night or during the day while we are away and we needed a way to monitor whether they were opened or closed.
- The RF range of the garage door opener, because of the way it is situated, required that we be within 20 feet of the door for it to open reliably.
- The garage door opener in our house is very slow, so because of the range issue we found ourselves always waiting for the door to open.
- The RF range of the driveway gate is also very short. The gate is also very slow. Maddingly so...
- By way of an unfortunate oversight (doh!), our new car did not come with a built-in garage door opener. So, now we've got two remotes hanging on the visor. That doesn't meet SAF (spousal acceptance factor)
- I can do better!!!
I investigated some open source/freeware home automation solutions. They all had several things in common that conflicted with my need to get out of the dog house on the car situation:
- They are somewhat mature and support many different legacy interfaces.
- They are heavyweight software. By that I mean that I couldn't get any of them to run reliably (or at all) on my minimalist Debian computer (PogoPlug).
- They are very feature rich, but also very complex. It would take me days to fully understand and at the end of the day I would still need to build and program my own hardware. Too much...
Enough! I was drowning in obscure Linux packages, a billion jar files, and thousands of pages of documentation. Not to mention my poor PogoPlug server has been brought to its knees multiple times with all the experimenting. I need something much more lightweight than this:
- A central server process that can run on my PogoPlug or Pi Zero (if I can find one)
- Why PogoPlug? Well, it's not about the PogoPlug, it's about a small, low power, zero noise, and cheap Linux server platform. Pi Zero is my next stop on the minimalist train.
- I could have done this on my BBB or my RPi but I wanted to save them for other projects.
- This is a headless affair, so the PP is perfect. It has everything I need and nothing I don't.
- My office already heats up enough in the summer. The last thing I need is yet another computer pumping heat into my office space. Yep, home office. Happy camper.
- Someone get me a Pi Zero already...seriously...
- A common and mature protocol between nodes and servers.
- MQTT popped up on my radar as a possible candidate and boy has it impressed.
- MQTT is abstract enough that I can create my own schema.
- MQTT is simple enough to run easily on the aforementioned hardware.
- MQTT libraries are available for a large number of platforms, including "maker friendly" hardware.
- MQTT is fun to say. MQTT MQTT MQTT!
- A common and mature transport mechanism.
- I didn't want to rely on an automation gateway of any kind. Using 315/433/900 MHz RF or BLE would necessitate some sort of RF to IP gateway. That just seems like a snake pit of frustration to me.
- I could run Ethernet to all my nodes, but I already did that with my security cameras and that was a major PITA. Not a chance.
- I already have WiFi, so ESP8266 looked to be a good option.
- Yep, I was right. ESP8266 really did fit the bill.
- Support for nodes in "maker friendly" hardware.
- I knew I was going to have to create my own interface hardware.
- I knew I was going to have to develop my own firmware.
- I'm not a total genius programmer. Don't get me wrong...I can do some sweet stuff, but I'm not the type to whip up a custom cross compiling toolchain. That's just not me.
- The NodeMCU 1.0 hardware turned out to hit the sweet spot.
- It's in a 0.1" pitch format where I can build a node baseboard with all my interface circuitry...