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

Well it’s been a couple months since I installed my IPcamera and linked it to my x10 door bell. It’s been pretty great. I plan to show a new refreshed video and a full introduction to the software features I use in some backend scripts and a web as well as a smartphone app that I’ve been working on.

For now I’m interested in showing my IPcamera/doorbell script I wrote for XBMC just this evening. I use XBMC on all TV’s and computer systems in my house.

This slideshow requires JavaScript.


It’s been pretty great so far at automating my media across the network and integrating my home automation notifications. I decided to write a script to send a notification to all XBMC instances when my doorbell rings and to display a live video feed of the IPcam at my porch for 10 seconds.

My particular use case was I realized when in my exercise room I will not be able to hear my doorbell over my treadmill motor and music/video playing, AND I’m probably going to be spending most of my time in that room looking at an XBMC screen. It works great, it’s very simple and it’s very cool since it pops up on any screen I have running in the house

[CODE] 
##Deprecated Example!

#Import the XBMC/XBMCGUI modules.
import xbmc, xbmcgui, time, urllib

#inherit from WindowDialog instead of Window so that it's shown on top of
#what's onscreen instead of replacing it entirely
class CamView(xbmcgui.WindowDialog):

    def __init__(self):
        #Define image location and size
        self.image = xbmcgui.ControlImage(870, 438, 380, 253, "")
        self.addControl(self.image)

viewer = CamView()
viewer.show()
start_time = time.time()
while(time.time() - start_time <= 14):
    #set url to ip cam image, password auth not supported 
    urllib.urlretrieve("http://asdf.com/camera/", '/tmp/bell.jpg')
    viewer.image.setImage("")
    viewer.image.setImage("/tmp/bell.jpg")
    #Define image transparency 
    viewer.image.setAnimations([('conditional', 'effect=fade start=90 end=90 time=0 condition=true',)])
    xbmc.sleep(500)
viewer.close()
del viewer

[/CODE]

What I’ve created is a regular XBMC script like all other addons. You can get my script in ZIP format from github here, https://github.com/ssshake/xbmc-scripts/blob/master/script.doorbell.zip?raw=true

The thread on XBMC forums for this project can be seen here: http://forum.xbmc.org/showthread.php?tid=156665

This script can be run in the Programs menu or ideally for what I’m demonstrating here, it’s called by a command line script when it sees that my doorbell has been pressed. This is just a regular HTTP GET to your XBMC machine telling it to run the script.

Please note I’m using HTTP GET’s on XBMC 11, XBMC 12 requires an equivalent command over a json call. I’m pretty sure it’s not hard, I just don’t have that information right now.

http://XBMCHOSTNAME:PORT/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.RunScript(/PATH/TO/SCRIPTS/DIR/script.doorbell/doorbell.py)

From a linux shell you'd execute this as:

wget "http://XBMCHOSTNAME:PORT/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.RunScript(/PATH/TO/SCRIPTS/DIR/script.doorbell/doorbell.py)";

or you can just paste this into a regular webbrowser to test.
Check out my latest post where I demonstrate this functionality as a popup in XBMC, including script source code http://homeawesomation.wordpress.com/2013/02/18/doorbell-ipcam-xbmc-update/

Check out my latest project!

I have fully installed my door bell and camera, have developed a decent looking website and html email template and configured my cellphone to make door bell dings when the message letting me know someone is at the door arrives. It was all pretty simple. I’ll be posting a video soon but currently it’s -25’C outside.

I just got my hands on a used x10 pan/tilt camera mount. With it I have retrofitted my non-pan/tilt IP camera with it and I have written a simple yet easy on the eyes web interface with live 1 frame per second(by choice) view.

Check out my latest post where I demonstrate this functionality as a popup in XBMC, including script source code http://homeawesomation.wordpress.com/2013/02/18/doorbell-ipcam-xbmc-update/

