DEVTOME.COM HOSTING COSTS HAVE BEGUN TO EXCEED 115$ MONTHLY. THE ADMINISTRATION IS NO LONGER ABLE TO HANDLE THE COST WITHOUT ASSISTANCE DUE TO THE RISING COST. THIS HAS BEEN OCCURRING FOR ALMOST A YEAR, BUT WE HAVE BEEN HANDLING IT FROM OUR OWN POCKETS. HOWEVER, WITH LITERALLY NO DONATIONS FOR THE PAST 2+ YEARS IT HAS DEPLETED THE BUDGET IN SHORT ORDER WITH THE INCREASE IN ACTIVITY ON THE SITE IN THE PAST 6 MONTHS. OUR CPU USAGE HAS BECOME TOO HIGH TO REMAIN ON A REASONABLE COSTING PLAN THAT WE COULD MAINTAIN. IF YOU WOULD LIKE TO SUPPORT THE DEVTOME PROJECT AND KEEP THE SITE UP/ALIVE PLEASE DONATE (EVEN IF ITS A SATOSHI) TO OUR DEVCOIN 1M4PCuMXvpWX6LHPkBEf3LJ2z1boZv4EQa OR OUR BTC WALLET 16eqEcqfw4zHUh2znvMcmRzGVwCn7CJLxR TO ALLOW US TO AFFORD THE HOSTING.

THE DEVCOIN AND DEVTOME PROJECTS ARE BOTH VERY IMPORTANT TO THE COMMUNITY. PLEASE CONTRIBUTE TO ITS FURTHER SUCCESS FOR ANOTHER 5 OR MORE YEARS!

A journey in Home Automation

A while ago, after dabbling into automating some of my chores and looking into the possibilities, I stumbled into the domain of home automation. It grew on me quickly and soon I found myself sourcing parts in different countries and splicing them together in various ways as means to various ends. And it was fun, too! I then decided to put all my ideas into one place, to document the process and make a sort of work log of it, so I could recover from failure quickly. Remember that setting you just ‘’had to’’ get right in order for your system to work just right, that you looked for online for over two hours? Well, you sure won’t in a couple of months. Better write it down somewhere! Or so the reasoning went.

However, between deciding to do something and actually doing it there is sometimes that period of time that goes by when you have to do other things, not necessarily more important but more urgent. And so my ideas went on hold. I read, I experimented and I failed, then I read again and tried again and in the end I decided I could do more than just a worklog, and actually write some articles about the whole shebang. Sure, I’m no expert, but I believe those who are keep the knowledge to themselves because this business is quite lucrative. I do have some experience with microcontrollers though, and with setting up various control systems, as well as a background in telecommunications and software programming, and this is what I’d be doing if I could do whatever I wanted, so why not take a crack at it? So the idea stuck and I decided to write and post the articles on devtome so people could actually see them.

So without further ado, here is an introduction and an outline of Home Automation for the not-necessarily-technically-inclined. Chapter 2 deals with the technical overview and cloud security issues, as well as an overview of current technology and how it fits into the theoretical schema. Chapter 3 compares a couple of simple, off the shelf light control systems while Chapter 4 takes steps further and designs a simple home automation system from parts.

As day jobs are notorious in gobbling up time, though, and the realm of home automation is but a hobby to the author, the following information will arrive in sets which will be linked below as they are written. Bookmarking this page and checking back often is highly recommended!

Table of contents:

Chapter 1 - Overview, state of things and possibilities

Chapter 2 - Basic theory, cloud security and examples

Chapter 3 - A (theoretical) home automation system

Chapter 4 - A simple home automation system

Chapter 5 - A practical example using Tasker

You Are Here:

Chapter 4 - A simple home automation system

In my previous articles on Home Automation on the Devtome I wrote about Home Automation in general, an overview of the terms and the technology, a security overview of basic home automation systems and I presented a simple light control system made with off the shelf parts (actually, it can be bought entirely off the shelf) and a comparison between two systems: the Philips Hue and the LIFX .

