iKEA TRADFRI Timeout validating the code

I have this issue too (getting “Timeout validating the code” when trying to input the Security Code). I’m on 0.110.5, and I am putting in the correct string (it’s the Security Code, not the 8-digit number that it needs). I even tried restarting the Trådfri Gateway as mentioned here, but to no avail.

The Trådfri integration was working so so, but I had some defunct devices that I couldn’t get rid of, so I deleted it and tried to configure it from scratch and I started getting this error.

In the logs under Developer Tools, I see several instances of the following error:

2020-06-06 22:54:07 ERROR (MainThread) [coap] Exception CancelledError() can not be represented as errno, setting -1.
2020-06-06 22:54:10 ERROR (SyncWorker_2) [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 157, in _run
    yield from self._connecting
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 192, in _dispatch_error
    request.response.set_exception(OSError(errno, os.strerror(errno)))
asyncio.base_futures.InvalidStateError: invalid state

EDIT: Never mind, adding the integration manually works (but I have to also input the IP).

I have the same issue “Timeout validating the code”. I have version 0.111.1 installed.
I tried the following:

  • restarted HA
  • restarted Tradfri Gateway
  • Factory resetted Tradfri Gateway
  • Added the integration via Configuration -> Integrations -> “+” Symbol
  • Added the integration via configuration.yaml

I am sure that the code from the back of the gateway is correct. I scanned it via QR-Code.

Any suggestions on this?
I have no further idea how I can finally make the integration work.

Hello,
did you manage to solve the issue? I’m experiencing exactly the same.

It was corrected but the bug seems to be back!

Hi, finally it worked for me. I scanned the QR code to see if the security code under the gateway matches the one scanned and it turned out that I was confusing a “1” with capital “I” :man_facepalming:

1 Like

Hi,
Did you manage to solve this?
I have the same problem and have also tried everything :frowning: .
Do you have Zigbee installed? Just wondering if it could be a conflict.

BR Tony

The problem disappeared with 110.2 but now I have the same problem again. I get a time out when trying to add my new tradfri gateway to Home Assistant. I suspect the problem is in the tradfri firmware.

The only thing that worked for me was reinstalling hassio completly.

Oh no!
Did you restore folders and add-ons or did you have to reinstall that to?

I only made a backup of my config files and then I made a clean install from scratch. But with backup and restore it should work too.

Still not working here…

Hi it eventually worked for me…

When it responds timeout validating … just hit cancel and than I found a new integration registered but without security code. After that from the main integration panel if you open it it asks for the code again and it works this time !!!

Didn’t work for me, I don’t get any “new integration”. However do I have an old tradfri integration that I have removed. Maybe some code is left somewhere? anybody?

I found my problem, a bit embarrassing :slight_smile: . I tried all fixes and also to add it via “discovery” and via IP etc. in configuration.yaml with no success. As I mentioned it worked fine before but then I did some tessting and removed the IKEA intergration.
Now to the thing…I hade “hidden” under the menu “Ignored devices” the IKEA intergarion :frowning: . When removed an restart everything works fine again.

I hope this can help someone :slight_smile: .

Thank you Tiger, now my HA finds Tradfri but still getting the timeout message.

I had the same problem with the “Timeout validating the code” but then I tried the @maxton trick (scan the gateway QR code with your phone camera, then copy/paste resulting link into a text file, and then finally copy that into the Integration dialog) and it worked! Very clever!

Just so I could see the problem for myself, I copy/pasted my gateway’s Security Code into a text editor and changed the font to Courier where I could more clearly see that I was confusing a capital “I” (eye) for a lower case “l” (ell).

1 Like

Finding the tradfri is no problem, still getting the timeout.

Thank you. I got error message before when tying to connect with 2 O’s in the password so I thought I couldn´t use O in the password. After you answer, I tried again an now it works!

Maybe you have some errors in the password??

I used the code coming from the QR picture and it is exactly the same as the one I entered before.
Nothing works.