Tradfri gateway going offline every few days

I think the problem is in the binding somewhere. Seeing that disabling and then re-enabling the gateway item in the paper ui works. Also since there seem to be no issues with the official app. Maybe Ikea changed something in their FW that is causing issues with the binding.

@roli this issue has been on going for some for many months since a firmware change.

I have configured my tradfri in paper ui and since doing that had no issue on the latest openHAB version.

I do agree with you that there could be a conflict somewhere between tradfri binding and some other thing as only some people have this issue.

I had this issue, which has now cleared since either switching to things file, or the fact the gateway reset itself.

I would move to a things file. Even if you just create a thing for the bridge and add it along side your autodiscovered thing. This way if your auto thing goes offline but your thing file thing is still connected then there is your answer.

1 Like

I’ll try moving to a things file, I’ll keep you updated!

When I came home, the bridge is offline and the log contains:

2020-02-03 18:53:16.417 [DEBUG] [al.discovery.TradfriDiscoveryService] - Adding device tradfri:0210:gwdcefcaba3a07:65541 to inbox
2020-02-03 18:54:16.088 [DEBUG] [g.tradfri.internal.TradfriCoapClient] - CoAP GET request
uri: coaps://192.168.1.134:5684/15011/15012
2020-02-03 18:54:16.091 [DEBUG] [.tradfri.internal.TradfriCoapHandler] - CoAP onError
2020-02-03 18:54:16.093 [DEBUG] [.tradfri.internal.TradfriCoapHandler] - CoAP onError
2020-02-03 18:54:16.095 [DEBUG] [ternal.handler.TradfriGatewayHandler] - Gateway communication error. Forcing session resume on next command.
2020-02-03 18:55:16.091 [DEBUG] [g.tradfri.internal.TradfriCoapClient] - CoAP GET request
uri: coaps://192.168.1.134:5684/15011/15012
2020-02-03 18:55:16.095 [DEBUG] [.tradfri.internal.TradfriCoapHandler] - CoAP onError
2020-02-03 18:55:16.099 [DEBUG] [.tradfri.internal.TradfriCoapHandler] - CoAP onError
2020-02-03 18:55:16.100 [DEBUG] [ternal.handler.TradfriGatewayHandler] - Gateway communication error. Forcing session resume on next command.
2020-02-03 18:56:16.102 [DEBUG] [g.tradfri.internal.TradfriCoapClient] - CoAP GET request

I will now configure a things file and keep my fingers crossed :slight_smile:

And I have just tried removing the gateway thing and re-adding it, to see if this will change anything. Because it’s starting to drive everyone around the house insane. Especially when you can’t turn on the light at 5 in the morning because of a stupid bug and you have to use your phone to do it.

Hi. Facing the very same situation here. My tradfri getaway gets offlined in Openhab on a regular basis, while still able to manage through home assistant or google home. Of course, any depending device was also getting offlined. Each time it happened, I had to provide the key again in thing configuration, then it went back online. Then, based on Roli’s post, I noticed that just disabling and re-enabling the gateway thing is sufficient to get everything back online. I’m using the latest version of tradfri FW, with 12 devices connected, and openhab 2.5.1-2.
Quite strange behavior.
It would be great to have a solution from Ikea, and not workarounds to revive the gateway when noticing it gets offline.
Currently evaluating moving to any other reliable documented gateway… Ikea’s smart stuff doesn’t seem so smart …

Well I tried the thing that I mentioned above… I deleted the gateway item from openhab (just the gateway, I left the rest alone) and then re-discovered it. It’s now been 8 days since I tried that, and I don’t seem to have any issues anymore.

I. Implented a workaround. Added crontab entry that restarts the openhab service 3am every night. It has been running smoothly for one week now

So after updating the Openhab to 2.5.2 last week, the above problem with Tradfri is back. And this time removing the gateway and adding it again didn’t solve the issue. :frowning_face:

When openhab eventlog report this:
[hingStatusInfoChangedEvent] - ‘tradfri:gateway:gwa0c9a0d8a641’ changed from ONLINE to OFFLINE (COMMUNICATION_ERROR)

openhab never recover and the IKEA GW is never reachable again from openhab until I do full restart of openhab with:
systemctl stop openhab2
systemctl start openhab2

