Listing all Telldus Live devices in Node-RED

Tellstick Net and DuoContinuing from the previous post about publishing data from Telldus Live to MQTT, here is small piece of related Node-RED code. It outputs a list of all (wirelessly controlled) 220V/mains switches I have linked to Telldus Live, using a Tellstick Net.

The background of the code was simply that I wanted a convenient way of getting a complete list of all devices (switches, dimmers, door bells, …) known to my Telldus Live account. When testing different devices, moving them around, renaming them etc, it is very easy to loose track of which device does what, and what their respective IDs are. This little function solves that quite nicely.

Using the device is easy:

  • Make sure the node.js wrapper for the Telldus Live API is installed and accessible to Node-RED
  • Configure the Telldus Live user credentials in the function node
  • Attach some kind of input node as a trigger (an injector node works well)
Reading device names and IDs from Telldus Live

The node will create one output message for each device in Telldus Live, as shown above. The same information is also written to the console log (easy to disable if it’s too spammy).

Code is found in the tellduslive-list-all-devices.js file over at GitHub.

13 Replies to “Listing all Telldus Live devices in Node-RED”

  1. Trying to run this but get “TypeError: Cannot read property ‘TelldusAPI’ of undefined” … I’ve run npm install, but am not sure what else needs to be done to make it accessible to node-red.


    1. Hi Nick,

      I need a bit more context to understand what’s going on. Any chance you could paste in a bit more of the error message, such as what lines the error occur at, in what file etc?

      1. Hi, thanks. In node-red I have put in the basic example to list all devices. So, it looks like it’s failing when trying to create the object.

        cloud = new{ publicKey : publicKey
        , privateKey : privateKey });

        From what I can see, the npm successfully installed.

        └─┬ telldus-live@0.2.1
        ├── oauth@0.9.14
        └── underscore@1.5.1

        However I’m not sure how to make “accessible to node-red” as per your instructions.


  2. Figured out that one must add the module to the functionGlobalContext object in settings.js (thethingbox.js for Thingbox): … ,telldusLive: require(‘telldus-live’) …


    1. Aha, figured it. I copied and pasted and had some odd speech marks. Corrected those and it works. Fantastic. Been trying for ages to get this going. So, now have lots of things to play with now!


      1. Hi Nick,
        Good to see you made the MQTT publish from Telldus Live. I’m in the beginning of the same project and asking if you if it’s possible for you to write down each step in Node-Red?


    1. Ohhh, it’s been a long time since I wrote that code..
      That said, that code has been running nicely for years here, so I am pretty sure Telldus’ APIs have not changed.
      The undefined error indicate that you fail to instantiate an object somewhere, try backtracing the code from where the error occured, to where the underlying object is created.
      I know – hard to explain in a short sentence like this. Very swamped during coming weeks, unlikely thus that i will be able to look into this in more detail. Sorry :/

  3. Hi,

    I have used your code on a Tellstick Net for quite a while now and it works perfectly.

    Do you know if the same code will work on TellStick ZNet Lite v2 now that Telldus have an uppgrade program?

    1. Yes it does.
      There is nothing device specific about the Node-RED code. I am in fact using a TellStick ZNet Lite v2 myself.
      The Node-RED code pulls its data from Telldus APIs, i.e. whatever data is sent there by your sensors will be available in Node-RED.

    2. hur fick du det att funka ? . jag försöker och försöker här men det vill sig inte .

  4. OK. If somebody (like me..) is trying to use Node-red + Telldus-live with new Raspberry 4 + Raspbian v 10 (Buster), it’s going to be more tricky. Here’s a short memo of my 3 days debugging:

    – Clean Buster install + updates, OK
    – Clean node-red installation, OK

    Here I got confused:

    I thought I have to install Tellstick drivers ( and it’s not an easy task for Buster.

    >> But, as far as I know this is not necessary for Telldus Live integration! So skip this part.<

    – Newest Node version has some kind of new TLS/SSL version, which is not supported by Telldus API.
    – Install “n”(
    – Install older Node version, ver 9.0.0 works for me

    n 9.0.0

    It should download and make it active. If not, just type “n” without quotation marks and select version. You can check Node version:
    node -v

    Restart Node-red:

    – Download sample code e.g.

    Copy and paste that directly into new “function” node in Node-red.
    Get your private API key and passphrases by logging into
    Change those keys inside function code.


Leave a Reply

Your email address will not be published.