I’ve finished installing my in-ground sprinkler system, which includes a lawn sprinkler and some pop-up garden misters.

It was a very easy job and only cost a couple hundred dollars. Each garden mister really too 2 minutes to dig, place and fill. The in ground sprinkler is also very easy. The hardest part was digging the trench for the feeder link to the sprinkler, but that wasn’t much work either.

Parts Used:

  • Digital Water Timer
  • Irrigation header hose
  • Compression ends/connectors
  • PSI Regulator
  • In-Ground lawn sprinker
  • Garden misters

I purchased everything locally from LeeValley. Everything was off the shelf from this link:http://www.leevalley.com/en/Garden/page.aspx?cat=2,2280&p=49657

Except for the lawn sprinkler which I removed (unscrewed) the connector tube and just hooked it up directly to the system. http://www.leevalley.com/en/Garden/page.aspx?p=59746&cat=2,2280,33159&ap=1

The next step is to open up the water timer, solder some wires to the buttons and then allow control of the timer u997_MEDsing an arduino. I think this will be a very cool mod because I can then use the internet to gain weather reports and use that data to determine  watering. I can also take it a step further by adding say a moisture sensor to intelligently water my lawn. I actually think the water timer isn’t needed because we’re replacing the brains with an arduino, and instead a cheap water solenoid from Adafruit could be used. http://www.adafruit.com/products/997

Here is a video of me testing out the equipment before install. I also show the parts used.

Here’s some photos of the finished product

This slideshow requires JavaScript.

So what you’re seeing here is me using a Harmony remote, and a mediapc running XBMC, plus x10 Home Automation to control my Lights, Thermostat and Fireplace. The Harmony remote and my PC drive the functionality. XBMC’s Notifications via API allow on screen feed back for what commands I’m executing.

Soon I will update this page with links to illustrations, script examples and a parts list.

Parts Used:
-Logitech Harmony Remote
-XBMC PC
-X10 lights + PC Controller (any HA lights would do)
-IR543 (is an x10 IR received for the remote, but an xbmc script could do this)
Parts Used:
-Logitech Harmony Remote
-XBMC PC
-X10 Universal Module for fireplace (basically a relay switch)
-TX15B X10 thermostat (deprecated, I recommend a good WIFI thermostat)

Here are some screen shots, I’ve included a summary of most of the dialogs to give you an idea.

This slideshow requires JavaScript.

People might be interested in this x10 plugin for XBMC. It doesn't support linux services but I'm actually planning to add this to the existing script.  http://forum.xbmc.org/showthread.php?tid=110392

So you’re at the point where you want to add more functionality to your home automation system, or maybe you specifically only want a remote access Thermostat. There are a number of reasons to want this but the question is which one is the best choice? Which technology is the right choice?

 
Before we discuss that, I’ll list a few reasons why you might want a remotely accessible Thermostat:

  • Left for vacation, forgot to turn off heat or AC. In a pinch you can adjust this from your smartphone or a computer
  • Returning from vacation and would like to get your house to the proper temperature before you step in the door. Returning from a tropical paradise to a frigid dwelling isn’t fun.
  • You would like to record the usage of your thermostat to a file/database so that you can do a detailed analysis between usage and utilities bills. (if you’re the meticulous type)
  • You want the actions of your thermostat to be directly affected by the status of motion sensors in your house. Why heat if I’m not home? Why adhere to preprogrammed schedule if I come home early?
  • You’re not near your thermostat (perhaps on a different floor) but want to turn the heat up, or turn it down.
  • You want to extend the functionality of your thermostat by augmenting it with custom functions from a computer/server.

Now lets discuss which to choose. I for one, didn’t really do my homework before buying mine. I previously had an x10 lighting setup in my entire house so to me I thought well I have the x10 transmitter, logically I want an x10 thermostat like the one pictured here. It is an RCS tx15b. They don’t make these anymore, I purchased mine used off ebay. It works well as shown in my other videos, but there is some hackiness required to get functionality like bi-directional communication to work. It wasn’t the worst choice and will do fine for now, but ultimately for the price I paid I could have spent another $50 and got current gen technology with better features.