Just to verify that the problem is in Openhab I have installed HomeAssistant to run in parallell.
I run two instances of HomeAssistant. One on a raspberry 3 with Hassio and one instance on the same raspberry pi 4 that run Openhab2. They have never reported any problem to communicate with IKEA GW. And they always can control all my lights and outlets when openahab lost its communication.

The IKEA app also always works without problem.

This has now happened at least 5 times during 4 weeks.

Openhab version 2.5.2 (Build)
Home Assistant 0.105.5 on Raspberry 3 (hassio)
Home Assistant 0.106.2 on Raspberry 4 (python venv)
IKEA GW 1.10.29

1 Like

I have same problems… most of the time it runs for a few days… but lately it is less then a day

openhab2 2.5.3-1
Better but not fixed.

Took 9 hour to regain connection but a step forward now it atleast recover even if it takes way to long.

2020-04-12 02:23:54.846 [hingStatusInfoChangedEvent] - 'tradfri:gateway:gwa0c9a0d8a641' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR)
2020-04-12 02:23:54.850 [hingStatusInfoChangedEvent] - 'tradfri:0830:gwa0c9a0d8a641:65545' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2020-04-12 02:23:54.854 [hingStatusInfoChangedEvent] - 'tradfri:0830:gwa0c9a0d8a641:65549' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2020-04-12 02:23:54.857 [hingStatusInfoChangedEvent] - 'tradfri:0820:gwa0c9a0d8a641:65538' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2020-04-12 02:23:54.859 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65539' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2020-04-12 02:23:54.862 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65546' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2020-04-12 02:23:54.868 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65556' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2020-04-12 02:23:54.870 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65553' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2020-04-12 02:23:54.873 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65554' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2020-04-12 02:23:54.876 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65555' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2020-04-12 02:23:54.879 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65548' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2020-04-12 02:23:54.881 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65542' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2020-04-12 02:23:54.884 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65552' changed from OFFLINE to OFFLINE (BRIDGE_OFFLINE)
2020-04-12 02:23:54.887 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65541' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2020-04-12 02:23:54.889 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65540' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2020-04-12 02:23:54.892 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65544' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2020-04-12 02:23:54.894 [hingStatusInfoChangedEvent] - 'tradfri:0100:gwa0c9a0d8a641:65551' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2020-04-12 02:23:54.897 [hingStatusInfoChangedEvent] - 'tradfri:0100:gwa0c9a0d8a641:65550' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2020-04-12 02:23:54.899 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65547' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2020-04-12 02:23:54.902 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65543' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2020-04-12 11:35:02.953 [hingStatusInfoChangedEvent] - 'tradfri:gateway:gwa0c9a0d8a641' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE
2020-04-12 11:35:02.955 [hingStatusInfoChangedEvent] - 'tradfri:0830:gwa0c9a0d8a641:65545' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2020-04-12 11:35:02.958 [hingStatusInfoChangedEvent] - 'tradfri:0830:gwa0c9a0d8a641:65545' changed from ONLINE to UNKNOWN
2020-04-12 11:35:02.964 [hingStatusInfoChangedEvent] - 'tradfri:0830:gwa0c9a0d8a641:65549' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2020-04-12 11:35:02.966 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65556' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2020-04-12 11:35:02.969 [hingStatusInfoChangedEvent] - 'tradfri:0830:gwa0c9a0d8a641:65549' changed from ONLINE to UNKNOWN
2020-04-12 11:35:02.971 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65546' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2020-04-12 11:35:02.974 [hingStatusInfoChangedEvent] - 'tradfri:0820:gwa0c9a0d8a641:65538' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2020-04-12 11:35:02.982 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65539' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2020-04-12 11:35:02.984 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65546' changed from ONLINE to UNKNOWN
2020-04-12 11:35:02.993 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65552' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2020-04-12 11:35:03.006 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65539' changed from ONLINE to UNKNOWN
2020-04-12 11:35:03.008 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65556' changed from ONLINE to UNKNOWN
2020-04-12 11:35:03.010 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65552' changed from ONLINE to UNKNOWN
2020-04-12 11:35:03.012 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65553' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2020-04-12 11:35:03.014 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65555' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2020-04-12 11:35:03.016 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65554' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2020-04-12 11:35:03.018 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65553' changed from ONLINE to UNKNOWN
2020-04-12 11:35:03.020 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65555' changed from ONLINE to UNKNOWN
2020-04-12 11:35:03.021 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65548' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2020-04-12 11:35:03.023 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65547' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2020-04-12 11:35:03.025 [hingStatusInfoChangedEvent] - 'tradfri:0820:gwa0c9a0d8a641:65538' changed from ONLINE to UNKNOWN
2020-04-12 11:35:03.026 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65547' changed from ONLINE to UNKNOWN
2020-04-12 11:35:03.028 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65542' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2020-04-12 11:35:03.029 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65541' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2020-04-12 11:35:03.031 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65542' changed from ONLINE to UNKNOWN
2020-04-12 11:35:03.032 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65541' changed from ONLINE to UNKNOWN
2020-04-12 11:35:03.033 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65548' changed from ONLINE to UNKNOWN
2020-04-12 11:35:03.035 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65543' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2020-04-12 11:35:03.036 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65544' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2020-04-12 11:35:03.038 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65543' changed from ONLINE to UNKNOWN
2020-04-12 11:35:03.039 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65544' changed from ONLINE to UNKNOWN
2020-04-12 11:35:03.041 [hingStatusInfoChangedEvent] - 'tradfri:0100:gwa0c9a0d8a641:65550' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2020-04-12 11:35:03.042 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65540' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2020-04-12 11:35:03.044 [hingStatusInfoChangedEvent] - 'tradfri:0100:gwa0c9a0d8a641:65550' changed from ONLINE to UNKNOWN
2020-04-12 11:35:03.045 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65540' changed from ONLINE to UNKNOWN
2020-04-12 11:35:03.046 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65554' changed from ONLINE to UNKNOWN
2020-04-12 11:35:03.047 [hingStatusInfoChangedEvent] - 'tradfri:0100:gwa0c9a0d8a641:65551' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2020-04-12 11:35:03.048 [hingStatusInfoChangedEvent] - 'tradfri:0100:gwa0c9a0d8a641:65551' changed from ONLINE to UNKNOWN
2020-04-12 11:35:05.975 [hingStatusInfoChangedEvent] - 'tradfri:0830:gwa0c9a0d8a641:65545' changed from UNKNOWN to ONLINE
2020-04-12 11:35:05.999 [hingStatusInfoChangedEvent] - 'tradfri:0830:gwa0c9a0d8a641:65549' changed from UNKNOWN to ONLINE
2020-04-12 11:35:06.026 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65546' changed from UNKNOWN to ONLINE
2020-04-12 11:35:06.032 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65556' changed from UNKNOWN to ONLINE
2020-04-12 11:35:06.038 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65552' changed from UNKNOWN to OFFLINE
2020-04-12 11:35:06.045 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65539' changed from UNKNOWN to ONLINE
2020-04-12 11:35:06.053 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65555' changed from UNKNOWN to ONLINE
2020-04-12 11:35:06.057 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65553' changed from UNKNOWN to ONLINE
2020-04-12 11:35:06.061 [hingStatusInfoChangedEvent] - 'tradfri:0820:gwa0c9a0d8a641:65538' changed from UNKNOWN to ONLINE
2020-04-12 11:35:06.066 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65547' changed from UNKNOWN to ONLINE
2020-04-12 11:35:06.073 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65548' changed from UNKNOWN to ONLINE
2020-04-12 11:35:06.078 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65541' changed from UNKNOWN to ONLINE
2020-04-12 11:35:06.083 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65540' changed from UNKNOWN to ONLINE
2020-04-12 11:35:06.089 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65543' changed from UNKNOWN to ONLINE
2020-04-12 11:35:06.094 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65542' changed from UNKNOWN to ONLINE
2020-04-12 11:35:06.100 [hingStatusInfoChangedEvent] - 'tradfri:0010:gwa0c9a0d8a641:65544' changed from UNKNOWN to ONLINE
2020-04-12 11:35:06.107 [hingStatusInfoChangedEvent] - 'tradfri:0100:gwa0c9a0d8a641:65551' changed from UNKNOWN to ONLINE
2020-04-12 11:35:06.113 [hingStatusInfoChangedEvent] - 'tradfri:0100:gwa0c9a0d8a641:65550' changed from UNKNOWN to ONLINE
2020-04-12 11:35:06.117 [hingStatusInfoChangedEvent] - 'tradfri:0220:gwa0c9a0d8a641:65554' changed from UNKNOWN to ONLINE

Interesting. I am still on 2.5.2 and the problem just magically disappeared a few weeks ago. I don’t know if maybe Ikea did something or what. But I am kind of afraid of upgrading my Openhab in case the problem returns.

Hello

I’m facing the same issue since some time… I’m on 2.5.9-1 now and I have a full configuration with things an items files and now I’m trying with auto discovery… in both situations the hub is online but every 3 minutes its going down

2020-10-12 09:52:46.882 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:gw44xxx’ changed from ONLINE to UNKNOWN

2020-10-12 09:52:46.914 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:gw44xxx’ changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR)

2020-10-12 09:52:46.921 [hingStatusInfoChangedEvent] - ‘tradfri:0830:gw44xxx:65538’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2020-10-12 09:52:46.924 [hingStatusInfoChangedEvent] - ‘tradfri:0820:gw449xxx:65547’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2020-10-12 09:52:46.937 [hingStatusInfoChangedEvent] - ‘tradfri:0210:gw44xxx:65539’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2020-10-12 09:52:46.941 [hingStatusInfoChangedEvent] - ‘tradfri:0010:gw44xxx:65548’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2020-10-12 09:52:46.950 [hingStatusInfoChangedEvent] - ‘tradfri:0830:gw44xxx:65542’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2020-10-12 09:52:46.955 [hingStatusInfoChangedEvent] - ‘tradfri:0210:gw44xxx:65545’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2020-10-12 09:52:46.959 [hingStatusInfoChangedEvent] - ‘tradfri:0830:gw44xxx:65544’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2020-10-12 09:52:46.963 [hingStatusInfoChangedEvent] - ‘tradfri:0220:gw44xxx:65537’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2020-10-12 09:52:46.967 [hingStatusInfoChangedEvent] - ‘tradfri:0210:gwxxx:65543’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2020-10-12 09:52:46.970 [hingStatusInfoChangedEvent] - ‘tradfri:0830:gw44xxx:65536’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2020-10-12 09:52:47.049 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:gw44xxx’ changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE

This happens every 3 Minutes… sometimes the gateway does not change to online so I have to repower it…

I changed the Tradfri Hub with a Hue Gateway, but I was not happy with Tradfri Bulbs an Controls on a Hue Gateway so I changed it back… so a full reset has been done too…

I really have no idea how to solve this… I have set up rules triggered by ir sensors, when they are fired during an offline period, nothing happens…

Has this issue been solved somehow… are there any tricks?

Thanks a lot for your answer… I tried almost everything!

Jan

I had posted this question also here a few month ago:

Jan

Sorry, can’t really help here. I am on latest OH version now (upgraded recently) and I haven’t had any issues with Tradfri for months.

Hello, I solved the problem of the gateway going offline every few days by declaring the bridge in a things file as follow:

ikea.things:
Bridge tradfri:gateway:gwxxxxxxxxxxxx [ host=“192.168.xxx.xxx”, code=“yyyyyyyyyyyy” ]

where code is the secret key of the gateway. I have no more problems since then.

Hello, I seem to have the same issue frequently. disabling en re-enabling the gateway manualy from the Paper UI can fix that. I created a rule as a workaround for this problem.

rule "Tradfri status change"
when
    Thing "tradfri:gateway:mytradfri" changed 
then
    var s = getThingStatusInfo("tradfri:gateway:mytradfri").getStatus().toString()
    var sd = getThingStatusInfo("tradfri:gateway:mytradfri").getStatusDetail().toString()
    if (sd != "DISABLED") {
        logInfo("RULE","Tradfri status changed to [" + s + "]")
        if (s != "ONLINE" && s != "INITIALIZING" ) {
            logInfo("RULE","Enabling Tradfri bridge again")
            sendHttpPutRequest("http://<IP-address>:8080/rest/things/tradfri:gateway:mytradfri/enable", "application/json", 'true') 
        }
    } 
end

Unfortunately this solution didn’t help for me. I even add the preSharedKey parameter:
Bridge tradfri:gateway:mytradfri “Tradfri” [ host=“10.0.100.100”, code=“xxx”, preSharedKey=“yyy” ]