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]

17 thoughts on “HAL Is Duct Tape For Home Automation

  1. 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.

    1. Could have either bolted it using the existing long bolts holding the lock together or created a shim that goes between the lock and the door to mount this without modifying or drilling into the door.

        1. That wouldn’t work because then the servo would simply turn itself, not the deadbolt handle. It needs to be fixed to something.

          I admit that photo is too dark to really tell what he is doing, but later down the article, you can see a laser cut box fixed to the door and pencil marked outline of it on the door.

          1. Not the owner but it’s a crap apartment and they don’t care anyways. On top of it I didn’t drill any new holes. That’s a existing hole that I screwed the pipeband into.

  2. 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. 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.

    1. 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.

  4. 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 …

    1. 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.

  5. As a matter of fact, there are sensors which are essentially used for overload alerts.
    Lower yourself down to the point where you
    feel comfortable, then raise yourself back
    up to the starting position. “Insist on quality, brand strategy is the first international background of economic globalization the only way for Chinese enterprises.

Leave a Reply to justice099Cancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.