Aside from x10 thermostats, there are other home automation protocol controlled thermostats. Such as ones controlled by z-wave and insteon, but I recommend you avoid them all. The conclusion you should draw from this article is why hassle with proprietary protocols and the need to purchase a compatible transmitter when good ol’ WIFI will do best.

Not all WIFI thermostats are created equal

Disclaimer: I have never used any WIFI thermostat in my life. I have just read a lot in preparation for my next purchase. However statistically speaking there is a 92% chance that my opinions are facts. In the event of the other 8% please comment corrections, I’d rather be eventually right than incorrectly believe that I’m right.

  • Most WIFI t-stats do not allow you to access them via LAN, aka HTTP to an internal IP. MOST of them actually make you connect to their externally hosted site. So you’re never directly accessing the t-stat, rather the t-stat sends and receives commands to their website, and you as a client also connect to this website. This completely ruins the chance for hacking and customization. You want a t-stat that has a locally accessible web server
  • Most WIFI t-stats DO NOT offer any sort of API access, so that you can easily send commands and receive status via a custom script
  • Often from my research the more expensive thermostats are the ones that are the most locked down.

Having the above in mind my recommendation to you is to purchase a thermostat from RadioThermostat.com. The reason why is they satisfy all the concerns listed above.

Their thermostats offer:

  • A locally accessible web server
  • Open and full featured API access using REST (HTTP GETs)
  • Priced very reasonably.

Some might say they’re a little on the ugly side. But for the price and features I’ll take the ugly. This is the ct-30. It’s about $140 shipped and considering non-wifi thermostats with decent functionality are $100 – $300, this is a steal. The ct-80 is its big brother, it comes with many more features such as a humidistat. It’s quite a bit more expensive but I’d say worth the cash. 3M resells the ct-30, rebranded as the 3M filtrete, and honestly looks very ugly to me. I’d rather get the radio thermostat branded unit.

If you’re wondering why the API matters so much, let’s assume on Windows or preferably Linux, I want to request the thermostat’s temperature, and then send that data into a website, XBMC, a daily email report, or just log to a file or DB for statistical purposes. With a RESTful API, all you have to do is script a HTTP GET to http://IP/API?command. And the thermostat will respond with the data.

If words like API, Rest, HTTP GET and the like sound foreign to you, don’t worry it’s actually a very simple concept. The thermostat has a web server running on it, you make a request to a particular page on it’s server (via script or even browser), the server will respond with data after you make the request. This thermostat also has it’s own web user interface for configuring it. And has an iphone and android app.

 
My last note is you might be wondering, why do most WIFI t-stats use a hosted site instead of a local web server? The answer is ease of setup for the non-technically inclined, at the expense of flexibility. If your t-stat has a local only server, then you need to open up a port in your route/firewall and set up rules so that you can access it over the internet (aka from work, from cell phone).

So to combat this, instead of the t-stat hosting the server, the t-stat initiates an outbound connection from your home internet, to the manufacturers website, where it sends and receives data to/from that site. You then use an account you create with them to log in, view, and control your thermostat at home. This is pretty much identical to the concepts of accessing your web enabled printer over the internet if you happen to own a modern HP or Cannon printer for example.
For my uses, Yes I want to be able to access my t-stat controls from across the internet, but I also need to be able to access it directly/locally for customization.

NFC is much more than just a visually impressive way to tap phones and share files. Or from Apple’s perspective, to perform payment transactions, which they claim isn’t appealing so they didn’t include NFC in the iphone 5.

What NFC truly is, is an awesome way to make existing bluetooth device pairing not suck, and to bridge the gap between the virtual and physical world.

