I´ve some trouble with sensors/devices which are randomly offline in openhav. I can control the device and can see updates in the Phoscon Software. The rest api information looks fine too of phoscon.
I don´t have a clue how to get better loggings.
I got the message “OFFLINE - COMMUNICATION_ERROR Auth failed” in PaperUI at the Thing.
/var/log/openhab2/events.log:4030:2019-07-28 16:21:10.605 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:homeserver:EntrancePostsensor01' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
/var/log/openhab2/events.log:5017:2019-07-28 16:21:22.459 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:homeserver:EntrancePostsensor01' changed from OFFLINE (BRIDGE_OFFLINE) to UNINITIALIZED
/var/log/openhab2/events.log:5018:2019-07-28 16:21:22.461 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:homeserver:EntrancePostsensor01' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
/var/log/openhab2/events.log:5317:2019-07-28 16:21:24.378 [temChannelLinkRemovedEvent] - Link 'EntrancePostsensor01BatteryLevel => deconz:openclosesensor:homeserver:EntrancePostsensor01:battery_level' has been removed.
/var/log/openhab2/events.log:5377:2019-07-28 16:21:24.530 [temChannelLinkRemovedEvent] - Link 'EntrancePostsensor01Temperature => deconz:openclosesensor:homeserver:EntrancePostsensor01:temperature' has been removed.
/var/log/openhab2/events.log:5425:2019-07-28 16:21:24.675 [temChannelLinkRemovedEvent] - Link 'EntrancePostsensor01Open => deconz:openclosesensor:homeserver:EntrancePostsensor01:open' has been removed.
/var/log/openhab2/events.log:5429:2019-07-28 16:21:24.685 [temChannelLinkRemovedEvent] - Link 'EntrancePostsensor01LastUpdated => deconz:openclosesensor:homeserver:EntrancePostsensor01:last_updated' has been removed.
/var/log/openhab2/events.log:5613:2019-07-28 16:21:25.226 [temChannelLinkRemovedEvent] - Link 'EntrancePostsensor01BatteryLow => deconz:openclosesensor:homeserver:EntrancePostsensor01:battery_low' has been removed.
/var/log/openhab2/events.log:5923:2019-07-28 16:23:27.566 [.ItemChannelLinkAddedEvent] - Link 'EntrancePostsensor01BatteryLevel-deconz:openclosesensor:homeserver:EntrancePostsensor01:battery_level' has been added.
/var/log/openhab2/events.log:5984:2019-07-28 16:23:27.747 [.ItemChannelLinkAddedEvent] - Link 'EntrancePostsensor01Temperature-deconz:openclosesensor:homeserver:EntrancePostsensor01:temperature' has been added.
/var/log/openhab2/events.log:6032:2019-07-28 16:23:27.869 [.ItemChannelLinkAddedEvent] - Link 'EntrancePostsensor01Open-deconz:openclosesensor:homeserver:EntrancePostsensor01:open' has been added.
/var/log/openhab2/events.log:6037:2019-07-28 16:23:27.887 [.ItemChannelLinkAddedEvent] - Link 'EntrancePostsensor01LastUpdated-deconz:openclosesensor:homeserver:EntrancePostsensor01:last_updated' has been added.
/var/log/openhab2/events.log:6221:2019-07-28 16:23:28.512 [.ItemChannelLinkAddedEvent] - Link 'EntrancePostsensor01BatteryLow-deconz:openclosesensor:homeserver:EntrancePostsensor01:battery_low' has been added.
/var/log/openhab2/events.log:6283:2019-07-28 16:23:28.914 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:homeserver:EntrancePostsensor01' changed from UNINITIALIZED to UNINITIALIZED (BRIDGE_UNINITIALIZED)
/var/log/openhab2/events.log:6364:2019-07-28 16:23:32.373 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:homeserver:EntrancePostsensor01' changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING
/var/log/openhab2/events.log:6365:2019-07-28 16:23:32.377 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:homeserver:EntrancePostsensor01' changed from INITIALIZING to OFFLINE (CONFIGURATION_PENDING)
/var/log/openhab2/events.log:6475:2019-07-28 16:23:36.391 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:homeserver:EntrancePostsensor01' changed from OFFLINE (CONFIGURATION_PENDING) to OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.TimeoutException: Total timeout 2000 ms elapsed
/var/log/openhab2/events.log:6480:2019-07-28 16:23:36.459 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:homeserver:EntrancePostsensor01' changed from OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.TimeoutException: Total timeout 2000 ms elapsed to OFFLINE (COMMUNICATION_ERROR): Auth failed
/var/log/openhab2/events.log:7249:2019-07-28 16:33:37.926 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:homeserver:EntrancePostsensor01' changed from OFFLINE (COMMUNICATION_ERROR): Auth failed to OFFLINE (BRIDGE_OFFLINE)
/var/log/openhab2/events.log:8108:2019-07-28 18:35:43.114 [.ItemChannelLinkAddedEvent] - Link 'EntrancePostsensor01BatteryLevel-deconz:openclosesensor:homeserver:EntrancePostsensor01:battery_level' has been added.
/var/log/openhab2/events.log:8169:2019-07-28 18:35:43.430 [.ItemChannelLinkAddedEvent] - Link 'EntrancePostsensor01Temperature-deconz:openclosesensor:homeserver:EntrancePostsensor01:temperature' has been added.
/var/log/openhab2/events.log:8217:2019-07-28 18:35:43.561 [.ItemChannelLinkAddedEvent] - Link 'EntrancePostsensor01Open-deconz:openclosesensor:homeserver:EntrancePostsensor01:open' has been added.
/var/log/openhab2/events.log:8222:2019-07-28 18:35:43.582 [.ItemChannelLinkAddedEvent] - Link 'EntrancePostsensor01LastUpdated-deconz:openclosesensor:homeserver:EntrancePostsensor01:last_updated' has been added.
/var/log/openhab2/events.log:8406:2019-07-28 18:35:44.063 [.ItemChannelLinkAddedEvent] - Link 'EntrancePostsensor01BatteryLow-deconz:openclosesensor:homeserver:EntrancePostsensor01:battery_low' has been added.
/var/log/openhab2/events.log:8468:2019-07-28 18:35:44.244 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:homeserver:EntrancePostsensor01' changed from UNINITIALIZED to UNINITIALIZED (BRIDGE_UNINITIALIZED)
/var/log/openhab2/events.log:8551:2019-07-28 18:35:46.803 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:homeserver:EntrancePostsensor01' changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING
/var/log/openhab2/events.log:8552:2019-07-28 18:35:46.820 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:homeserver:EntrancePostsensor01' changed from INITIALIZING to OFFLINE (CONFIGURATION_PENDING)
/var/log/openhab2/events.log:8671:2019-07-28 18:35:49.148 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:homeserver:EntrancePostsensor01' changed from OFFLINE (CONFIGURATION_PENDING) to OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.TimeoutException: Total timeout 2000 ms elapsed
/var/log/openhab2/events.log:8673:2019-07-28 18:35:49.159 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:homeserver:EntrancePostsensor01' changed from OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.TimeoutException: Total timeout 2000 ms elapsed to OFFLINE (COMMUNICATION_ERROR): Auth failed
I still got time outs, resulting that some things are offline.
For each thing that is offline on the deconz/phoscon bridge I got a time out.
I´m trying to understand the code above. Could it be that every thing sends a request on reboot to the bridge. Maybe because of several sensors I´m flooding the bridge with http requests in short intervalls?
With the hue plugin there are thing options to control the times between polling (thing options sensorPollingInterval & pollingInterval).
Are these missing for the deconz plugin?
Exception:
2019-08-05 20:25:45.786 [DEBUG] [.internal.handler.SensorThingHandler] - Get state failed
java.util.concurrent.CompletionException: java.util.concurrent.TimeoutException: Total timeout 2000 ms elapsed
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292) ~[?:?]
at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308) ~[?:?]
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:593) ~[?:?]
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577) ~[?:?]
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474) [?:?]
at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977) [?:?]
at org.openhab.binding.deconz.internal.netutils.AsyncHttpClient$1.onComplete(AsyncHttpClient.java:113) [216:org.openhab.binding.deconz:2.5.0.M1]
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:202) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:194) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:470) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.HttpReceiver.abort(HttpReceiver.java:552) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.HttpChannel.abortResponse(HttpChannel.java:156) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.HttpChannel.abort(HttpChannel.java:149) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.HttpExchange.abort(HttpExchange.java:257) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.HttpConversation.abort(HttpConversation.java:141) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.HttpRequest.abort(HttpRequest.java:767) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.TimeoutCompleteListener.onTimeoutExpired(TimeoutCompleteListener.java:52) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.TimeoutCompleteListener.schedule(TimeoutCompleteListener.java:75) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.HttpChannel.send(HttpChannel.java:126) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.HttpConnection.send(HttpConnection.java:201) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP$Delegate.send(HttpConnectionOverHTTP.java:253) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.send(HttpConnectionOverHTTP.java:122) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.http.HttpDestinationOverHTTP.send(HttpDestinationOverHTTP.java:38) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.HttpDestination.process(HttpDestination.java:347) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.HttpDestination.process(HttpDestination.java:305) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:295) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.HttpDestination.succeeded(HttpDestination.java:229) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.AbstractConnectionPool.proceed(AbstractConnectionPool.java:154) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.AbstractConnectionPool$1.succeeded(AbstractConnectionPool.java:132) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.client.AbstractConnectionPool$1.succeeded(AbstractConnectionPool.java:124) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.util.Promise$Wrapper.succeeded(Promise.java:130) [87:org.eclipse.jetty.util:9.4.12.v20180830]
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onOpen(HttpConnectionOverHTTP.java:130) [71:org.eclipse.jetty.client:9.4.12.v20180830]
at org.eclipse.jetty.io.SelectorManager.connectionOpened(SelectorManager.java:324) [75:org.eclipse.jetty.io:9.4.12.v20180830]
at org.eclipse.jetty.io.ManagedSelector.createEndPoint(ManagedSelector.java:254) [75:org.eclipse.jetty.io:9.4.12.v20180830]
at org.eclipse.jetty.io.ManagedSelector.access$1800(ManagedSelector.java:61) [75:org.eclipse.jetty.io:9.4.12.v20180830]
at org.eclipse.jetty.io.ManagedSelector$CreateEndPoint.run(ManagedSelector.java:886) [75:org.eclipse.jetty.io:9.4.12.v20180830]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765) [87:org.eclipse.jetty.util:9.4.12.v20180830]
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683) [87:org.eclipse.jetty.util:9.4.12.v20180830]
at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.util.concurrent.TimeoutException: Total timeout 2000 ms elapsed
... 23 more
Problem is still there. First the deconz bridge goes offline:
2019-08-26 11:33:03.392 [hingStatusInfoChangedEvent] - 'deconz:deconz:89daa0fd' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.TimeoutException: Idle timeout expired: 300000/300000 ms
Then all sensors go offline (one example):
2019-08-26 11:33:03.459 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:89daa0fd:00124b000969c96b010500' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
Then the bridge comes online again…
2019-08-26 11:33:04.268 [hingStatusInfoChangedEvent] - 'deconz:deconz:89daa0fd' changed from OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.TimeoutException: Idle timeout expired: 300000/300000 ms to ONLINE
…but not the sensor:
2019-08-26 11:33:04.365 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:89daa0fd:00124b000969c96b010500' changed from OFFLINE (BRIDGE_OFFLINE) to OFFLINE (CONFIGURATION_PENDING)
2019-08-26 11:33:06.418 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:89daa0fd:00124b000969c96b010500' changed from OFFLINE (CONFIGURATION_PENDING) to OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.TimeoutException: Total timeout 2000 ms elapsed
2019-08-26 11:33:06.443 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:89daa0fd:00124b000969c96b010500' changed from OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.TimeoutException: Total timeout 2000 ms elapsed to OFFLINE (COMMUNICATION_ERROR): Auth failed
Debug (example):
2019-08-26 11:33:06.399 [DEBUG] [.internal.handler.SensorThingHandler] - Get state failed
java.util.concurrent.CompletionException: java.util.concurrent.TimeoutException: Total timeout 2000 ms elapsed
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292) ~[?:?]
at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308) ~[?:?]
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:593) ~[?:?]
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577) ~[?:?]
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474) [?:?]
at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977) [?:?]
at org.openhab.binding.deconz.internal.netutils.AsyncHttpClient$1.onComplete(AsyncHttpClient.java:113) [336:org.openhab.binding.deconz:2.5.0.201908091731]
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:196) [76:org.eclipse.jetty.client:9.4.18.v20190429]
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:188) [76:org.eclipse.jetty.client:9.4.18.v20190429]
at org.eclipse.jetty.client.HttpExchange.notifyFailureComplete(HttpExchange.java:269) [76:org.eclipse.jetty.client:9.4.18.v20190429]
at org.eclipse.jetty.client.HttpExchange.abort(HttpExchange.java:240) [76:org.eclipse.jetty.client:9.4.18.v20190429]
at org.eclipse.jetty.client.HttpConversation.abort(HttpConversation.java:149) [76:org.eclipse.jetty.client:9.4.18.v20190429]
at org.eclipse.jetty.client.HttpRequest.abort(HttpRequest.java:766) [76:org.eclipse.jetty.client:9.4.18.v20190429]
at org.eclipse.jetty.client.HttpDestination$TimeoutTask.onTimeoutExpired(HttpDestination.java:527) [76:org.eclipse.jetty.client:9.4.18.v20190429]
at org.eclipse.jetty.io.CyclicTimeout$Wakeup.run(CyclicTimeout.java:282) [80:org.eclipse.jetty.io:9.4.18.v20190429]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.util.concurrent.TimeoutException: Total timeout 2000 ms elapsed
... 9 more
Disabling and enabling the sensor in Paper-UI brings the sensor back online:
2019-08-26 11:37:35.504 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:89daa0fd:00124b000969c96b010500' changed from UNINITIALIZED to UNINITIALIZED (DISABLED)
2019-08-26 11:37:38.807 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:89daa0fd:00124b000969c96b010500' changed from UNINITIALIZED (DISABLED) to INITIALIZING
2019-08-26 11:37:38.833 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:89daa0fd:00124b000969c96b010500' changed from INITIALIZING to OFFLINE (CONFIGURATION_PENDING)
2019-08-26 11:37:39.087 [me.event.ThingUpdatedEvent] - Thing 'deconz:openclosesensor:89daa0fd:00124b000969c96b010500' has been updated.
2019-08-26 11:37:39.126 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:89daa0fd:00124b000969c96b010500' changed from OFFLINE (CONFIGURATION_PENDING) to ONLINE
So I made a rule to disable and enable the thing whenever a sensor stays offline, but that’s not very satisfying.
So @David_Graeff could you please have a look at this issue? Thank you!
I have been noticing that my motion sensors (aqara) also stop reporting in the phoscon interface in a browser window. I’m not sure if the two failures are connected but getting the motion sensors up and running again is more likely to do with deCONZ than OH.
@Tiradoro Hello Stefan,
I have the exact same problem and didn’t even figure out, that you can get em online by disabling and enabling.
I have programmed a few minor bug fixes / feature addons in the past. It’s quite a while ago, but at least I still have eclipse installed and probably a little git update would work to try and program a workaround.
Can you as a starter please post the rule you programmed?
@David_Graeff I think too that the problem is not with deconz, but rather some place else, but since more people seem to have problems with that, it wouldn’t hurt if it could be fixed inside deconz, also posting an info message, saying that something else seems to be broken and needs fixing.
I have some spare time Startin tomorrow and will try to figure out what is happening and program a workaround inside deconz.
@Tiradoro I guess for now some people can implement your rule set to temp fix it.
What feels strange to me is that my bridge works and quite a lot of sensors, but then some sensors report an authentication problem, which from my understanding shouldn’t happen. The authentication with the bridge works fine… Not sure if each device needs to authenticate.?
@Schelli I´ve no rule to disable/enable things. @Syn has reported he made a rule, maybe he can contribute his workaround.
I tried to debug the bug in Eclipse, but got stuck in the installation of the eclipse IDE openhab environment. After searching the forum it seems the build process is broken. This is too high for me, so I stopped analytics…
hat feels strange to me is that my bridge works and quite a lot of sensors, but then some sensors report an authentication problem, which from my understanding shouldn’t happen. The authentication with the bridge works fine… Not sure if each device needs to authenticate.?
When I had the problem everytime other sensors are offline after rebooting.
When looking at the code there is only one connection handler to the bridge with authentication:
Logic (see comment of the class):
It waits for the bridge to come online, grab the websocket connection and bridge configuration
and registers to the websocket connection as a listener.
Without debugging problems can be everywhere (mabye a race condition between listener / maybe to many requests of sensors the the factory class etc., maybe an underlying problem in the http-handler / Web connection…)
Yep, sometimes I like to program the fix at the place it happens.
I thought too, that there is only an authentication process with the bridge. Once you got access nothing is authorized any more. Thus making single devices report authentication problems strange. My idea would be to implement something like…
If bridge authentication successfull and device claims authentication problem, just try again in 30 seconds, up to max times. On top report an info msg saying, that some devices needed “special attention” to initialize.
I have no clue how to fix maybe problems with http related stuff and those that can maybe don’t use deconz so can’t duplicate the problem and I don’t want to wait ages for a fix.
I would implement a compatibility mode, so those extra “bug fixes” can be switched on by the user that have problems. All others don’t have Xtra processor load / memory usage… Whatever those fixes do.
It works quite well, but you will run into timing issues, if you have too many sensors (they go offline all at the same time, so it could happen, that the thing enable request fails to execute, so the thing will stay as disabled. To prevent this, I let start the first timer with different settings).
rule "Disable/enable deconz thing"
when
Thing "thingID" changed
then
var status = getThingStatusInfo("thingID").getStatus()
if (status.toString() == 'OFFLINE'){
createTimer(now.plusMillis(10750)) [|
{
var status = getThingStatusInfo("thingID").getStatus()
if (status.toString() == 'OFFLINE'){
sendHttpPutRequest("http://OPENHAB-IP:8080/rest/things/thingID/enable", "application/json", 'enabled')
createTimer(now.plusSeconds(5)) [|
{
sendHttpPutRequest("http://OPENHAB-IP:8080/rest/things/thingID/enable", "application/json", 'true')
createTimer(now.plusSeconds(5)) [|
{
var status = getThingStatusInfo("thingID").getStatus()
logInfo(filename, "Deconz Thing enabled, status: _" + status.toString + "_")
}
]
}
]
}
}
]
}
end
Yes I saw something similar, but the auth failed error happens only, when the sensor is working in the phoscon app. Yesterday all my sensors and switches where offline also in the phoscon app. When i turned off the deconz bridge thing, they all come back online in the phoscon app. So it seems to me, that it is related after all.
Another try is to find differences in the implementation of the hue binding to the deconz binding.
I thought that they have the same rest api in common.
I tried that, but got stuck because the two bindings are completely different in implementations.
OK, I might take a look at the hue binding, while I am at it and see how they implemented it.
I also have tried some devices, that are really offline and they don’t report authentication problems… So in the source code it should be easier to implement the fix o in just the right place.
I had the idea, that maybe a thing queue that brings one thing online each 1 or 2 secs might fix the problem, maybe too many simultaneous requests create those errors… I will start testing tomorrow or maybe Tuesday… Wanted to get my fibaro fgr223 s going with the zwave binding. Another open task.
Hmm, now all my sensors are working and i can’t duplicate the error. After toggling some of them to disable and back online they are all working every time i restart openhab or deconz.
Well, of course this is good news, but i can’t debug the problem now… have to wait until things go offline again…
I digged into this as I am facing it too. It is very annoying to restart the bridge thing all day long. I proposed a possible fix for it today - but additional testing would be preferred. Can I count on you? You will find a test version linked in my PR.
First of all, thanks for looking into this. I used the disable / enable quick fix for my most important sensors for the last few weeks.
I installed your version of the fix, almost all my devices are online now, only one Aqara OpenClose Sensor reports Authentication failed
2019-09-22 21:33:37.128 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:41864904:OpenClose_Parents_L' changed from OFFLINE (CONFIGURATION_PENDING) to OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.TimeoutException: Total timeout 2000 ms elapsed
2019-09-22 21:33:37.131 [hingStatusInfoChangedEvent] - 'deconz:openclosesensor:41864904:OpenClose_Parents_L' changed from OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.TimeoutException: Total timeout 2000 ms elapsed to OFFLINE (COMMUNICATION_ERROR): Auth failed
I wanted to work on this issue quite some time ago, as you can probably see a few posts earlier, unfortunately i didn’t find time since i had other more important things to cover first. I will use your version and try to figure out what is going on with my sensors (well, at the moment, with the last rebellious sensor).
As far as i can see i should have time this week, let s pray there isn’t another unexpected issue coming up in my timetable.
I was thinking if those issues do not originate in the deconz binding itself, it might be a good idea to implement something like a “compatibility mode” switch for the binding, that activates those fixes only if you are encountering problems. Not sure if that is a good idea…
2019-09-23 17:20:58.592 [hingStatusInfoChangedEvent] - 'deconz:deconz:7c4f7818' changed from UNINITIALIZED (DISABLED) to INITIALIZING
2019-09-23 17:20:59.084 [hingStatusInfoChangedEvent] - 'deconz:deconz:7c4f7818' changed from INITIALIZING to ONLINE
==> /var/log/openhab2/openhab.log <==
2019-09-23 17:21:00.195 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler DeconzBridgeHandler tried updating the thing status although the handler was already disposed.
2019-09-23 17:21:00.367 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler DeconzBridgeHandler tried updating the thing status although the handler was already disposed.
Restarting the bundle via console worked and now everything is online … not one thing offline