[Solved] My HA suddenly can't connect to Ikea Tradfri gateway

I have seen problems since a few days with my Ikea Tradfri integration.
No automations with Tradfri are executed.
I looked in the core logs and I get plenty of

2021-03-28 20:56:10 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: tradfri

I looked in the Ikea app and it says that a new gateway firmware (1.13.25) was installed March 25th.
Anyone that have seen same problem?

I’m running core-2021.3.4.

After rebooting the host I got this in the core log:

2021-03-28 21:07:01 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.1.71 for tradfri
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 248, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File “/usr/src/homeassistant/homeassistant/components/tradfri/init.py”, line 126, in async_setup_entry
devices_commands = await api(gateway.get_devices())
File “/usr/local/lib/python3.8/site-packages/pytradfri/api/aiocoap_api.py”, line 168, in request
result = await self._execute(api_commands)
File “/usr/local/lib/python3.8/site-packages/pytradfri/api/aiocoap_api.py”, line 152, in _execute
_, res = await self._get_response(msg)
File “/usr/local/lib/python3.8/site-packages/pytradfri/api/aiocoap_api.py”, line 96, in _get_response
r = await pr.response
File “/usr/local/lib/python3.8/site-packages/aiocoap/protocol.py”, line 731, in _run_outer
await cls._run(app_request, response, weak_observation, protocol, log)
File “/usr/local/lib/python3.8/site-packages/aiocoap/protocol.py”, line 783, in _run
blockresponse = await blockrequest.response
File “/usr/local/lib/python3.8/site-packages/aiocoap/protocol.py”, line 313, in send
request_interface.request(plumbing_request)
File “/usr/local/lib/python3.8/site-packages/aiocoap/tokenmanager.py”, line 243, in request
self.outgoing_requests[key] = request
TypeError: ‘NoneType’ object does not support item assignment

Hi Niklas

I have exactly the same error. Running core-2021.3.4 on Raspi 4. Home Assistant OS 5.12. The IKEA Gateway has Version 1.13.25.

What amazes me is that I can no longer ping the Tradfri Gateway. I believe that - probably until the update to version 1.13.25 - it still worked.

After I removed the Tradfri integration (and restarted HA), I was not even able to re-add the gateway. However, all of a sudden the Tradfri gateway reappeared as an auto discovered device in HA. With an APIPA address (169.254.x.y). :thinking:
After I re-entered the security key, the gateway started working again. What amazes me is that the configuration no longer works with the normal LAN IP (192.168.2.20). Although there is a DHCP reservation. Weird…

Edit: I could solve the DHCP-issue. It was a temporary problem with my Router/DHCP-Server. After rebooting the Tradfri Gateway could get its reserved IP-address. And i was able to configured it again by his LAN-IP.

Let’s hope that it now runs stable again.

Regards, Christian

I had a similair experience. Suddenly it just worked…