Difference between revisions of "HomeAutomation and Tellstick"

From BubbaWiki
Jump to navigation Jump to search
Line 12: Line 12:
</li></ul>
</li></ul>
<p><br />  
<p><br />  
</p><p>1. Install package for compiling on B3<br />
</p><p>1. Install telldus-core on B3. First edit the file /etc/apt/sources.list with for example nano:<br />  
</p>
<pre>apt-get install cmake</pre><pre>apt-get install build-essential</pre>
<p><br />
</p><p>2. Install package needed by Telldus <br />
</p>
<pre>apt-get install libconfuse-dev libqt4-dev help2man
</pre>
<p><br />
</p><p>3. Download the latest software for Tellstick and extract. Use the latest tellstick core found at: http://download.telldus.se/TellStick/Software/telldus-core/.<br />
</p>
<pre>wget http://download.telldus.se/TellStick/Software/telldus-core/telldus-core-2.0.4.tar.gz</pre><pre>tar xvfz telldus-core-2.0.4.tar.gz</pre><pre>cd telldus-core</pre>
<p><br />4. Build tdtool and rfcmd.
</p>
<pre>cmake -DBUILD_LIBTELLDUS-CORE=1 -DBUILD_TDTOOL=1 -DBUILD_RFCMD_WITH_LIBFTDI=0 -DGENERATE_MAN=1</pre><pre>make</pre><pre>make install</pre>
<p><br />5. Edit the file /etc/ld.so.conf.d/local.conf (if not existing, add the file):
</p>
<pre>nano /etc/ld.so.conf.d/local.conf
</pre>
<p>Add the following line:  
</p>
<pre>/usr/local/lib </pre>
<p><br />
</p><p>6. Then run:
</p>
<pre>ldconfig</pre><pre>rm -f /var/state/telldus-core.conf</pre>
<p><br />7. Insert the Tellstick into B3
</p><p>8. To add receiver units, edit the file /etc/tellstick.conf
</p>
</p>
<pre>nano /etc/apt/sources.list</pre>
<br />
<p>Add the following line: </p>
<pre>add the line: deb http://download.telldus.com/debian/ stable main </pre>
<br />
<p>Save and exit from nano.</p>
2. The Telldus public key is needed. Run the command: <br />
<pre>wget -q http://download.telldus.se/debian/telldus-public.key -O- | apt-key add -</pre>
<p>The key fingerprint is</p>
<pre>70C4 10C9 D73D 53E8 38B3 1C58 5A94 9181 E501 EA76
Telldus Technologies AB <info.tech@telldus.se></pre>
3. Update the repository list by running the command:<br />
<pre>apt-get update</pre>
<p><br />4. Install the latest Telldus core by specifying its latest revision:</p>
<pre>apt-get install telldus-core=2.1.1-1</pre>
<p><br />5. Insert the Tellstick into B3 </p>
<p>6. To add receiver units, edit the file /etc/tellstick.conf </p>
<pre>nano /etc/tellstick.conf</pre>  
<pre>nano /etc/tellstick.conf</pre>  
<p>Adjust the config file to your receiver units. In this case: 1pcs NEXA NEYCR-1000 and 1pcs NEXA LWMR-210.  
<p>Adjust the config file to your receiver units. In this case: 1pcs NEXA NEYCR-1000 and 1pcs NEXA LWMR-210.  
Line 75: Line 74:
<ul><li>If you want to add more receiver units add more units to this configuration file. <br />
<ul><li>If you want to add more receiver units add more units to this configuration file. <br />
</li></ul>
</li></ul>
<p>9. Add an udev rule for the tellstick. Create the file:<br />  
<p>7. Add an udev rule for the tellstick. Create the file:<br />  
</p>
</p>
<pre>nano /etc/udev/rules.d/99-tellstick.rules
<pre>nano /etc/udev/rules.d/99-tellstick.rules
Line 83: Line 82:
<pre>KERNEL==&quot;ttyUSB*&quot;, BUS==&quot;usb&quot;, SYSFS{idVendor}==&quot;1781&quot;, SYSFS{idProduct}==&quot;0c30&quot;, NAME=&quot;tellstick&quot;, GROUP=&quot;www-data&quot;
<pre>KERNEL==&quot;ttyUSB*&quot;, BUS==&quot;usb&quot;, SYSFS{idVendor}==&quot;1781&quot;, SYSFS{idProduct}==&quot;0c30&quot;, NAME=&quot;tellstick&quot;, GROUP=&quot;www-data&quot;
</pre>  
</pre>  
<p>10. Reboot B3.<br />  
<p>8. Reboot B3.<br />  
</p>
</p>
<h1> Install HomeAutomation<br />  </h1>
<h1> Install HomeAutomation<br />  </h1>

Revision as of 09:58, 30 October 2013

This guide will help you to install the fantastic software HomeAutomation and the very neat piece of hardware Telldus Tellstick on a B3.

