Hue API + Http binding stopped working. Fatal transport error: java.util.concurrent.TimeoutException: Total timeout 1000 ms elapsed

I have an IP_Cam and use this as a motion-sensor to trigger my HUE lights via the HUE API + HTTP-binding. I do this because I want to be able to set the ‘transition time’ (quick when turning on and slow when turning off.

This has been working, but now I get the following error in my log and the lights are not turned on. As far as I know I didn’t update anything. I’m using openHAB 2.4.0 Release Build on a RPI (running Openhabian).

The item IPCam_MotionAlarm is updated and I can set the HUE lights with basicUI etc.

2019-02-25 21:48:29.000 [vent.ItemStateChangedEvent] - IPCam_MotionAlarm changed from OFF to ON

==> /var/log/openhab2/openhab.log <==

2019-02-25 21:48:29.036 [INFO ] [smarthome.model.script.Motion update] - evaluate

2019-02-25 21:48:29.044 [INFO ] [.smarthome.model.script.HUE API call] - Send command '{"on":true, "bri":254, "transitiontime":0}' to http://192.168.2.101/api/My_Hue_API_key/groups/8/action

2019-02-25 21:48:29.048 [INFO ] [smarthome.model.script.Motion update] - cancel timer

2019-02-25 21:48:30.069 [ERROR] [.smarthome.model.script.actions.HTTP] - Fatal transport error: java.util.concurrent.TimeoutException: Total timeout 1000 ms elapsed

My rules to turn the lights on/off:

var Timer NoMotionTimer = null
rule "Carport Lights ON at IPCam Motion"
when
	//Item IPCam_MotionAlarm received update ON or 
    Item IPCam_LineCrossingAlarm received update ON or
    Item IPCam_MotionAlarm received update ON or
    Item FrontDoor changed to OPEN
    then
    if (Sun_PhaseName.state!="DAYLIGHT") {
	    val url = "http://192.168.2.101/api/My_Hue_API_key/groups/8/action"
        val String body = '{"on":true, "bri":254, "transitiontime":0}'
        logInfo("HUE API call", "Send command '{}' to {}", body, url)
        sendHttpPutRequest(url, "application/json", body)
    }
end


rule "Carport Lights OFF after IPCam Motion"
when
	Item IPCam_MotionAlarm received update or
    Item IPCam_LineCrossingAlarm received update or
    Item FrontDoor received update
then
   logInfo("Motion update", "evaluate") 
    // Motion and Line crossing are not ON (they are OFF or undef); set timer to turn of the lights
    if (IPCam_MotionAlarm.state != ON && IPCam_LineCrossingAlarm.state != ON && FrontDoor.state != OPEN) {
        logInfo("IP Cam", "Set motion-stopped timer")
        NoMotionTimer = createTimer(now.plusSeconds(60), [ |
            val url = "http://192.168.2.101/api/My_Hue_API_key/groups/8/action"
            val String body = '{"on":false, "bri":256, "transitiontime":50}'
            logInfo("HUE API call", "Send command '{}' to {}", body, url)
            sendHttpPutRequest(url, "application/json", body)
            NoMotionTimer = null
        ])
    }
    else {
        logInfo("Motion update", "cancel timer")
        NoMotionTimer?.cancel
        NoMotionTimer = null
    }
end

Any hints where to start looking?

Figure out which sendHttp*Request is timing out and give it a more appropriate timeout.

That’s pretty easy to find out (there’s only 1 sendHttp).
I’ll adjust the timeout.

Strange thing is that the problem is gone after restarting openhab.

After a few days the problem is back. Adjusting the time-out is not solving the error in the log.
More serious is the fact that the HUE lights are not responding (and probably causeing the error).

Restarting openhab solves the problem again.

Did you ever find out what happened?
I see this a lot after the 2.5.5 update. Unsure if it’s related.

2020-05-26 22:13:01.647 [ERROR] [.smarthome.model.script.actions.HTTP] - Fatal transport error: java.util.concurrent.TimeoutException: Total timeout 5000 ms elapsed

Tried power-cycling the HUE hub.
2.5.5 HUE binding now supports native HUE groups, so I guess it is time to start using that instead :slight_smile: .

For others that might come here for this.
My problem was a stale HUE bridge.
Restarted it and all was OK again.