NFC is a way to add another level of automation to my world. I currently do things such as tap to connect/disconnect to my home stereo and my car for handsfree calling.

You might be asking, why not use bluetooth auto connect? First off imagine it’s a new device you’ve never used before, boom one tap and you never had to go through the annoying pairing process. A prime use case is having a party with many friends who have NFC on their phone and ideally a good taste in music. Anyone can easily connect and disconnect their phone from the home sound system and play their tunes. Once again why I can’t believe iphone 5 doesn’t have it. But airplay over ATV is good if you’re an Apple exclusive group.

Second, with auto connect, if you’re in range, you’re connected whether you want to be or not. Now suddenly I’m connected to my stereo when I don’t want to be. The addition of physical control that’s gained with NFC tapping is the key here. I have bluetooth in my living room, my car and my garage. I don’t want hassles of the past where I’d be in my workshop, want tunes only to find I’m left with silence.

Let’s discuss what NFC is and is not:

  • NFC is like RFID in the sense that you can read a small amount of data from it by tapping it to a reader.
  • NFC is unlike RFID, which isn’t secure and can be read using specialized equipment from quite some distance.
  • RFID continually emits a radio frequency whether you’re in the act of using it or not.
  • NFC however only emmits singals when it is in the act of being used.This is possible because the NFC tag literally requires power from the device reading it (such as a phone) in the form of magnetic induction. So in other words, when a reader provides power by way of magnetic induction, the NFC tag is active and readable (even writeable). When there is no magnetic induction, the NFC tag might as well be a regular old sticker.
  • NFC tags use 3DES encryption.
  • NFC is writable 100,000’s of times by the same devices that can be used to read it. No special equipment required.

Now don’t quote me on these security comparisons. I’ve read much to say NFC isn’t that secure, but when you read the specifics of both protocols, NFC clearly sounds like a more solid and interesting solution.

NFC is not a transport protocol such as what Bluetooth or WIFI is. BUT an NFC tag can contain the connection information for a device to automatically connect to a Bluetooth or Wifi access point.

You can see in my video, what I’ve done was:

  • Purchase some NFC tags off the internet. (They’re cheap).
  • Used my smart phone to write some data to the tag.
  • Configured my smart phone to execute some actions when reading the tag.
  • Done. Very simple.

When purchasing NFC tags it is very important that you understand the 4(or more) unique NFC Tag types. Some have different storage sizes. Some are read only.
Some cannot be made read only. Some, specifically MiFare Classic 1k’s will not work with BlackBerry’s as they actually aren’t a standardized protocol and from what I read there’s some funkiness with licensing around them.

See this article explaining NFC Tag Types:
http://www.radio-electronics.com/info/wireless/nfc/near-field-communications-tags-types.php

Another thing to consider is what are you trying to do. You can program NFC tags with boring things like website addresses, email addresses, a custom string of data. You can also program them with actual Wifi and Bluetooth connection/authentication details. “Tap here to joint his hotspot”, for example. You can also program the tags using scripting software, which assign an ID to the tag, and uses that ID to execute macros on your smart phone. Depending on what type of data you want to put on the tag, it will dictate what type of tag and byte size you need.

Some uses, such as sticking one to a piece of electronic equipment will require a MiFare Anti-Metal sticker to prevent interference. What’s a good use case here you might wonder? If you have a phone and a tablet, but only one data plan, put a mifare anti-metal on your tablet. Script your phone to turn on its mobile hotspot when that tag is read. Now all you have to do it touch your NFC enabled phone, to your non-NFC tablet and boom you have internet access.

For more examples of neat ways to use NFC I recommend this link:
http://howto.cnet.com/8301-11310_39-57478334-285/the-most-practical-creative-ways-to-use-nfc-with-your-android-device/

See this article explaining how NFC technology works:
http://en.wikipedia.org/wiki/Near_field_communication
Where to Buy NFC Stickers? I got mine from here:

http://buynfcstickers.com