Friday, August 26, 2011

Home Automation on a Debian powered PogoPlug

A while ago, I bought some remote controlled sockets branded Status from my local Asda for the princely sum of £5 for 3.


I soon realised the limitations of the remote, and started casting about for alternatives.

I eventually stumbled across the Tellstick from Telldus, which is a usb connected transmitter which can send the on/off commands to many brands of remote controlled devices. These looked like a perfect fit for my Pogoplug.

The base software is slightly lacking, but there are several third-party apps for Windows, Linux, Mac, and Android. The one which appealed to me the most was HomeAutomation. This is a web-based system (so controllable from anywhere) and one of it's main features is that icons for the controlled devices can be placed on a house plan image as shown below


As the pogoplug is a ARM based device, the Telldus software is not packaged and needs to be built from source.

The steps to do this are below.

There are some prerequisites which need to be installed first, assuming the Pogoplug is already a LAMP (Linux, Apache, MySQL, PHP) server:

  • apt-get install build-essential libftdi libftdi-dev cmake libconfuse0 libconfuse-dev
  • cd /usr/src
  • wget http://download.telldus.se/TellStick/Software/telldus-core/beta/telldus-core-2.0.104.tar.gz
  • tar -zxvf telldus-core-2.0.104.tar.gz
  • cd ./telldus-core-2.0.104
  • cmake -DCMAKE_INSTALL_PREFIX=/usr
  • make
  • make install
Once the Telldus software is installed, configured and tested with your devices - this will vary depending on what you have, and is easy with Telldus Center on your PC, the next step is to install the HomeAutomation software.

  • download from http://karpero.mine.nu/ha/index.php?page=download&hl=en_US to /usr/src
  • unzip /home/gary/Downloads/HomeAutomation_v2_0_2.zip
  • mv /var/www/HomeAutomation_v2_0_2 /var/www/HomeAutomation
  • cd /var/www/HomeAutomation
  • mv config_sample_linux.php config.php
  • nano config.php
  • chown www-data:www-data /var/www/HomeAutomation/ -R
  • Ensure that the timezone is configured in your php.ini file
The next thing to do is to create a database and user for HomeAutomation in MySQL. This can either done at the command prompt as below or using a tool such as PHPmyAdmin.
  • mysql -u root -p password
  • create database homeautomation;
  • create user username@localhost identified by password "password";
  • grant all privileges on database homeautomation to username@localhost identified by password "password";
  • exit;
Next, browse to the HomeAutomation folder on your webserver, and follow the installation wizard.

If you want to create a nice 3-D floorplan of your house, then browse to Autodesk Homestyler where you can create one for free.