Hi all,
I have been lurking these threads over the last year and gradually piecing together my own (yet another) garage door project. I wanted to share my successes with the hardware, Arduino code, and integration with IFTTT and Alexa, hoping that at least parts of this project will be useful to someone.
I have posted all code from this project and a fairly comprehensive readme to
github.
Project synopsis: An Oak serves as a garage door monitor and controller. An
ultrasonic sensor mounted in the rafters of the garage and pointed downward senses whether the garage roll-up door is open or if a car is parked under the sensor.
IFTTT sends notifications to my phone when the door opens or closes, when a car arrives or departs, once per hour that the door is left open, and when the Oak is offline. An
Oak relay shield is connected to the garage door opener toggle signal, giving the Oak the ability to open, close, or toggle the garage door on demand. The open, close, and toggle functions can be triggered through a custom http page,
OakTerm, the
Particle mobile app, IFTTT, or Alexa via a custom skill. The custom
Alexa skill lets the user ask Alexa to check door status or to open or close the garage door.
Hardware:
Total cost: ~$25
IFTTT Integration:If you're not familiar with
IFTTT, you should be. It's a remarkably simple service which links various online services and data sources as "If This" triggers, and provides interfaces for "Then That" actions. Particle has provided interfaces to IFTTT to work with devices through the Particle cloud. You can create simple IFTTT recipes which monitor variables which your Oak pushes to the Particle cloud, or have IFTTT react to Particle.publish events. You can also create recipes which, in response to any arbitrary trigger, will call your Particle cloud registered function. I have set up recipes to send me a notification when the garage door opens or closes, when the garage door controller goes offline, and once per hour when the garage door has been left open. Although I haven't tested it, you should also be able to use IFTTT to send a close command if the door has been open for an hour. Lastly, I semi-sorta got Siri working, in an awkward way, through IFTTT. You can tell Siri, "Text #open to Garage Door" (Garage Door is a contact you create with a phone number IFTTT provides to receive SMS messages), and IFTTT sends the open command. See my
github project readme for details about the IFTTT recipes.
Alexa Integration:A custom Alexa skill allows me to vocally ask Alexa to check status or command the door to close through simple phrases such as "Alexa, ask My Garage Door if it's open", or "Alexa, ask My Garage Door to close". The Alexa skill utilizes a Lambda function which receives JSON requests from Alexa, sends http requests to the Particle cloud, parses responses from Particle, and generates speech responses to be returned to Alexa. I have posted the javascript code for the lambda function, as well as key components of the Alexa skill to
github.
Thanks to Erik and his team and to all the die-hard supporters in these forums.
Please leave a comment if you found any of this useful, or if you have any questions.