March 18, 2019

HomeKit bridge with Telldus Live

Updated 2019-03-18 !

Do You have Telldus devices up and running and want them to be visible and used in Apples Home app ?

With some software and a Raspberry Pi(RPi) they will appear in the HomeKit environment.

Other HomeKit posts on this Blogg

If You also have Z-wave products there is a parallel solution found in this post and if You have both Z-wave and Telldus devices there is no problem running them at the same time, on the same RPi and also together with native devices.

With Homebridge up and running, emulating HomeKit, install the Telldus Live plugin, TLP, that bridges the functions to Telldus live registered devices, with command

$ sudo npm install -g homebridge-telldus

For those who have a TellStick ZNet Lite Vx and want a local setup check here. (This setup will make Your schedules work without a working internet connection)

Now You have to fetch some keys from Your Telldus live account. These are used for the plugin so the RPi can log on and fetch the device info.
  • Go to https://api.telldus.com
  • Click on "Your keys" then login.
  • After the login click "Generate a private token for my user only"
  • Then click "Do You accept? Yes"
  • The next screen will show 4 rows of i keys and tokens, which will be used in the configuration file for the plugin.
If it is Your first HomeKit plugin copy the config file to the .homebridge/ folder and edit it so it matches the requirements for the plugin. Something like this,

{                                           
    "bridge": {                             
        "name": "Homebridge",               
        "username": "CC:22:3D:E3:CE:30",    
        "port": 51826,                      
        "pin": "031-45-154"                 
    },                                        
    "description": "Telldus plugin",          
    "platforms": [                          
      {                                     
       "platform" : "Telldus",              
       "name" : "Telldus Liv!e",            
       "public_key": "FEXXXXXXXXUNU",
       "private_key": "ZUXXXXXXXXX6EF",
       "token": "88XXXXXXXXXXXb7d",
       "token_secret": "a57XXXXXXXXXXXXXed5f"
      }                                     
    ]
}    

where You have copied the 4 keys and tokens You got from the Telldus website.

Start hombridge

$ homebridge

and if everything goes right it will show

[2018-8-16 11:41:26] Loaded config.json with 0 accessories and 1 platforms.
[2018-8-16 11:41:26] ---
[2018-8-16 11:41:26] Loaded plugin: homebridge-telldus
[2018-8-16 11:41:26] Registering platform 'homebridge-telldus.Telldus'
[2018-8-16 11:41:28] ---
[2018-8-16 11:41:28] Loading 1 platforms...
[2018-8-16 11:41:28] [Telldus Liv!e] Initializing Telldus platform...
[2018-8-16 11:41:28] [Telldus Liv!e] isLocal: false
[2018-8-16 11:41:28] [Telldus Liv!e] Loading accessories...
[2018-8-16 11:41:28] [Telldus Liv!e] Found 2 sensors in telldus live.
[2018-8-16 11:41:28] [Telldus Liv!e] Device 1513975707 has no name from telldus, ignoring
[2018-8-16 11:41:28] [Telldus Liv!e] Creating acc. ID 774082. Name from telldus: Framledning 11
[2018-8-16 11:41:30] [Telldus Liv!e] Initializing platform accessory 'Framledning 11'...
Setup Payload:
X-HM://0023ISYWYGKAF
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:

Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:
                       
    ┌────────────┐     
    │ 031-45-154 │     
    └────────────┘     
                       
[2018-8-16 11:41:31] Homebridge is running on port 51826.

Run Your Home App again and add Homebridge and the accessories will appear.

Then configure autostart at power on/failure with this post (systemd).

Restart the RPi

$ sudo reboot

and now all should be up and running.
If You are adding new devices You have to reboot the RPi for a new initialization.

If You also are having Z-Way devices here is a congfig.json for several plugins.


HB autostart at power on and failure, installed with a script !! , is found here.

Instructions updating the installation is found here


A post for connecting temperature sensors direct to RPi and show in Homekit.