This is the fourth installment in the series, where we delve deeper into the Home Automation world to investigate the pros and cons of a different system – cheaper than the light control options above and more powerful in its capabilities. There will be a presentation of the system, a Bill of Materials with prices current as of June 2014 and a basic implementation scheme. Unfortunately for the hobbyists and home automation enthusiasts in the US, the needed parts for this system are not readily available in the US yet, being manufactured in the European space right now, though the various online shops that stock them do ship overseas. Shipping information and availability will be provided in the Bill of Materials where available. So let’s dig in!

More Control

The light control systems in the previous article had a big advantage and a big disadvantage. They were really easy to install and use for the casual user - just buy, plug into the light socket and start the app on your mobile device of choice. However, most power users – the kind that spend $200 dollars on the promise of fine-tuned control - will be put off by the lack of options available in the mobile app. Rigid scheduling and lack of easy integration with systems dampen the one attraction these systems have – usability. Sure, they offer APIs and are easily customized – if you happen to like programming and have a webserver handy. Also, the price is prohibitive for large applications – spending upwards of $60 on a bulb gets expensive fast when considering a 10-15 bulb house. However, if one renounces the color change capabilities of the system – if one is only interested in turning lights on/off and dimming remotely, there are other – cheaper – options that can prove to be more flexible too, and we’ll investigate one of them below.

Enter the Tellstick

The Tellstick is a transceiver built by Telldus Technologies AB, a Sweden based company whose founders believe strongly in the open source philosophy. The Tellstick comes in three versions, the most basic of which is an USB stick with a radio frequency transmitter that can send on/off commands to radio enabled sockets and switches on the 433.92 MHz band. The more advanced versions offer two-way communication and are able to turn electronics on or off and to receive data from them as well – for example from wireless thermometers, meteorological stations or motions sensors.

The Tellstick enables a computer to control radio enabled sockets via a simple user interface. It is supported by Windows XP and Vista, Mac OS v10.5 or later and Linux v2.6.21 or later. It supports a wide range of sockets and dimmers, and since it is open source, it also supports an always growing list of third party applications that let you control your electronics via mobile phones, media centers, internet or bluetooth devices. The more expensive version even works as a stand alone piece of gear, requiring only an Ethernet connection to the home router so it can be controlled from the cloud, unlike the Tellstick basic version which requires and USB enabled computer. The transceiver’s range is about 30 meters (though, as usual, thick walls and metallic structures lower that figure in practice) and can control any number of elements, making it a suitable option for the controller in a centralized home automation system as figure 1 shows.

The system

So let’s build a simple home control system using the Tellstick and some programmable, radio-controlled sockets. There are some other devices that the Tellstick can control, which could enable us to also remotely turn on the ceiling lights, but they usually have to be wired into the existing system – either as new, radio controlled wall switches or as an additional switch on the line. For now, we’ll settle for a couple of lamps and the computer monitor and speakers. We’ll use a Tellstick simple, plugged into the PC that will serve as a controller. We could spring for the more expensive Tellstick Net, hook it up to the router and forego the PC, but that would require using the cloud to control our home environment, which, as was explained in Chapter 3 may or may not be a good idea, security wise. Using the PC shuts down the remote access and potential vulnerabilities, but still enables us to remotely control the lights from inside the home. There is a downside to this setup which cuts down on its usefulness as a remote control – when the PC is down it is unusable, but the cool factor and the convenience of having the remote right there while working at the computer makes up for it. We’ll also need a few radio-controlled sockets. I use a generic radio socket, which happens to work with the Tellstick (though it is not reported on the website) and is just $5 (as of June 2014). This is the bill of materials for the system that controls two lamps, a computer monitor and the computer speakers.

