I'm getting a bit ahead of myself here, but I've devoted pretty much all day today to working on this project. Figured I'd pseudo-multitask: work on one area until I hit a roadblock, then attach another path; rinse-repeat, and eventually round-robin my way back to addressing each roadblock w/ a fresh sense of perspective.
So... here's one from "Phase 2"...
Texting via SMS
In Phase 2, I stated that I wanted the garage door to send me a Short Message Service (SMS) notification anytime the state of the garage door changes. Another thought I've had since then is it might be also be a good idea to send me a "text" when the door has been left open for more than say 1-hr. Rarely do we intend to leave it open long-term, so this would let us know we probably forgot and should maybe close it... BUT, it does NOT mean the RPi is going to automatically close it. Who knows, I might actually decide to clean out the garage one day over and would not want the door close on me prematurely.
So I thought I already had this one figured out, but not really a good solution for me at this point in time. A few months ago, I was working in the home office and desired to text my wife on other end of the house. (I know, lazy, right?) Unfortunately, I'd left my phone in the same bedroom where she was, so on a whim I quickly searched the web and found how to text from CLI for free using Textbelt.com.
It's really simple actually:
curl http://textbelt.com/text \ -d number=5555555555 \ -d "message=Hello, World!"
Unfortunately, when I tried it a week or two ago for this project, it returned a "success", but the message never got through. I thought it might be a system crash or something since it was a Sunday afternoon and no one around to fix it, and that I'd just try again later. Well, tried again this morning, and still no msg sent.
A quick Google search provided this: https://github.com/typpo/textbelt/issues/76
Turns out, the developer of this utility is traveling abroad and unable to fix this for a few days at least (already been 13 days since original bug issue filed.) The underlying problem is a known recurrence; from time-to-time, some jerk(s) will come along and abuse it to spam as many people as possible. When that happens, the mobile carriers (Verizon, AT&T, T-Mobile, etc.) block the Textbelt IP address, and thus the working-yet-dead service.
The easy fix is to change Textbelt's IP address, which he's done before. Unfortunately, I don't see that as a reliable long-term solution: it's already happened before; it's happening now; it'll happen again. I'm grateful this guy is offering this service for free, but if I want reliable notifications I need another solution.
One I would like to consider implementing later is to host my own Textbelt server--which is totally possible; his code is at https://github.com/typpo/textbelt open sourced and free for the taking. However, I don't have time right now to go off on a tangent project. Pin this one for a later date...
TextBelt (http://textbelt.com) is a REST API that sends outgoing SMS. It is available as a public service or as an internally self-hosted server. Textbelt uses carrier-specific gateways to deliver your text messages for free, and without ads. The service is fairly reliable and has sent over 1 million texts.