get-started-kits.2e8ba015

I recently purchased a Samsung Smartthings Hub and it was one of the better decisions I have made for my home automation system. The Hub has it pros and cons but one thing it does really well is that as a developer I can write my own custom switches and have them behave like professional consumer products.

In particular I’ve gotten rid of all of my custom software to control my X10 equipment and now use Smartthings to handle this for me. This offers a huge benefit because it now future proofs my legacy equipment and allows them to interact with other modern automation systems. Essentially Smartthings adds an abstraction layer so I no longer need to hand-roll x10 support on a case by case basis for my gear at home.

What does this really mean? For starters I have slowly been replacing my x10 light switches with Philips Hue lights. Philips Hue lights are compatible with Smartthings. I have a Logitech Harmony Ultimate Home kit. The harmony remote has support for Smartthings and hue lights out of the box. Which means I can control my Hue lights from my TV remote.

Now because the Harmony remote can communicate with Smartthings, and because I can control my x10 gear from Smartthings, by that extension I can now control my X10 lights from my Harmony remote. There was no custom hackery required, it simply just worked. I can control my Hue lights and my X10 lights from the harmony remote as if their was no difference between them.

Likewise when I control my lights from my Android phone, the Hue and x10 lights behave as though they were the same.

Why do I still have x10 lights? A) I’m cheap and lazy and B) I found that if you are powering at least 4 bulbs off one x10 switch, you can actually switch to LED bulbs. Any less than that and LED bulbs will not work properly. The current that flows through the circuit to power the X10 switch causes one of the LEDs to stay on permanently if you don’t have at least 4 bulbs.

This is also a good solution for appliance modules. Current generation zigbee or z-wave appliance modules are pricey. X10 appliance modules can be found used for cheap and offer the same functionality. However they obviously suffer from classic X10 signal issues, which means if you plug them into a wall socket that gets a poor signal, you might as well use a modern module instead.

But if you plug them into a wall socket that seems to behave well, chances are it will be rock solid. In one room using X10 appliance modules work great and have no signal issues. In another room, the signal was so bad that I replaced them with the Samsung Smartthings Appliance Module. It’s just a matter of being realistic with your results. I already owned a bunch of x10 gear, so for the circuits/rooms it works well on, I’ll keep them.

X10Bridge-01

So, what I’ve done is replaced all of my x10 switches with fewer than 4 bulbs with Hue bulbs. For any switches powering 4 bulbs, I just swapped out my old incandescent ones with cheap LED bulbs.

I’m not going to walk you through how to do it just yet but you’ll find that after doing some reading and after setting up a smartthings developer account, it’s actually quite simple. All you need to do is add a custom x10 device and an x10 smart app to your developer dashboard. Someone else already wrote the code to do this but they’ve since abandoned the project. (I’ve forked the repo and will maintain it, see links below)

Here’s a video of him demonstrating how it works.

You can read about the x10 Smartthings app here: https://community.smartthings.com/t/x10-bridge-is-released-obsolete/4783

Since the project has been abandoned, I’ve forked his code and been maintaining it here: https://github.com/ssshake/SmartThingsPublic

What you need is the x10 bridge: 

https://github.com/ssshake/SmartThingsPublic/blob/master/smartapps/statusbits/x10-bridge.src/x10-bridge.groovy

And the x10 switch: 

https://github.com/ssshake/SmartThingsPublic/blob/master/devicetypes/statusbits/x10-switch.src/x10-switch.groovy

This x10 bridge communicates with the mochad service running on a Linux machine (a raspberry pi in my case). I was already using this to control my gear so this was ready to go and super easy for me. https://sourceforge.net/projects/mochad/files/?source=navbar

ha_hub_diagram3

In closing it’s great that I can now treat my old equipment as if they were modern. But Smartthings has also allowed me to take advantage of its presence feature. Automatically shutting my lights off when I leave. Automatically turning my porch lights on at sunset, etc etc.

If your car has homelink (built in garage door opener) you might want to check out using an X10 transceiver as a way to control your home automation from your car (within distance, driveway)

Common misconception, your home automation gear doesn’t have to be X10 to take advantage of this. You just leverage X10 as a bridge/transport between your car’s transmitter and your home automation server.

