I've been a bit of a hacker/maker for a long long time. I wanted the LEGO robotics kit, but because it was too expensive, my electrical engineering father helped me through a lesson of power supplies, red hat Linux, C programming on parallel ports, relays and LEDs. I never did hook up the LEGO motor, but I did get that LED to blink by using the keyboard. Anyway, that's a good bit for my profile. Fast forward...
I've recently flushed out my maker hardware bits and decided it's time to do something simple and make a tutorial. I figure there's already a load of other garage door control tutorials, so I won't feel so bad if this goes poorly.
I made this to add the large garage door to my SmartThings home automation system. There's better ways to do this, but my programming abilities are weak so I use the great tools of the internet.
This version of the garage door opener uses IFTTT to talk between SmartThings and Particle. The door is operable at any step along that path though, so I'll start at the beginning.
ParticleI started with the particle connected to the relay and reed switch on the desk beside me as I created the particle code. The loop looks for the door opening or closing and updates its state to the Particle platform. Functions can be called to open or close the door that will trigger the relay for a second only if the door is not already in the desired state. Part 1 - Control door from Particle - COMPLETE
I then connected IFTTT to Particle. That enables control from other sources. Create DO buttons or connect it to other channels on IFTTT. Part 2 - Control door from IFTTT - COMPLETE
SmartThingsLastly, SmartThings took a bit more setup. Use the developer platform to create two simulated switches, one for the control (S1) and one for the feedback status (S2). Name them what you will. Update your ST settings in IFTTT to enable access to those two switches. Then make 4 rules on IFTTT to ferry data back and forth:
- S1 (ON) --> openGarage
- S1 (OFF) --> closeGarage
- Garage(open) --> S2 (ON)
- Garage(closed) --> S2 (OFF)
This leaves you with pretty crude control of the garage door. I'm sure many readers see that there are some feedback items missing. There's plenty of room for improvement here. Main thing to remember is that if S2 changes to OFF, the door just finished closing. Part 3 - Control door from SmartThings - COMPLETE
ResultsWell, this is where I got to before I actually connected the relay to the garage door opener. I was a bit disappointed when the relay failed to trigger any response from the garage door opener. So, some research later, we come to the reason this is a "Security+ 2.0 MyQ" garage door opener project.
The door opener didn't respond to the trigger sensor wire shorting, so I learned that the wall button sends a code similar to how the wireless button in the car works. I didn't want to sacrifice a wireless button that would require battery changes (albeit infrequently). So, I bought the Security+ button and used the relay to trigger its button, which then sent the correct signal to the garage door opener.
...If it's not broken, it doesn't have enough features!
Comments