Using Node-RED for publishing Telldus Live data to MQTT

Using Node-RED for publishing Telldus Live data to MQTT

Telldus has a set of nice little gadgets (“Tellstick”, for short) that both allow you to control remote switches over radio (433.92 MHz), and to read sensors transmitting on that same frequency. Telldus also has a backend service, Telldus Live, which offer Tellstick users scheduling features (turning lamps on/off at certain times, or when certain conditions occur), as well as showing the latest sensor readings.

The above is at least true if you have a Tellstick Net, which connects to your home network and sends device and sensor data to the Telldus Live service. You can also achieve the same thing with the non-connected Tellstick models, and an always-on computer running Telldus’ software.

Anyway – let’s assume that Telldus Live can see your switches, sensors and other connected devices. Would it not be cool if you could bring all that data into Node-RED, and from there create whatever feature you dreamt of.

How about sending an SMS when the  garage door is still open, but your presence data indicate that you have left for work? Easy.

Or the opposite: Send a tweet to your Node-RED server, which will then fire off an event to Telldus Live, turning a switch on, and by doing so closing the garage door? No problem.

As a start, here is a Node-RED function that will read out all device and sensor data from Telldus Live, and then publish it to a set of MQTT topics.

For me this means that I get access to the state of ca 15 radio controlled switches, as well as (and probably more interesting at this point) a dozen or so sensors. The log output for one of the sensors look like this – should give an idea of what kind of data is in there. In this particular case it’s the temperature inside our freezer, as well as the humidity outside of it.

sensor #0 getSensorInfo:
{ id: '<edited out>',
 clientName: '<edited out>',
 name: 'Freezer',
 lastUpdated: 1441023553,
 ignored: 0,
 editable: 1,
 [ { name: 'temp', value: '-24.7', scale: '0' },
 { name: 'humidity', value: '62', scale: '0' } ],
 protocol: 'mandolyn',
 sensorId: '12',
 timezoneoffset: 7200,
 battery: '253',
 keepHistory: '1' }
 uuid=teldus:<edited out>
 name: Freezer
 status: present
 battery: 253
 lastSample: 1441023553000
 lastSample: 2015-08-31 14:19:13
 temperature: "celcius"
 humidity: "percentage"
 temperature: -24.7
 humidity: 62

Once this data is published into MQTT, other Node-RED objects (or other MQTT clients running on some computer somewhere) can then pick up those messages and act on them as needed. I have been using this code during the past couple of months now, works REALLY well.

Node-RED-Telldus-to-MQTT-bridge on GitHub