Simply buy a cheap X10 transceiver and USB interface (check ebay, kijiji, craigslist). You can use this to receive signals from cars with a “homelink” universal unit. Typically meant for garage door openers.

I currently have my homelink unit in my car configured to 1) open/close my garage, 2) Welcome Home Mode: Turn off house alarm, turn on exterior lights, turn on main level house lights. 3) Away Mode: Turn on house alarm, turn off all house lights, turn off exterior lights, indicate to devices like thermostat.

I use an inexpensive X10 transceiver module and an X10 USB dongle. I connect this to my Linux server (or use a raspberry pi), have a script intercept it, and perform actions like controlling my lights, security system, even thermostat.

For me this is great. I have a driveway that goes to the back yard of my house and to a detached garage. It’s really cool being able to come home and with one button press, I can light up my entire path back to my house’s side entrance. Or being able to pull away and turn off any lights I forgot about, without having to dig for my phone to do so.

Range is limited in my experience. 30 feet perhaps more. Depending on your layout you might want to set up a couple transceivers. In my case, I have one transceiver in my garage and one at the front corner of my house. I have a L shaped driveway that wraps around my house and this seems to cover it.

X10 Transceivers like this, http://www.x10.com/tm751.html are really inexpensive if found from the right source. I paid pennies on the dollar for boxes full of X10 stuff on ebay and kijiji. You’ll also need a cm19a or cm15a interface. Do your homework before deciding which and buying.

I’ve been gone for a while and now I’m back. I’ve noticed there’s a severe lack in good (and good looking) software for modern DIY home automation. In this post I’m throwing up some screen shots of a software suite that I’m currently working on. I’m focusing on my thermostat, motion sensors and lights. And getting them to eventually work together.

Considering I see a lot of impressive thermostats and various home automation products being built from scratch using Arduinos and the like, it’s a shame that none of them have a particularly good software user interface. I was in the same boatand thought, “why shouldn’t we all have a pleasant home automation interface?” I plan to put the code I’m working on up on Github as open source so that others can use this in their projects if they like, or even contribute improvements.

If you’ve created your own Arduino thermostat, this app is for you.

This software platform has been designed so that none of the protocol specifics matter to the user interface. It’s completely abstract, so if I want to use X10 or Zwave or Arduino or Philips or whicheverproducts in my home, I don’t have touch the UI code. What I have to do is configure the devices in the database, and write a “protocol translator” for the device. In other words, if I bought a new thermostat (or made one) and it had a completely different protocol/API, all I would have to do is write a basic shell script to sit between my core software and the thermostat, translating commands to API calls. Probably sounds more complicated than it is.

This slideshow requires JavaScript.

I was previously managing the thermostat and motion sensors through some ugly shell scripts. I’ve moved both over to a mysql database for configuration and state, with an HTML5 front end and some basic shell scripts to interface with the hardware. I think by decoupling these three tasks it will make it easy to shim in other protocols and hardware down the road.

In the motion sensors app, I can now get a very good idea of what each sensor is doing, making the set up and troubleshooting of sensors easy. This app shows me which zones see motion in green, dormant zones in grey. I can click a zone button to disable motion detection in that particular zone. It tells me how long it’s been since it has last seen motion . It also shows me the number of “hits” behind the main text.

When a sensor is triggered, it will run a related macro for it, to say turn on lights on that room, or whatever. The macros are just a series of basic shell scripts.

The back end service for motion detection compares the last time a zone saw motion to a timeout which can be a hard set number or perhaps a dynamic number based on “hits” of activity seen in that zone recently. An exponential push-back on the timeout. When the timeout is exceeded a macro is run to turn things like lights off or maybe adjust my thermostat. Maybe auto-arm the alarm when all zones are dormant and it’s during work hours.

Speaking of alarm, it also acts like an alarm system now. When enabled, triggered zoIMG_00001485nes show up in red on the UI. The back end servertakes photos from my cameras, emails me the photos, and plays a siren and flashes all of my lights on and off in my house. It’s pretty cool considering it was a $0 feature add.

All of the data is maintained in the same database as the thermostat app. I plan to write something to use this motion data to dictate thermostat functions, so that it will operate similar to a nest thermostat.

This slideshow requires JavaScript.

The thermostat app provides your typical thermostat functions. This interfaces to an x10 thermostat which I don’t recommend. But it would easily work with any WIFI thermostat with an open API or a home made thermostat with an Arduino or Raspberry Pi.

This app also pulls data from yahoo’s weather API and logs it to the database. So now I can correlate external weather to internal thermostat usage over the years. Possibly use that data and compare it to my Utility bills.

The image in the background updates dynamically and is animated.

With both apps, it updates status changes from the back end service quickly. So changes made on one client(phone) reflects to other clients almost immediately. This is great for multi-user homes.

Also these apps automatically scale for mobile or desktop view. Meaning I only have to maintain one code line. The cool part about this is it will act as an end to end solution. It will work and look good on desktops, tablets (maybe on a wall), and phones.

I’ll post my software publicly when I have modified it for easier distribution. If you’re interested in working with it or possibly adding to it, send me your github information.

In this project we explore how to add automatic window control for a relatively cheap price to your car. I have a 2003 civic and due to its age it doesn’t have any of these features built in. It has one touch auto down for the driver window, like many cars. But I wanted auto down and auto up like luxury cars of its period. I also wanted to roll my windows up, or down, from my car’s remote/key fob. Many cars these days in the mid to high price range come with both of these features stock. Not only are these upgrade cool, but they’re useful. For one, just being able to hop out of my car, and hit lock and know that my windows will be up on their own is nice. Also on hot sunny days it’s nice to be able to crack the window an inch or two, or drop them down all the way as I approach to let the car air out.

A pleasant side effect of doing this project is it turns all of your driver side window switches into one touch auto up and auto down switches. The passenger switch will still work but won’t be automatic. IF you wanted the passenger side to be automatic, you would have to run a pair of wire from it, back to this DIE530t control unit.

4680394203_35f77a618c_zLink to the full manual: http://www.directed.com/guides/manuals/ig/accessories/N530T_1-00.pdf

The install is pretty simple so don’t let the instruction manual fool you. Follow the tutorial posted below. One issue with this guy’s tutorial is he decided to pop the door panel and wire this unit closer to the wires at the switch panel and motor. Although this is easier as far as figuring out which wire is which, ultimately it is completely unnecessary. When you open your door and look near the hinges you will see a black rubber tube going from the door to your car. This tube or hose contains all the electrical wiring going to your door panel. If you see my point here you will realize you can wire everything up under your drivers kicker panel behind the steering wheel. All you have to do is find where those wires coming in from that tube goes, and which wire does what. These wires are in a harness that just clips into a connector. That is where you should wire everything from. However popping the door panel to initially trace the wiring is probably the easiest thing.

zzzzzPanelIf you try this project and want to get your door panel off, do yourself a favor and invest in a panel popper. You can get these at your local automotive store, they’re cheap, and because they’re purpose built for doing just this very thing, they work like magic. It’ll look something like one of these on the right.

If you’re too cheap or impatient to get one of these, you can use a butter knife, but you’ll probably break a few tabs. But at the end of the day the door panel will probably go back on fine. They put more tabs than required for a solid fit.

My last bit of advice is instead of tying into an existing 12v source found under your dash, run a wire from the battery. You might already have a wire if you have a subwoofer/speaker amp or a carpc. I found that when I tied into an existing power source, it wasn’t delivering enough amperage, and in cold weather the window motor was under powered.

How-To install DEI530t: http://home.comcast.net/~c_wrzesniewski/windowsmod.htm
How-To then install PAC TR-7: http://www.rx8club.com/series-i-do-yourself-forum-73/diy-auto-up-down-windows-factory-key-fob-168029/
Additional installation instructions and photos: http://forums.clubrsx.com/showthread.php?t=177722

Parts:

Videos of others who have done this project

I’ve had a few people ask me to clarify where the servo actually goes. And as I stated before I planned to do a full, start to finish video tutorial. I still will, but I lied on the timeline. It’s summer, I’m a home owner with many things to do, and I’m a beer drinker with many women to slur at. This blog will be more lively in the winter.

Anyway this blog post with be a live document where I will continue to add more how-to details on the blinds project. I’ve decided to start a new post because my original one was getting very long.

Tutorial #1 – Where does the servo go?

Taken from a photo that a viewer sent me, I’ve updated it with the latest in computer graphics to demonstrate that in my case I had to remove the manual crank, shorten the rod (mine was plastic) and hot glue the servo into one of the spools.