43 comments:

  1. Worked great. Thank you!

    I had to manually configure the Nexa switches in config.json to get them to be recognized.

    "unknown_accessories": [
    {
    "id": 12345,
    "model": "selflearning-switch",
    "manufacturer": "Nexa"
    },
    {
    "id": 23456,
    "model": "selflearning-switch",
    "manufacturer": "Nexa"
    },
    {
    "id": 78901,
    "model": "selflearning-switch",
    "manufacturer": "Nexa"
    },
    {
    "id": 234567,
    "model": "selflearning-switch",
    "manufacturer": "Nexa"
    }
    ]

    ReplyDelete
  2. Thank you so much! This is the first, simple, up to date, guide I have found for this. I had my Homebridge up and running but the autostart on boot was new to me. Thanks!

    ReplyDelete
  3. Hi,
    Everything works fine, but i dont get the autostart to work.
    The file looks like this.
    # Print the IP address
    _IP=$(hostname -I) || true
    if [ "$_IP" ]; then
    printf "My IP address is %s\n" "$_IP"
    fi

    su -c "screen -dmS homebridge homebridge" -s /bin/sh pi

    exit 0

    Have any idea about why it dont work?

    ReplyDelete
    Replies
    1. Hi, updated the post with second way to autostart

      Delete
  4. Awesome write-up, so simple to follow, thanks a million!

    Is there any way to expose it to the outside, so that I can use it while away from home?

    God fortsättning!

    ReplyDelete
    Replies
    1. Hi ! Setting up a ATV4 or a iPad as a hub will solve the problem. The first link in this post"Apples HomeKit" will guide You, Mats

      Delete
  5. Thanks for great guidance. I have noticed another way to autostart, that is to use systems. Have you considered it? The advantage of that method is that home bridge would autostart by itself in case of a crash.

    ReplyDelete
  6. sorry, it should be systemd instead of systems above.

    ReplyDelete
    Replies
    1. HI! I'm not that familiar to systemd, but maybe You can add info which I can publish ? Mats

      Delete
  7. Here is a link to a guide to get systemd working:
    https://timleland.com/setup-homebridge-to-start-on-bootup/

    And here is the link to Homebridge github page where they discuss different ways to autostart homebridge on boot.
    https://github.com/nfarina/homebridge/wiki/Running-HomeBridge-on-a-Raspberry-Pi

    ReplyDelete
    Replies
    1. New post, systemd and homebridge
      http://pysselilivet.blogspot.com/2017/01/homebridge-autostart-with-systemd.html

      Delete
  8. Om jag redan har en fungerande homekit men vill lägga till telldus hur gör jag då den jag redan har ser ut såhär
    -----------------------------------------

    {
    "bridge": {
    "name": "Homebridge",
    "username": "CC:21:3E:E4:DE:33",
    "port": 51826,
    "pin": "031-45-154"
    },
    "description": "Configuration file for (e)xtended Domoticz platform.",
    "platforms": [
    {
    "platform": "eDomoticz",
    "name": "eDomoticz",
    "server": "127.0.0.1",
    "port": "8080",
    "ssl": 0,
    "roomid": 0,
    "mqttenable": 1,
    "mqttserver": "127.0.0.1",
    "mqttport": "1883",
    "mqttauth": 0,
    "mqttuser": "",
    "mqttpass": ""
    }
    ],
    "accessories": []
    }
    ----------------------------------

    ReplyDelete
  9. Test the config.json file at the link below but change to Your own Telldus Live keys/token. https://gist.github.com/MatsA/59526d2be3ea12bf4d04d6374ec0ed50

    ReplyDelete
  10. Stort tack, detta hjälpte verkligen!
    Dock får jag ingen av mina accessories att initialize utan tvingas sätta samtliga under unknown_accessories. Alla är z-wave, vet du om det ska vara så? Är alla dina 433? Tack på förhand, Johan

    ReplyDelete
  11. OK, thanks. I'm just having 433 devices via TellstickNet HW. Z-wave devices is connected via a Razberry card on the same RPi. Have not done any extra configuration.

    ReplyDelete
  12. Hi! I have followed all the steps but in my Apple Homekit-app onlys the sensors works, all my ON/OFF-connecteros says not supported (Stöds ej), any idea what could be wrong?

    ReplyDelete
    Replies
    1. Hi ! check the log with "less /var/log/syslog" to see if there are any hints, q= quit. Or maybe You have to configure them manually. Check the first comment in this post

      Delete
    2. It works after I configured them manually, thanks for the help and and good guide :)

      Delete
    3. Hi,

      I'm having the exact same issue, that my 433 MHz Nexa switches are "Not supported" in the Home app. I'm pretty sure I've got the ID's right, and I've configured them as selflearning-switch.

      Any ideas?

      Delete
  13. I used this tutorial to make the devices controlled by my Tellstick NET visible in the iOS Home app. No issues with that. Thanks!

    However, I have two "locations" on the same Telldus account, the other one being in a completely different physical place (and different network too, of course).

    Any ideas what would be the best way to get that one into HomeKit too? A second RPi at the other location? Or should I setup a VPN between the two local networks?

    I see all the 2nd location remote switches in HomeKit but they are shown as "Not supported" at the moment.

    ReplyDelete
  14. Hi ! a very god question. I have no distinct answer but the VPN solution seems nice to avoid another RPi. Especially if You also have enabled remote access via an Apple TV or iPad, in this case You should only need one for both places. Would appreciate feedback how You solved it./Mats

    ReplyDelete
    Replies
    1. It seems that since Bonjour is used to advertise the service on the RPi, it's not that easy because Bonjour services aren't visible across a VPN. I'm definitely a newbie on stuff like this, so I may be wrong, but no success so far.

      I now have 1st location with [Tellstick NET, RPi w/homebridge, OpenVPN server], and 2nd location with [OpenVPN client, Tellstick ZNet Lite v1].

      Delete
    2. One way is to create an "Issue" on https://github.com/jchnlemon/homebridge-telldus/issues so smarter guys than me could answer/Mats

      Delete
  15. Great instruction!. Many thanks.
    Works perfect for me (without any previous skills).

    However I can not get my rain sensor (Oregon PCR800) and UV Sensor (UVN800) to work. Is it possible. It says not supported (stöds ej). However they work with tells and are supported on the tells live-homepage and app.

    Any suggestions to fix it?

    Many thanks!

    ReplyDelete
  16. Hi and thanks !
    Check the log when Homebridge is starting up and then manually configure, as done in the first comment in this post. That should help. /Mats

    ReplyDelete
  17. Finns det ngn versionshistorik för homebridge-telldus? Så att man vet vad man får om man uppgraderar, dvs om det är värt mödan...Speciellt för versioner 1.XX

    ReplyDelete
  18. You can se all the commits on Github. 1.xx is talking direct to ZNet Lite.

    ReplyDelete
  19. Fantastisk guide, tack för att det finns människor som du som gör att livet blir lite lättare för oss andra.

    Bockar och bugar det ödmjukaste

    Uffe

    ReplyDelete
  20. Veldig bra! Takk for en veldig enkel step by step guide.

    Har nå masse automasjon i hjemmet takket være innlegget ditt!
    Takk igjen, Mvh. Kenneth - Trondheim

    ReplyDelete
  21. Är det ngn skillnad mellan lokal konfiguration av telldus live mot guiden ovan som går via molnet?
    Är det bara config.json som skiljer sig? Föredrar du molnvarianten?

    ReplyDelete
    Replies
    1. Yes there is a difference in the setup, see instructions on Github. If You have done the local config You are not dependent on a working internet connection for Your schedules.

      Delete
  22. Then I need to configure the Telldus Controller to have static IP-adress?

    ReplyDelete
    Replies
    1. Yes, it’s the best way, despite the most gateways reuse the IP.

      Delete
  23. Is there any difference to add Tellstick Znet Lite v2 (only Telldtick Znet Lite is mentioned above)

    ReplyDelete
    Replies
    1. Have not tested, but taking for granated that they will function both. The V2 can also receive 433 MHz

      Delete
  24. My ”unknown_accessories” does not work...

    "unknown_accessories": [{ "id": 27, "model": "MODEL", "manufacturer": "unknown" }]
    Valid models are: selflearning-switch, codeswitch, selflearning-dimmer, temperature, EA4C, temperaturehumidity, 1A2D, window-covering, switch

    I have also tried to disable some of the devices, but i still get the same error.
    Any idea??

    ReplyDelete
    Replies
    1. Sorry to say, never had that problem. Google is your friend ;-)

      Delete
  25. I have tried Google and youtube, but i can not fint anything.. Can you show me a part of your config file so i can try to see what i did wrong?
    Happy new year!

    ReplyDelete
    Replies
    1. As you see in my config I'm not using ”unknown_accessories”. Please check the log and the other comments in this post. Use forums or put an issue on Github.

      Delete

Feel free to leave a comment ! ... but due to a lot of spam comments I have to moderate them. Will reply ASAP !