Openhab-addons: [lcn] Values not initially loaded on/after start

Created on 20 Nov 2020  路  5Comments  路  Source: openhab/openhab-addons

Expected Behavior

When starting OH3 all module channel states, e.g. outputs, relays, variables should be retrieved / updated.
No issue at all in OH2, where it seems the update is happening directly after connection. I see some warnings which indicate to me there is a scan happening:
00:31:57.445 [DEBUG] [ernal.connection.AbstractStateMachine] - Changing state ConnectionStateSegmentScan -> ConnectionStateConnected 00:32:09.855 [WARN ] [nding.lcn.internal.connection.ModInfo] - S000M092: Failed to receive status message: Output 1: Failed finally after 3 tries 00:32:12.878 [WARN ] [nding.lcn.internal.connection.ModInfo] - S000M090: Failed to receive status message: VARIABLE 3: Failed finally after 3 tries
I'm not seeing any of those warnings in OH3.

Current Behavior

On start no values retrieved. Once a module sends an update via the LCN bus, the value is picked up. This can also be forced by switching an output on / off, for example.
From the logs I see no polling or request for updates at all, just passively receiving values. Only when adding the module, it seems to retrieve all values.

Steps to Reproduce (for Bugs)

  1. Install OH3
  2. Install LCN Binding
  3. Add module
  4. Restart OH3 without restoring values from e.g. MapDB
  5. Module will indicate "NULL" state for e.g. outputs

Your Environment

OH3 - Build #2022

bug

Most helpful comment

The binding relies on the initial REFRESH commands, which are triggered by channelLinked. As this method is not called anymore, the initial values aren't polled. The fix from @robnielsen in https://github.com/openhab/openhab-core/issues/1707#issuecomment-709273658 seems to work. I will add it to the binding.

All 5 comments

Maybe the LCN binding is another binding impacted by the change related to channelLinked in the core framework:
https://github.com/openhab/openhab-core/issues/1707

Just looking at the code I'm not sure it is really related. This method does not seem to be used.
Any idea @fwolter ? Anything I can test?

It depends on whether the binding is relying or not on calls to channelLinked to initialize the channels. It should not (because it will not work properly in OH3).

The binding relies on the initial REFRESH commands, which are triggered by channelLinked. As this method is not called anymore, the initial values aren't polled. The fix from @robnielsen in https://github.com/openhab/openhab-core/issues/1707#issuecomment-709273658 seems to work. I will add it to the binding.

Thanks for prompt action

Was this page helpful?
0 / 5 - 0 ratings

Related issues

openPhiL picture openPhiL  路  5Comments

Alex5719 picture Alex5719  路  6Comments

Nikos78 picture Nikos78  路  5Comments

gk4 picture gk4  路  3Comments

DanielMalmgren picture DanielMalmgren  路  5Comments