My question/advice was to see if you can turn the rod, by hand, with the manual crank still in place. Is there resistance? If so that means the crank needs to be removed. It’s pretty easy; in my case it’s just held in by clips. Looks the same in this guy’s case too.

20130611_115856One issue with this guy’s set up is where the green arrow is pointing, you can see that the rod is what rests on the brackets/holders. But in my set up, the spool (metal drum.. plastic in my case) has a lip on each end and this is what rests on the holders. So, this guy will have to be innovative to get this to work and I look forward to seeing photos of how it’s accomplished.

 

p.s. I’ve been super negligent in my task of offering a tutorial of this. I just haven’t built anymore yet.

arduino-logo1

I just wanted to do a post giving a big thanks to all those in the arduino.cc community. Every since I’ve posted my project on their user’s WIKI I’ve been getting steadily 10 times the traffic I used to, every day.

http://playground.arduino.cc/projects/arduinoUsers

And I can see that many of them are also looking at my other non-Arduino projects. I would love to hear from the community and know what kind of stuff interests them.

I’ve only been using Arduino’s for a couple of months now but I’ve quickly become addicted. I have some more projects on the way…

6919551412014385339

This video below shows all the parts and how I’ve connected the servo.

This is the pull string for “manual” control

Well the fun keeps on coming, and by now you should see that the running theme in my world is many competing projects. Which is why you’ll often see me post new cool stuff before I properly tie off the loose ends with existing stuff. So for that I apologize for not completing many tutorials and postings of source code. I also have a day job you know 😛

Annnyway stand back witness a very cool project that literally took me less than an hour to prototype. And the prototype isn’t that far from the complete project. For a long time now I wanted automated window blinds, because to me, blinds are pretty useless on their own. I don’t open them when it’s sunny, and if I do, I forget to close them for privacy when it’s dark. Can’t this just happen for me? Like come on.

There are solutions available but clearly the other theme to my blog is cheap. If I had to pay for premium home automation, I simply wouldn’t do it. I may be lazy but I’m even more so cheap.

I successfully converted existing blinds in my house to automated blinds with many features for about $35-40. The blinds themselves cost about $35-40. So all in all this is a cheap upgrade for what you get.

What my blinds do (aka what sensors does it have). My window blinds will:

  • Open when it’s day light, and close when the sun goes down. This is accomplished EASILY with a $1 Light Dependent Resistor.
  • Will close partially when it’s a very hot day. Accomplished by a $1 Thermal sensor model TMP36.
  • Open or close blinds to any degree I wish using my logitech harmony remote (or any remote), accomplished by an IR Receiver for $1.
  • Open “manually” by waving hand near top of blind using a IR motion sensor

This slideshow requires JavaScript.

I am operating the blinds using a servo, which is a type of geared electric motor. They are about $9.

I’m doing this all through an Arduino, it’s cheap, super easy to use and has great tutorials for all of the features I’ve mentioned above. All I can take credit for is combining the tutorials and adding some basic logic. If you know any programming/scripting language this will probably be a breeze.

The beauty of the Arduino is you don’t need to buy all the stuff I listed, you can just pick what you need and roll with it. IF you want what I want, it’s a few bucks more here or there.

Lastly (and I’ll add better details later), I was able to do this so easily because I had room to work within the header of my blinds. I’ve watched 6 examples of similar projects online, and not to knock them, they all look ugly. Many of them have components exposed and usually this is because they are retrofitting thin, half inch, cheap blinds. And I ask why put this kind of effort and money into $10 blinds, especially if it will look harsh on the eyes after? Go get yourself some nice blinds, 2″ faux or real wood. They look good and because of the size of the blinds there is plenty of room up top to hide all your gear.

You can find my Arduino source code AND diagrams on github:
https://github.com/ssshake/arduino

Parts List:
 - 2" Venetian Blinds (Faux or Real Wood)
 - Arduino UNO or preferably an Arduino Mini
 - Servo (Any standard RC car servo should do)
 - Photocell / Light Dependent Resistor
 - 10k resistor
 - Some wires

Optional:
 - 90 Degree Servo Mount
 - TMP36
 - 38Khz IR detector

Perma Link: https://homeawesomation.wordpress.com/2013/02/26/automated-window-blinds-with-arduino/

More Videos Below…
Continue Reading