Tradfri 1.8.25 - offline - communication_error

I got it working with following steps:

  • Install pytradfri from here
  • Connect to to the gateway with python3 -i -m pytradfri IP
  • Enter Security Code of the gateway

You can now find the generated Identity in the first lines. It looks like
DEBUG:pytradfri.api.libcoap_api:Executing $GATEWAY_IP post ['15011', '9063']: {'9090': 'xxx-your-identity'}

The new pre shared key is a line after and looks like
DEBUG:pytradfri.api.libcoap_api:Received: {"9091":"xxx-your-preshared-key","9029":"1.8.0025"}

With that info you can now connect to the gateway again via the Paper UI in Openhab Things.

  • Add a new Tradfri Gateway
  • Enter Security Code
  • Click on ‘Show More’
  • Enter Identity and PSK
  • Save

When the gateway is back online again go to all relating things, click edit and update the selected gateway there.


I did what you did, but this morning the gateway was offline again.
I have never used config files, just paperUI.
Unsure of what to try next …

@OMR if you use paper ui you can keep using it. In fact you should not have an issue.

I would suggest going back to paper ui. Configure normally by adding the code from the back of gateway. All should just work.

This thread was for an issue when people use config files.

That was what I thought too, so thank you for clarifying.
But I wonder why I get

Gateway was offline when I got home from my Easter vacation. I got it Online several times, but it did not stick. I wonder if it could be related to the Gateway trying to update my 10+ 5 button remotes. Noticed now that several has run out of battery because of the update …
So at the moment, no manual backup either. Must go shopping for CR2032s.
If it keeps bugging me, I have both a HUE and Conbee gateway I can move the lights to.

Yes it’s possible the updates are causing an issue.
If you have not done so, ping gateway ip from a computer make sure it responds then.
I would try deleting the gateway thing from openhab.
Shutdown openhab
Cycle power on gateway
Clear cache
Start openhab.
Add gateway in paper ui

In all the changes I did not clear cache once and had an error. May or may not have been related but a cache clear then start fixed if.

Thanks for pitching in.
I have done som more testing, and it looks like the Ikea Gateway partially hangs.
I can always ping it.
After I manage to get it Online after numerous bundle:restart in karaf, it only stays online for a couple of minutes, 30min max.
Strange thing is that when it goes Offline, I’m not even able to connect with the Ikea Android App.
After power cycling the gateway, it comes Online again for a while.
I have 9 remotes with status Update pending …
Strange behaviour.
Think I will try stopping the bundle while the gateway is Updating the remotes.

I had some trouble with the app when my remote was updating also. I suspect the waiting updates are the issue. Keep us posted!

Maybe I am missing something but I too am having issues with the Tradfri binding after the update. I have followed the suggestions in this thread and done the following:

  1. comment out Things file entries for Tradfri
  2. add gateway via inbox of PaperUI
  3. entered the code from gateway into Thing configuration
  4. restarted services
  5. expanded show more to retreive the identity and pre-shared key
    This is where things get messy. The pre-shared key is just **********.

Where can I get the actual key?

I have tried with just “” for key but it still isn’t working.

Thank you,

Hi Jason,
you may get pre-shared key via rest interface:


Use your IP/hostname with standard port 8080 and with your Tradfri gateway UID (taken from PaperUI).

Actually, I simply copied and pasted the ******** from the pre-shared key field in PaperUI into my Things file; it “magically” transformed from the series of dots into the plain ASCII sequence (which in my case is the code from the gateway anyway)

This was my solution.

I tried stopping OH, clearing tmp and cache, restarting gateway, starting OH. Gateway was not autodiscovered and “adding manually” security and pre-shared key got pre-filled.

I downloaded pip for python 3.5:
sudo curl -O
sudo python3.5

installed pytradfri:
sudo pip3.5 install pytradfri

python3 -i -m pytradfri (192.mygateway-IP)

Found a line:
DEBUG:pytradfri.api.libcoap_api:Executing myip post ['150XX', '90XX']: {'90XX': 'eff3079481a24f1f9b9f8XXXXXXXXXX'}

Typing eff3079481a24f1f9b9f8XXXXXXXXXX’ as identity got the Gateway online in no-time :facepunch::facepunch:

Today’s report. (not config file related, using paperUI only).

After stopping the bundle through the night, the gateway survived, but no remotes were updated when I checked this morning.
I then gathered my 9 remotes within 1m from the gateway, power cycled it and left for work.
(I also pulled the power on a HUE bridge 1m away ensuring it was not interfering on another channel).
Arriving home some 9hrs later, none of the remotes had received any update, all still pending.

Now, this is what did the trick. Remove and re-insert the battery on each remote.
Within 15-20min one by one (~15min each) they got updated until only 3 remained.

I measured the battery voltage on the ones that was still pending, and they were all just 2.9V. (they still controlled their lights OK)
After inserting fresh batteries (starting at 3.2V, but ended at 3.1/3.0 after being inserted in the remote), the 3 remaining ones was updated within 30min as well.
I then started the Ikea bundle and the Ikea items came Online at once, only to go Offline some minutes later.
I then power cycled the gateway (first power-cycle after it had updated the 9 remotes) and it looks good now after more than 1hr. Lets see what happens during the night…

Edit: still OK this morning …
Edit2: still OK in the evening.

This proves that coap communication during firmware update of remotes can kill the gateway.
I manage a second site with fever lamps and remotes, and the only thing I needed to do there was restart the bundle after the gateway updated and restarted. The new gateway firmware did not help with this issue. Still flaky.

1 Like

Final report.
The 1.8.25 firmware update totally wrecked my gateway connection.
After trying all in my previous post, I had to find a pin and reset the whole thing.
Took the opportunity to transfer the majority of my devices to my conbee/deconz setup, so after the hard reset, I now have only the gateway, one remote and one E27 CT bulb.

See here for more details.

What is the syntax for the things file if i want to separate Bridge and things?

Not sure what you mean…

Bridge tradfri:gateway:gwb8d7 [ host="", identity="12d45", preSharedKey="7gaCh" ] {
    0830 Remote1 [ id=65536 ]
    0210 ColorBulb1  [ id=65537 ]    
    0220 Bulb1 "Office Window" @ "Office" [ id=65538 ]    
    0220 Bulb2 "Floor Lamp" @ "Livingroom" [ id=65539 ]   
    0220 Bulb3 "Oliver Window" @ "Oliver" [ id=65540 ]    
    0220 Bulb4 "Bench" @ "Bedroom" [ id=65541 ]    

This is a way to do it. but it i want to separate Bridge and things.

Bridge tradfri:gateway:gwb8d7 [ host="", identity="12d45", preSharedKey="7gaCh" ] 
Thing tradfri:0830:gwb8d7:Remote1 [ id=65536 ]

Then i can have the bridge in PaperUi and things in file.

IC. I have only done it the other way around. Brigdes in things files and things in paperUI.
What is the advantage of having things in a things-file?

For me, the new firmware gave me zero crashes since installation (about 10 days).
Keep fingers crossed!


I can confirm that power cycling the remotes triggers the upgrade after they all got struck in pending state (and the gateway was unresponsive).

1 Like

I got the same problem. Every couple of days the connection drops. And cannot reastablish…

I had been happy for a long while till recently