The information here is collected from various threads on http://forum.excito.net/, thank you DanielM and Moloko!


More about HomeAutomation is found here: <a href="http://karpero.mine.nu/ha/">karpero.mine.nu/ha/</a>

More about Tellstick is found here: <a href="http://www.telldus.se/">www.telldus.se/</a>

Install Tellstick

Conditions

  • Tellstick not connected to B3
  • Logged in as root on B3


1. Install telldus-core on B3. First edit the file /etc/apt/sources.list with for example nano:

nano /etc/apt/sources.list


Add the following line:

add the line: deb http://download.telldus.com/debian/ stable main 


Save and exit from nano.

2. The Telldus public key is needed. Run the command:

wget -q http://download.telldus.se/debian/telldus-public.key -O- | apt-key add -

The key fingerprint is

70C4 10C9 D73D 53E8 38B3 1C58 5A94 9181 E501 EA76
Telldus Technologies AB <info.tech@telldus.se>

3. Update the repository list by running the command:

apt-get update


4. Install the latest Telldus core by specifying its latest revision:

apt-get install telldus-core=2.1.1-1


5. Insert the Tellstick into B3

6. To add receiver units, edit the file /etc/tellstick.conf

nano /etc/tellstick.conf

Adjust the config file to your receiver units. In this case: 1pcs NEXA NEYCR-1000 and 1pcs NEXA LWMR-210.

deviceNode = "/dev/tellstick"
device {
id = 1
name = "Office"
protocol = "arctech"
model = "selflearning-switch"
parameters {
house = "112233"
unit = "1"
}
}

device {
id = 2
name = "Outside"
protocol = "arctech"
model = "selflearning-dimmer"
parameters {
house = "445566"
unit = "1"
}
} 

Some notes for tellstick.conf.

  • Change the values after the "house" parameter to a randomly chosen number. The uniqe numbers will make sure your units do not interfere with other units. Read about the Tellstick config file here: <a href="http://developer.telldus.se/wiki/TellStick_conf">developer.telldus.se/wiki/TellStick_conf</a>.
  • If using 'model = "codeswitch" ' the 'house' parameter should be a letter.
  • If you want to add more receiver units add more units to this configuration file.

7. Add an udev rule for the tellstick. Create the file:

nano /etc/udev/rules.d/99-tellstick.rules

Add the content:

KERNEL=="ttyUSB*", BUS=="usb", SYSFS{idVendor}=="1781", SYSFS{idProduct}=="0c30", NAME="tellstick", GROUP="www-data"

8. Reboot B3.

Install HomeAutomation


1. First of all install AT for scheduling on B3.

apt-get install at

2. Remove the user www-data from the files: /etc/cron.deny, /etc/at.deny, /etc/cron.allow and /etc/at.allow files (if they exist).

nano /etc/at.deny

3. Download the latest version of the HomeAutomation software to your PC, <a href="http://karpero.mine.nu/ha/index.php?page=download&hl=sv_SE">karpero.mine.nu/ha/index.php</a>

4. Unzip and place the files into /home/web/HA on your B3.

5. Edit the configuration file /home/web/HA/config_sample_linux.php. Change the search path in the configuration file to:

/home/web/HA 

6. Rename the configuration file config_sample_linux.php to config.php.

7. HomeAutomation needs the timezone to be set in Appache2. Edit the file php.ini:

nano /etc/php5/apache2/php.ini

Change the "date.timezone" to match your location (in example Europe/Stockholm).

”date.timezone = Europe/Stockholm”

8. Restart Apache:

apachectl restart

9. Change the ownership and priviliges for the folder /home/web/HA:

chmod -R 755 /home/web/HA/
chown -R www-data:www-data /home/web/HA/

10. Add a database for HomeAutomation.

mysqladmin create HADatabase

11. Open a web browser to configure HomeAutomation. Browse to http://b3/HA/ and follow the instructions.

Regarding the database information, use the following information:

Database name:"HADatabase" 

Usr: root

Psw: ”” (empty)

Connecting your receiver units

1. Connect your receiver unit/units into a wall outlet.

2. Connect a lamp in the receiver unit.

3. Turn the lamp power switch on (lamp will not lit).

Configuring your receiver units in HomeAutomation

1. Open a web browser. Browse to http://b3/HA

2. Log in with username 'admin' and password 'admin'.

3. Import your receiver units from the earlier edited tellstick config file (repeat this step every time you have edited the file: /etc/tellstick.conf).

3.1 Click the menu "Konfiguration" - "Enheter".

3.2 Click the text "Uppdatera från Tellstick".

4. Sync your NEXA units from the web UI:

4.1. In the UI, click the menu "Enheter".

4.2. Press the learn-button on one NEXA unit.

4.3. Click the lamp on in the web UI.

4.4. Make sure that the unit gets synched, the connected lamp will blink.


Now should everything be in place for starting to play with the settings and scheduling in HomeAutomation!

Good luck :)