IoT Home Automation



Download latest Raspbian image:

sudo raspi-config sudo apt-get update sudo apt-get upgrade

Wireless sensors

WT450H temperature and humidity transmitter and TellStick Duo USB receiver/transmitter.


There are many alternative installation instructions for telldus-core in the net. This one is proven to work with Debian in Raspberry Pi and BeagleBone Black:

sudo su
echo "deb-src stable main" >> /etc/apt/sources.list
wget -q -O- | sudo apt-key add -
apt-get update
apt-get build-dep telldus-core
apt-get install cmake libconfuse-dev libftdi-dev help2man
apt-get --compile source telldus-core
dpkg --install *.deb

Test installation:

tdtool -l

Message broker


Install MQTT Broker:

sudo apt-get install mosquitto mosquitto-clients
(sudo apt-get install nodejs npm)

In order to install td-mqtt-bridge, node needs to be upgrades:
Then install Telldus-MQTT bridge:

npm install td-mqtt-bridge --registry
sudo npm install -g forever --registry

Telldus to MQTT Bridge

Simple node.js bridge compatible with GaianDB and JSON databases. Requirements: net, mqtt.

npm install mqtt

Package: telldus-mqtt.tgz


 * Telldus-MQTT bridge
 * Parse messages from telldus-core and publish to local MQTT broker.
 * Jaakko Ala-Paavola 2014-08-22

var net = require('net');
var mqtt = require('mqtt');

var lasttime = 0, lastid = 0;

var publisher = mqtt.createClient(1883,'localhost');
var telldus = net.createConnection('/tmp/TelldusEvents');

telldus.on('connect' , function () {
    console.log("Connected to Tellstick.");

telldus.on('data', function(data) {
    var pos = data.indexOf("TDRawDeviceEvent");
    if (pos > -1)
	var measure={}, keyval=[];
	var arr = data.substr(data.indexOf(":",pos)+1).split(";");
	for (var i=0; i<arr.length; i++) {
	    keyval[i] = arr[i].split(":");
	    measure[keyval[i][0]] = keyval[i][1];

	if ( measure.class == "sensor" && 
	     measure.protocol == "mandolyn" &&
	     measure.model == "temperaturehumidity" )
	    // prevent duplicates
	    var now = new Date().getTime();

	    if ( != lastid || now > lasttime+1000)
		var topic = "gdb/sensor/temperature/""/celsius";
		console.log(topic+": "+measure.temp);
		publisher.publish(topic, measure.temp);

		var topic = "gdb/sensor/humidity/""/RH";
		console.log(topic+": "+measure.humidity);
		publisher.publish(topic, measure.humidity);
		lastid =;
		lasttime = now;
iot_ha.txt · Last modified: 2014/08/22 23:09 by jap
Recent changes RSS feed CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki