-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[homematic] Automatic reconnection after CCU to OpenHAB connection interruption #11427
Comments
Thanks for the issue report. Can you give me some more information? I have tried to reproduce it, but was not successful.
The re-connect is made from the add-on to the CCU, exactly speaking to one service on the CCU for HM devices and to another service for HmIP devices. Especially the HmIP services needs longer until it accepts event registrations. |
This suggestion is just an idea for a possible improvement. Your current solution with the extended wait time for the devices to become accessible worked fine, but I only tested it once. As far as I have understood, the binding makes several reconnection attempts after the connection to the CCU had been lost. But after these attempts are used up, no more reconnection attempts will be made, even when the device will become available after some time. That was the situation I had seen with the homematic binding, before the extended wait time had been implemented. So, the idea of my suggestion is to retry more connection attempts (at least one), every xx minutes (maybe every 5 minutes). This will have the result, that even after a much longer time an available Homematic (IP) device will be reactivated. So this strategy does not rely on an event to be received from the CCU, but it would use a timer to re-initiate one more connection attempt after every xx minutes for those devices that are still on error state. |
Do you plan to implement the suggested enhancement, so in case of a lost device communication the homematic binding will try to re-establish a connection automatically? It is not urgent for me, please just let me know if this idea is something you might want to follow on. If I can be of any help please let me know. |
@Joerg-Dr I have created a PR for a general improvement of the re-connect handling (it is not merged because I need to change parts of the implementation). I hope that it will solve most of these problems. Therefore I would recommend to test whether these changes resolve the problem. The connection between OH and the CCU is not per device. There is one connection for each device type (classical HM device, HmIP devices, ...). If one device is not ready it would probably not really help to perform a full re-connect cycle. If a device stays after an automatic reconnect in error state it should change its state as soon as openHAB received a new event from this device or if you try to execute an action. If this does not happen it would be better to fix the state handling for these situation. You could help by providing me some detailed logs if you have this situation. The following would help: |
In the mean time during some tests I was able to reproduce the problem with one of my HmIP devices. Strangely it only happens sometimes because it is some sort of timing issue. |
I have modified the reconnect handling in PR #11429 . In my environment, I no longer had problems with HmIP devices. If your problem also happens with the implementation of the PR, I would need some log information. |
Unfortunately I am not familiar with Github (not yet at least). |
@Joerg-Dr You can download it from here: https://github.com/MHerbst/openhab-addons-test |
Thank you for the new version. I installed and tested it, here is the result: Here ist the Debug log file: |
After pressing "Save (CTRL-S)" on the Thing "Wohnzimmer.HmIP-STHD" page, the HmIP device immediately changed to "online" status. Homematic 10-12-2021 (after Pressing Save).log This is the function I suggested: An automatic re-initialization of any devices that stay in "Error" mode after a certain time. |
@Joerg-Dr First if all in the log file I can see this message: If this does not help, please test what happens if the binding receives an event from the device or what happens if you change an item value. Changes the state to "Online"? Generally I think, the current behaviour is more a problme on the Homematic site. It seems that daemon servicing requests for HmIP devices gets into trouble if it has to answer to multiple requests in a rather short time. That's why sometimes a device gets an error state. In my environment this was really hard to reproduce (I have got only 4 HmIP devices). |
@MHerbst Increasing the "Callback Reg. Timeout" time from 120 to 300 seconds solves the issue with the "slow" CCU2. My proposal of an automatic re-enabling was only an idea to handle situations where a connect timeout had occured, no matter why it happened. In that way errors could possibly be repaired without user interaction, which could be of advantage . But, for me it would also be fine to leave it like it is, what ever you like. |
@Joerg-Dr Thanks for the retest. In my opinion, parts of the binding would have to be completely reworked. E.g. I would prefer to create an own bridge thing for each connection type (HM-RF, HmIP, Groups, CuxD). But would be a breaking change. But we can leave this issue open as a reminder. |
I understand very well, I have the same problem :-) |
I have a (similar?) problem, too. I think its the same root-cause: |
Yes, this is the cause of the problem and the reason I made this suggestion, so that reconnects should be done automatically. But as MHerbst mentioned, this would be not so easy to implement. @MHerbst |
The reason for the problem is the CCU and how it handles HmIP devices. After a restart all "old" HM devices are immediately online. But for some HmIP devices it can take about 5 min. until they are online in the CCU. @Elle4u Have you updated to 3.2? The reconnect handling should be better in this version, but probably not 100% reliable because of reasons I mentioned above. @Joerg-Dr Yes the new version of the binding is included in OH 3.2 and the enhancements are included (they were merged right in time). |
This feature request is a suggestion to enhance the re-connection of disconnected devices when the Homematic CCU had been rebooted or had been offline for any other reason.
It is related to this bug report: #8808
More detailed:
After connection loss of the Homematic binding to the CCU, some of the Homematic devices (mainly the Homematic IP devices) are not recognized in time and therefore stay in status "Error".
There exists a solution for this problem available from binding version 3.2.0 by extending the waiting time for devices to become available.
But after the total waiting time had expired, there will be no more retries and therefore non-responding Homematic devices could remain in status "Error".
The suggestion is to implement an automatic connection retry of those "failed" devices every xx minutes, so that the system will never give up to establish a connection.
My environment:
Original Homematic CCU2 with several Homematic and Homematic IP devices.
OpenHAB 3.1.0 release build running on Raspberry Pi 4.
The text was updated successfully, but these errors were encountered: