Story
I’ve seen the Raspberry Pi used by friends as a media player, but with the release of Windows 10 IoT I decided it was time I started hacking with it.
For my first project I chose to see if I could control my garage door.
Goals
My goals were as follows:
- Be able to open/close the door on the local WiFi
- Be able to query the state of the door
- Be able to partially open the door for air flow
Thanks to the Hackster.io community I had some great projects to get me started. I won’t duplicate those write-ups here. You can see them linked in the Additional Contributors section on the top right of the page. Instead I’ll briefly describe the milestones along the way to achieving the above goals and some of the hurdles I had to overcome in the process.
Milestones
PiFace Digital 2
To contribute back to the community I took the work by Peter Oakes and created a NuGet package for interaction with the PiFace Digital 2:
https://www.nuget.org/packages/Hastarin.Devices.MCP23S17
After wiring everything up I had basic manual control of the door through a few checkboxes but that required a screen and a mouse to use.
AllJoyn Producer
By looking at the work of Mike Linnen and after overcoming an issue with providing arguments to a method via AllJoyn I was then able to meet all of the above goals using AllJoyn Explorer.
The next problem was I wanted to control things from my phone but no apps existed for Android to perform the equivalent functionality of AllJoyn Explorer.
AutoRemote
I’ve been using Tasker for years now to automate my life. AutoRemote works with Tasker to help devices communicate. I was already using it to do things like mute all my devices when I go to sleep, or control my lights remotely by triggering tasks on an old phone that sits on my home office desk.
Given the current lack of any standard IoT protocols that are actually easy to use using AutoRemote seemed like the next logical choice.
The AutoRemote protocol is not well documented but fortunately the author released an example plugin to work with:
https://github.com/AutoApps/AutoRemote
With a bit of work I was able to convert that into something useable on UWP.
Adafruit IO
I’ve recently updated the project to provide basic Adafruit IO support to see the status of the door. I might revisit it later to add actual control via a dashboard and some sort of polling.
IFTTT Maker Channel
I’ve also added notification of changes to the door state to IFTTT via the Maker channel. This opens up a world of possibilities beyond AutoRemote/Tasker support.
Conclusion
I’ve met all my goals and with a bit more work I’ll be able to check the state of the door and control it via my Android Wear watch by using AutoWear.
Some of the things I’ve already done:
- Turns off the lights in the house when the garage door opens (I live alone so I’m not leaving anyone in the dark)
- My phone will speak and generate a notification whenever the door changes state
- The notification is displayed on my watch and has actions to open/close the door
Future enhancements could include:
- Opening the door when I approach in my car
- Closing the door as I drive out
- Allow control remotely (using the old phone to relay messages)
Project Revisited
I recently had cause to revisit this project. A Windows IoT update failed after a day of debugging I managed to determine my micro SD card was corrupting. In the process I decided to extend things some more so have now added support for IFTTT via the Maker channel and Adafruit IO via the REST API.
For more detail: AllJoyn/AutoRemote Garage Door Control Win10 IoT