Using Node-RED to extract Telldus Live data to MQTT
Posted: Fri Mar 17, 2023 9:45 am
The subject says it all...
Before the summer I pulled various pieces together and ended up with something rather nice.
Using Node-RED I connect to Telldus Live, from there downloading all device (i.e. switches etc) and sensor data. Worth noting that what you get is not only (for example) the temperature for the sensor, but also battery status, timestamp for last data received from the sensor etc.
Lots of useful information in there.
Once the data has arrived in the Node-RED function (which is just Javascript, so it will work equally well in a standalone Node.js application), MQTT messages are published, with one topic for each device/sensor attribute.
The beauty of this is that MQTT is absolutely AWESOME for machine-to-machine communication.
Other parts of your Node-RED workflow can then pick up the data for the sensors or devices they are interested, and build cool/useful features on top of that data.
Sending a frost alert over Twitter becomes trivial, for example.
Also, there is nothing stopping other apps (non Node-RED) from subscribing to the MQTT topics and act on them once they arrive. You could for example have a small Python app that listens to certain MQTT topics and store whatever data that comes along into a SQL database, for later visualisation.
Very flexible and way easier to maintain than creating a bunch of small apps that each pull out different subsets of the Telldus data.
More info at https://www.ptarmiganlabs.com/2015/08/3 ... a-to-mqtt/
/Göran
Before the summer I pulled various pieces together and ended up with something rather nice.
Using Node-RED I connect to Telldus Live, from there downloading all device (i.e. switches etc) and sensor data. Worth noting that what you get is not only (for example) the temperature for the sensor, but also battery status, timestamp for last data received from the sensor etc.
Lots of useful information in there.
Once the data has arrived in the Node-RED function (which is just Javascript, so it will work equally well in a standalone Node.js application), MQTT messages are published, with one topic for each device/sensor attribute.
The beauty of this is that MQTT is absolutely AWESOME for machine-to-machine communication.
Other parts of your Node-RED workflow can then pick up the data for the sensors or devices they are interested, and build cool/useful features on top of that data.
Sending a frost alert over Twitter becomes trivial, for example.
Also, there is nothing stopping other apps (non Node-RED) from subscribing to the MQTT topics and act on them once they arrive. You could for example have a small Python app that listens to certain MQTT topics and store whatever data that comes along into a SQL database, for later visualisation.
Very flexible and way easier to maintain than creating a bunch of small apps that each pull out different subsets of the Telldus data.
More info at https://www.ptarmiganlabs.com/2015/08/3 ... a-to-mqtt/
/Göran