Name Quantity Price Availability in US Get it from
1 TellStick 1 $73 YES http://www.m.nu
2 TellStick Shipping 1 $8.15 YES http://www.m.nu
3 Remote Switch 3x2300W White / Silver - Nexa PB-3-WHITE 1 $30 NO http://www.m.nu
Total $111.15

Note: most remote socket should work, as long as they communicate on the 433.92 MHz band. There are some brands available in the US but they have not been tested - by the author of this article anyway - for usability with the TellStick, so buyer beware. As an example - and only that! - a cursory search on Amazon shows Remote Controlled Switch Socket - 2 Pack by Generic which might work.

Configuring the system

Now that you have all the pieces we need to install the software that controls the Tellstick. Go to the Telldus website and download the version of Telldus Center that works for your operating system. Install it, confirming the installation of USB drivers, and run it.

telldus_install_drivers_confirm.jpg

Figure 1 - Drivers installation

The interface should resemble the picture below.

telldus_center.jpg

Figure 2 - Telldus Center main user interface

Now you will need to configure the socket. Some types are “self-learning”, which means you can set it into a “learning” mode then use the software to set its code. Others take a more hands-on approach and you will need to use the screwdriver. The ones used for this demonstration are the latter type, from a generic, $5 a piece brand.

Figure 3 - Generic remote socket - front

Figure 4 - Generic remote socket - back

Turn the socket over and take the little plastic lid out, using a flat screwdriver to remove the screw. As it shows in the picture there will be a number of DIP switches available – ten for this model, each with two possible positions – 1 or 0. Switch some of them to 1, but remember which ones – the combination will be used by the software to identify and control this socket.

Figure 5 - DIP pins

In this example you can see that switches number 3 and 8 are set to up, which is “1”. This makes the identifier be “0010000100”. As a side note, this can be viewed as a binary representation of a number. Ten switches make ten bits; a ten bit number can go from 0 to 1024 (which is 2^10), which means the system can control 1024 different switches of this model. However, multiple switches can have the same ID, and be controlled in tandem.

Next, go to the “Add device” option in Telldus Center and the next window should show up.

telldus_add_device.jpg

Figure 6 - Add device window

For this generic brand of socket I had to use the old trial and error method to find the protocol it used – it turned out to be the fuahote protocol, used by the HQ or Rusta brands. More information is available here on the developer wiki.

Select your model, or in this case, the HQ brand, and set the virtual switches accordingly. Ignore the notations – the HQ brand has 1-5 and A-E instead of 1-10 but the effect is the same. Choose a name for this device (“big lamp”, “lava lamp”, etc) and write it in the textbox. Hit Save and the new device should be visible in the list in Telldus Center like the pertinently named “test 2” device in our example.

telldus_center.jpg.

Figure 7 - After the last step

Now you can test the system by pressing on the light bulbs. If everything went as planned, the socket should turn the power on and off, and your lamp should follow suite. Rinse and repeat for the other sockets – choose a different pattern for the switches (I write it down usually because taking the plastic lid apart to peek at the configuration after you will invariably have forgotten can be a pain), add them to the center and test them. Congratulations, your first computer controlled home automation system is done!

If it didn’t work the first time, check that the switch pattern is the same as that entered into the software and that the Tellstick works. It should light up blue for a fraction of a second when it sends out the radio commands – if it doesn’t then it is either defective or the software can’t communicate with it. Also check that the electronic device plugged into the socket is set to “on” – if you plugged a lamp in, make sure its switch is set to on before testing. More troubleshooting ideas are available on the manufacturer’s site.

Making it smarter

This is a neat way to automate turning some lights on and off around the house – I use it for mood lighting and to turn my speakers and my computer monitor on and off automatically. Let’s improve on this system by making the computer do this last part for us when it boots and shuts down. For this, we will require another software solution called Eventghost. This is a flexible automation tool for Windows, and is open source software – you can get it and use it for free. It does not work on Linux, but Linux already has powerful tools and scripts that run when the PC boots or shuts down – a cursory search online will come up with many examples and scripting actions for the Tellstick under Linux is a bit out of the scope of this tutorial.

