Skip to content
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

[nikohomecontrol] Connection with NHC does not recover after configuration update #10263

Closed
sindalschmidt opened this issue Mar 1, 2021 · 6 comments · Fixed by #10281
Closed
Assignees
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@sindalschmidt
Copy link

Expected Behavior

When making changes to the Niko Home Control configuration, ex. change the lux threshold of a sensor, the binding should rediscover and resume connection with the Niko Home Control installation.

Current Behavior

The binding stops working. The binding shows the thing 'Niko Home Control II Binding' as online, but all other things show 'OFFLINE - CONFIGURATION_ERROR'.
image

The binding no longer reflects actions in the Niko Home Control. No events are shown in the 'events.log' either.

The only way to fix this issue is restarting openHAB several times. Sometimes the binding does not work until after several restarts. I have tested with Home Assistant and that binding does not have an issue with updated configurations on the controller.

View attached DEBUG logfiles. Updates to the NHC configuration happens 15:44:36, which then brakes the configuration. Logs are extracted from time: 15:32:47 to 15:55:28
openhab.log
events.log

Steps to Reproduce (for Bugs)

  1. Have a working Niko Home Control binding setup.
  2. Make a change in the Niko Home Control software configuration and upload it to the controller.
  3. The Niko Home Control binding will drop configuration and enter a broken state.
@sindalschmidt sindalschmidt added the bug An unexpected problem or unintended behavior of an add-on label Mar 1, 2021
@sindalschmidt
Copy link
Author

It seems as if events are indeed recording in the 'openhab.log' but no events are showing in the 'events.log' at all.

Here, in the 'openhab.log', I am turning on and off some switches in Niko Home app on my phone:
image

However no events are being logged in the 'events.log' since the configuration upload. The logs stopped, as shown in the original attached logs, at 15:44:42.611 as the last event.

@mherwege
Copy link
Contributor

mherwege commented Mar 1, 2021

I will look into this, but it may take a while before I get to this. In the mean time, when you update the configuration in Niko Home Control, you can simply disable and re-enable the bridge thing. I believe that will bring back the connection.
My development and live enivronments have moved on to OH3. So I will likely only fix this for OH3.

@mherwege
Copy link
Contributor

mherwege commented Mar 1, 2021

I understand you are running OH 2.5. Can you be more precise? Are you on the last 2.5?

@sindalschmidt
Copy link
Author

I understand you are running OH 2.5. Can you be more precise? Are you on the last 2.5?

I am running 2.5.11 at the moment, as I have not seen any updates to Niko Home Control in either 2.5.12 or 3.0.

I also notice these events sometimes:
2021-03-01 16:41:12.390 [DEBUG] [handler.NikoHomeControlActionHandler] - Niko Home Control: handle command OFF for nikohomecontrol:onOff:443b00ee9a2f:b0659751-cec8-4c46-a63f-3aad71f6307b:switch 2021-03-01 16:41:12.392 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: java.lang.NullPointerException: null at org.openhab.binding.nikohomecontrol.internal.handler.NikoHomeControlActionHandler.handleSwitchCommand(NikoHomeControlActionHandler.java:120) ~[?:?] at org.openhab.binding.nikohomecontrol.internal.handler.NikoHomeControlActionHandler.handleCommandSelection(NikoHomeControlActionHandler.java:97) ~[?:?] at org.openhab.binding.nikohomecontrol.internal.handler.NikoHomeControlActionHandler.lambda$0(NikoHomeControlActionHandler.java:81) ~[?:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_275] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_275] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_275] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:1.8.0_275] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_275] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_275] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_275]

Usually I can also find the things in the "OTHER" tab. They do not work. I can work around this by restarting the openHAB once if I'm lucky – sometimes it might take a couple of restarts.

@mherwege mherwege self-assigned this Mar 2, 2021
@mherwege
Copy link
Contributor

mherwege commented Mar 2, 2021

I have a suspicion on what is causing this. To be 100% sure, could you put the binding in TRACE log? I need to see the messages coming back from the Niko Home Control controller, and these specific ones are not visible in DEBUG log. I suspect there to be devices.changed events.
The NullPointerException is probably a consequence of my handling of devices.changed events.
Again, I only intend to fix this for OH3. I don't want to keep two development environments.

@sindalschmidt
Copy link
Author

No problem Mark. I will upgrade to OH3 soon. Attached is the logs. An configuration change was made around late 17:56.
events2.log
openhab2.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
2 participants