IKEA Trådfri: lib-coap library

I get “Unable to connect” when I enter the security code for the IKEA gateway. I suspect that the issue is the lib-coap library. Can’t figure out how to install/configure this when running hass.io

It works quite well for me. Can you connect to Tradfri with your phone app? After a power outage, I need to stop HASS, restart Tradfri and then restart HASS. Even the app will not connect to the Tradfri after the power went out.

I’m not able to connect either, I’m getting the same as bmikaeln.
Is your Pi connected with ethernet or wifi?

Interested to know if this works with hass.io as the adjustable white temperature bulbs are on my shopping list as a cheaper alternative to buying more hue bulbs.

It’s connected via Ethernet and running Hass.io. Did you try manually adding the component to your config file? That’s how I did it.

Adding the component manually, shows an invalid config, but I’m sure of the configuration parameters, i used fing and looked at the devices in the router to be sure of the IP and I scanned the QR code on the bottom of the gateway, wich shows MAC_ADRESS,SECURITY_CODE, and I copied the text (the security code part) and pasted it. I checked, there’s no extra space in the end, I believe the parameters are fine. The gateway needs to be in any “special” state? Is there any other way to reboot the gateway without unpluging it? Thanks.

To help you troubleshoot, some info of what I did. I migrated to hass.io over the weekend and I added Tradfri lights. My pi is connected via ethernet.

  • installed Tradfri and tested with native Ikea Tradfri app
  • clean hass.io install
  • hass immediately detected hue and Tradfri lights so displayed the config cards (did not do it yet). I think the default config contains the discovery: component.
  • copied over my yaml configs (included the discovery: component, not the tradfri: component
  • ran the hue and tradfri configs and the basic setup was working
  • did duckdns and let’s encrypt afterwards

The only issue I had was that the tradfri security code had two lower case L characters and it was very difficult to know if it was a 1, a lower case L or a upper case i. Entering the code wrong also gives you the “Unable to connect” error.

Anyway, nothing special I did.

I’m going to test again in a hass.io clean install. I managed to test the tradfri security code, by removing the gateway from the tradfri app, and then adding it manually, by inserting the mac address and the security key.