After downloading and installing Eventghost, go to Configuration → Add Plugin.

eventghost_add_plugin.jpg

Figure 8 - Eventghost Add Plugin window

Choose TellStick. If Evenghost complains that some DLL is unavailable and the TellStick plugin text is red in the picture, download the updated plugin from here and unzip the files in the Eventghost plugins folder which should be on C:\Program Files (x86)\EventGhost\plugins on any 64bit Windows platform. For 32bit just replace “Program Files(x86)” with “Program Files”.

Next, right click on the Configuration Tree and select “Add Macro”. Choose “turn ON” from the options. In the next window choose your device (I’m still using test2 but for you, this should be the “monitor socket”).

eventghost_add_macro.jpg

Figure 9 - Eventghost Add Macro window

The Macro now shows up as the last element in your configuration.

eventghost_turn_off.jpg

Figure 10 - Eventghost Macro

Right click on the macro and choose “Add Event”. Write “Main.OnInit” in the textbox, without the quote marks. Hit OK and the macro should look like this.

macro_looks_like_this.jpg

Figure 11 - Eventghost completed Macro (with event)

Now your computer will automagically turn its monitor on whenever it boots and EventGhost starts. You can repeat the process for the speakers plug, making sure you choose the right device when configuring the macro. Also, for added fun, you can add a couple of “turn Off” macros, one for each device. Make sure you write “Main.OnClose” instead of “Main.OnInit” in the Add Event window, and the PC will automatically shut down its monitor and speakers sockets when it shuts down!

Next steps

Eventghost is a powerful and flexible piece of software with an active community behind it and a well written wiki. If you’re not afraid to tinker with stuff (and you shouldn’t be if you are here, this is a Home Improvement tutorial after all) there are a lot more scenarios that could be enacted and planned for using this system. You could have some lamps come on or go off at certain times, or on some other events like dawn or sunset, or if it gets too cloudy outside.

Another powerful option - is to install VoxCommando . This is a powerful speech recognition and voice command utility that can interface with Windows, a variety of multimedia programs like XBMC and iTunes and, most importantly, Eventghost. It can be configured to understand and execute commands like “all lights on/off” or “start the stereo”. VoxCommando is try-before-you-buy and will be limited to 40 commands before it needs to be restarted, though it should be enough to get a feel for its functionality before shelling out the $30 (Canadian) it costs. Also, it can be configured to respond to commands it understands by playing a sound file, which greatly raises its cool (and geek) factor. Generic Star Trek chirp, “you ranngggg” like Lurch from the Addams Family would say, or just a sharp “understood”, there are as many possibilities as your imagination can handle.

The only caveat with the described setups is that the computer would have to be on to allow Eventghost to react to these events and command the sockets, though this hurdle can be overcome by using the Tellstick with some device that can be safely left always on. The TellStick works with Dovado routers out of the box, but it can be used with other mini PCs like the Raspberry Pi which is the setup I currently use. This will be the subject of our next installment of the Home Automation article series - how to build an always on, remotely controllable Home Automation system using a low cost, low power Raspberry Pi and a TellStick. Also, we’ll take a look at some LED strips and light fixtures to be able to control the ceiling lights as well.

Disclaimer

This information is for educational purposes only. Readers need to do their due diligence and read up more on the subject before committing money and time to this (or any) project. I will not be held liable if anything happens while trying to execute the steps outlined in this or any of my articles. These are my experiences and the information I know to be true at the moment, and I stand by them, but your mileage may vary. Be careful. Also, I am not affiliated with any of the companies or websites in this article and I have not received any compensation for mentioning their products although I do own a TellStick and appreciate it and what the company is trying to build.


Home | Technology | How To


QR Code
QR Code home_automation_chapter_4 (generated for current page)
 

Advertise with Anonymous Ads