HAL is Duct Tape for Home Automation

HAL Home Automation

When it comes to home automation, there are a lot of different products out there that all do different things. Many of them are made by different companies, and they don’t often play very well together. This frustration ultimately led [Daniel] to develop his own Python based middleware solution to get these various components to work as a single cohesive system. What exactly did [Daniel] want to control?

First up was the door lock. [Daniel] lives in an apartment building, so there are actually two locks. First, a visitor must be allowed into the building by pressing a button on the intercom system in the apartment. Second, the apartment door has its own dead bolt lock that needs to be opened and closed. [Daniel] was able to control the building’s front door using just a transistor hooked up to an Arduino to simulate the press of the physical button. The original button remains in tact so [Daniel] can still easily “buzz” in a visitor.

The apartment’s dead bolt was a bit trickier. There are off-the-shelf solutions to control a dead bolt, but they are often expensive. [Daniel] built his own solution using a simple servo motor bolted to the door. The servo is controlled by the Arduino which is in turn controlled via two broken intercom buttons that already existed within the apartment. The buttons were originally used to either speak to or listen to a visitor before buzzing them into the building. They had never worked for [Daniel] so he re-purposed them for his own project. The whole DIY door locker is enclosed in a custom-made laser cut wooden box.

Click past the break for the rest of [Daniel's] story.

When it comes to lighting, [Daniel] has a couple of different brands of automated light bulbs in his apartment. One brand has bulbs that are controlled by a radio frequency signal. That brand comes with a converter box that can accept lighting commands via WiFi. It also uses a simple API that allowed [Daniel] to easily control all of the bulbs from his Python code. The second brand of light bulb did not have a simple API. After some searching around, [Daniel] found an open source project called ouimeaux. Ouimeaux is a Python library that allows you to control this particular brand of automated light bulbs. This was perfect for [Daniel] since he was already using Python in his project. With this library it was trivial for him to control the lights from his web interface.

As a proof of concept, [Daniel] also built a custom WiFi enabled power outlet using a SparkCore module. He has an entire separate post dedicated to that project.

For the brain of the system, [Daniel] chose to use a Raspberry Pi. The Pi runs a web server with a Flask based back-end system. Flask allows him to code the website in Python, which meant he could easily write a website that can interact with the various automation components. The Pi can directly communicate with all of the off-the-shelf components using the various Python libraries. For the door lock, the Pi communicates with the Arduino via pySerial. [Daniel] also used Flask OAuth to limit access to the system to only authorized users. Now whenever [Daniel] wants to turn the lights on or unlock the door for a visitor, all he has to do is press a button on a web page.

[via Reddit]

Comments

  1. justice099 says:

    Interesting project, but I am more interested in how [Daniel] is getting away with bolting things to the door and modifying the wiring in his apartment without getting thrown out!

    I hope he got permission.

  2. pff says:

    When insurance over here requires locks manufactured to certain standards I always wonder how quickly the insurance company would dump your case in the bin if they discover this kind of setup, especially one documented online.
    I wonder what all those PI’s are for…

  3. cooperised says:

    “in tact” -> “intact”

  4. Kris Lee says:

    I really like these kind of projects but I still have to share my criticism.

    SparkCore boards are connected to the Internet, and communication with them goes through Spark servers.

    The home automation crowd has been historically ignorant to the security with the over the air unsecured communication but I find that this is new level of in security.

    Unless he flashed custom software to connect directly with the board, but reading his article shows that he did not do that.

    • Dan says:

      I understand your concern. I only used a Spark Core to control my AC and lights, so even if somebody was able to exploit Spark Core’s servers, they’d only have control of those. Access to the control site requires Google authentication, and I can’t imagine anybody breaking that.

      To the same point though, cracking either of these security measures to gain access to my crappy apartment seems like it would require a lot more time and effort then say buying a set of lock picks, or for that matter a pair of heavy boots and a well placed kick.

  5. jacques says:

    From all the “look mom, i can control something with my phone” i have seen here since years,

    this is absolutely the ugliest !

    3 raspberry-pis, router, many power supplies, servo to open one door …

    • Winston says:

      Except that if you bothered to read the original post you’d see that none of those aside from one Pi and Arduino actually have anything to do with the project.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 92,285 other followers