Groovy, Programming, Smart Home, SmartThings

Programming My House: Multi-Circuit 3-Way Switches

I’ve been outfitting my home with “smart home” devices: light switches that I can turn on my with phone (or voice, via Amazon’s Alexa), hinges that report when doors open and close, and motion sensors that report activity around the house.

Smart House. Original house photo by Jameslwoodward: https://commons.wikimedia.org/wiki/File:Ellen_H._Swallow_Richards_House_Boston_MA_01.jpg

I use Samsung’s SmartThings hub, which provides access to a handful of official “SmartApps” — pre-written automations for smart devices. The best thing about SmartThings though is that I’m not limited to the official apps; I can now write programs for my own house.

Today, I wrote my first program in order to eliminate a major annoyance in our house. When it was built, the owners must have loved light switches; rooms as small as our pantry (about 5′ x 8′) have two overhead lights with two separate switches that we will never turn on independently of each other. After replacing both switches with smart switches, I was able to write a 40-line Groovy script that links those two switches, effectively combining both lights and making each switch part of a 3-way-switch setup.

Achieving this with wires would have required cutting holes in the wall and hours of rewiring and drywall repair, but once the SmartApp was written, I was able to attach it to three different sets of lights in our home in about 60 seconds.

I’ve submitted my SmartApp for inclusion in the general SmartThings marketplace, but until then, if you want to use it yourself, you can grab the text on GitHub and install it for your own devices via the SmartThings Web IDE.

Standard

Leave a Reply

Your email address will not be published.