IKEA Trådfri broken?

Hi I’m using HA 0.94.4 and my gateway is at 1.8.26.

But home assistant fails to connect to the Gateway, i can connect using the normal Trådfri app and control my lights.

The following can be found in my log:

2019-06-25 18:03:00 INFO (MainThread) [homeassistant.setup] Setting up tradfri
...
2019-06-25 18:03:00 INFO (MainThread) [homeassistant.setup] Setup of domain tradfri took 0.1 seconds.
...
2019-06-25 18:03:01 ERROR (MainThread) [coap] Fatal DTLS error: code 115
2019-06-25 18:03:01 ERROR (MainThread) [coap] Exception CancelledError() can not be represented as errno, setting -1.
2019-06-25 18:03:01 ERROR (MainThread) [coap] Fatal DTLS error: code 115
2019-06-25 18:03:01 ERROR (MainThread) [coap] Exception CancelledError() can not be represented as errno, setting -1.
2019-06-25 18:03:01 ERROR (MainThread) [coap] Exception CancelledError() can not be represented as errno, setting -1.
2019-06-25 18:03:01 ERROR (MainThread) [coap] Exception CancelledError() can not be represented as errno, setting -1.
2019-06-25 18:03:01 ERROR (MainThread) [homeassistant.components.tradfri] Tradfri setup failed.
...
2019-06-25 18:03:01 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiocoap/transports/tinydtls.py", line 141, in _run
    remote_addr=(self._host, self._port),
  File "uvloop/loop.pyx", line 2961, in create_datagram_endpoint
  File "uvloop/loop.pyx", line 2958, in uvloop.loop.Loop.create_datagram_endpoint
concurrent.futures._base.CancelledError
 
During handling of the above exception, another exception occurred:
 
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiocoap/transports/tinydtls.py", line 169, in _run
    self.coaptransport.new_error_callback(-1, self)
  File "/usr/local/lib/python3.7/site-packages/aiocoap/protocol.py", line 203, in _dispatch_error
    for key, (monitor, cancellable_timeout) in self._active_exchanges.items():
AttributeError: 'NoneType' object has no attribute 'items'
2019-06-25 18:03:01 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiocoap/transports/tinydtls.py", line 141, in _run
    remote_addr=(self._host, self._port),
  File "uvloop/loop.pyx", line 2961, in create_datagram_endpoint
  File "uvloop/loop.pyx", line 2958, in uvloop.loop.Loop.create_datagram_endpoint
concurrent.futures._base.CancelledError
 
During handling of the above exception, another exception occurred:
 
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiocoap/transports/tinydtls.py", line 169, in _run
    self.coaptransport.new_error_callback(-1, self)
  File "/usr/local/lib/python3.7/site-packages/aiocoap/protocol.py", line 203, in _dispatch_error
    for key, (monitor, cancellable_timeout) in self._active_exchanges.items():
AttributeError: 'NoneType' object has no attribute 'items'

I’m using docker-compose and have the following:

  home-assistant:
    image: homeassistant/home-assistant:0.94.4
    restart: unless-stopped
    network_mode: "host"
    volumes:
      - /home/peter/data/home-assistant:/config
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    devices:
      - /dev/ttyUSB0
      - /dev/ttyACM0
    extra_hosts:
      - "tradfri:192.168.0.17"

My trådfri configuration:

tradfri:
  host: tradfri
  allow_tradfri_groups: true

All devices are marked as (entity unavailable):

I have also tried to restart the gateway and home assistant.

What could be wrong?

A few hours ago someone had the same problem.

I’m somewhat confused, i removed the integration and added it again, that imported the lights but all groups where missing (i can live with that).

But if i restart home assistant its gone again and i have to do the process all over again.

I will collect some logs while doing this later this week.

Sadly it seems to break after some time…

Am seeing the same problem, I wonder if it related with the Tradfri gateway only…
if thats the case am going to move to zigbee2mqtt.

Mine is up and running again, i deleted alot of files then i disabled the auto discovery and added it with yaml, so far it seems stable.

Mine has starting to loose connection to…it started after one or two trådfri uppdatera ago. This also happens in the trådfri app and I first need to reconnect the trådfri app, then delete the trådfri integration in hass, reboot Hass, redo the integration again. Then it works for half a day or so… I get this message in trådfri everytime it fails:

I also have no connection since a Tradfri update. Now I would have to register and assign 17 devices again…

I plan to switch to zigbee2mqtt anyway. Components are ordered in China.

same issue here.
i got the same error messages i think i got an update from ikea after that it broke.

Same here light become unavailable after some time.
Restart of HA does solve it for some time that is
Running the latest ha and the ikea firmware is 1.8.26

I can confirm I see kinda the same behavior.
The bulbs in HA becomes Unavailable, but strange enough - I can still manage the bulbs within the IKEA App.

If I restart HA, the lights will become available again.

Just a reminder to all that if Trafri firmware is updated, you need to reset the setup as per https://www.home-assistant.io/components/tradfri/

I started to have the same problem last wednesday, after running without any problems for more than 6 month. The gateway can’t be reached after 2-12 hours and the only thing helping is a reboot of the gateway. Firmware 1.8.26.

It is not a Home Assistant problem because just as @Christian_Hollbjar I can’t reach the gateway with the Tradfri-app.

Have tried factory reset of the hub. I have tried removing the integration from HA and even without the integration running on HA, the gateway stops working after a couple of hours. I have tried restarting my router.
I notice that even if the gateway can’t be reached I can still see that it is connected to the router and has the correct static IP that I have assigned to the gateway.

Any one managed to solve this issue?

I have this phenomenon too. It occurs if i restart HA more than once or twice.
I have to reboot the IKEA gateway and after that HA in order to get things working again.

Relevant errors in logs:

2019-09-17 12:48:56 ERROR (MainThread) [coap] Exception CancelledError() can not be represented as errno, setting -1.
2019-09-17 12:49:00 ERROR (MainThread) [homeassistant.components.tradfri] Tradfri setup failed.
|arch|x86_64|
|---|---|
|dev|false|
|docker|false|
|hassio|false|
|os_name|Linux|
|python_version|3.7.3|
|timezone|Europe/Stockholm|
|version|0.98.5|
|virtualenv|true|

I got this problem as well with 0.100.X
Tried to move to Zigbee2Mqtt this summer but stability of the Ikea tradfri made me go back to using the officall gateway again.
Many times the Zigbee2Mqtt commands was fired but not carried out by the lamp. How is that even possible with the Syn/Ack protocoll of Zigbee compared to 433Mhz???

Anyway moved back to offical gateway and it was flawless untill I upgraded to 0.100.X.
I can see alot of refactoring in the code in the release but not sure if that have any impact.
Did you guys ever solve this problem?