openhab-core: The channelLinked method is not called after restart
If a channel is dynamically added to a thing, on restart of openHAB the channelLinked
method doesn’t get called after initial linking of the item to the channel.
If items are defined in a .items file, the channelLinked
method will get called if the file is edited or touched after OH3 is up and running.
This is a regression from OH2 and is similar to https://github.com/openhab/openhab-core/issues/1596
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 35 (23 by maintainers)
Commits related to this issue
- [lcn] Fix initial polling of linked Channels Fixes #9086 Relates to openhab/openhab-core#1707 Signed-off-by: Fabian Wolter <github@fabian-wolter.de> — committed to fwolter/openhab-addons by fwolter 4 years ago
- [astro] Trigger or not jobs restart when a positional channel is linked or unlinked Don't rely on calls to channelLinked at startup Related to openhab/openhab-core#1707 Signed-off-by: Laurent Garni... — committed to lolodomo/openhab-addons by lolodomo 4 years ago
- [lcn] Fix initial polling of linked Channels (#9103) Fixes #9086 Relates to openhab/openhab-core#1707 Signed-off-by: Fabian Wolter <github@fabian-wolter.de> — committed to openhab/openhab-addons by fwolter 4 years ago
- [homematic] Better OH3 compatibility (#9102) * Max value and format pattern were not correct for dimmers (Fixes #8799) * Fixed calls to deprecates methods/constructors * Make sure channelLinked is ... — committed to openhab/openhab-addons by MHerbst 4 years ago
- [astro] Trigger or not jobs restart when a positional channel is linked or unlinked (#9104) Don't rely on calls to channelLinked at startup Related to openhab/openhab-core#1707 Signed-off-by: L... — committed to openhab/openhab-addons by lolodomo 4 years ago
- * fixed refresh handing due `channelLinked` not called anymore on startup for example (similar to https://github.com/openhab/openhab-core/issues/1707), * "Impacted Modules" can be empty if button is c... — committed to crnjan/openhab-addons by crnjan 4 years ago
- * fixed refresh handing due `channelLinked` not called anymore on startup for example (similar to https://github.com/openhab/openhab-core/issues/1707), * "Impacted Modules" can be empty if button is c... — committed to crnjan/openhab-addons by crnjan 4 years ago
- [nikobus] fixed refresh handling (#9114) * * fixed refresh handing due `channelLinked` not called anymore on startup for example (similar to https://github.com/openhab/openhab-core/issues/1707), * "... — committed to openhab/openhab-addons by crnjan 4 years ago
- Adds channels that are linked to the poll set. See https://github.com/openhab/openhab-core/issues/1707 Signed-off-by: Dan Cunningham <dan@digitaldan.com> — committed to digitaldan/org.openhab.binding.zwave by digitaldan 3 years ago
- Adds channels that are linked to the poll set. See https://github.com/openhab/openhab-core/issues/1707 Signed-off-by: Dan Cunningham <dan@digitaldan.com> — committed to digitaldan/org.openhab.binding.zwave by digitaldan 3 years ago
- Adds channels that are linked to the poll set. See https://github.com/openhab/openhab-core/issues/1707 (#1493) Signed-off-by: Dan Cunningham <dan@digitaldan.com> — committed to openhab/org.openhab.binding.zwave by digitaldan 3 years ago
- [lcn] Fix initial polling of linked Channels (#9103) Fixes #9086 Relates to openhab/openhab-core#1707 — committed to nowaterman/openhab-addons by fwolter 4 years ago
- [homematic] Better OH3 compatibility (#9102) * Max value and format pattern were not correct for dimmers (Fixes #8799) * Fixed calls to deprecates methods/constructors * Make sure channelLinked is ... — committed to nowaterman/openhab-addons by MHerbst 4 years ago
- [astro] Trigger or not jobs restart when a positional channel is linked or unlinked (#9104) Don't rely on calls to channelLinked at startup Related to openhab/openhab-core#1707 — committed to nowaterman/openhab-addons by lolodomo 4 years ago
- [nikobus] fixed refresh handling (#9114) * * fixed refresh handing due `channelLinked` not called anymore on startup for example (similar to https://github.com/openhab/openhab-core/issues/1707), * "... — committed to nowaterman/openhab-addons by crnjan 4 years ago
- [lcn] Fix initial polling of linked Channels (#9103) Fixes #9086 Relates to openhab/openhab-core#1707 Signed-off-by: Fabian Wolter <github@fabian-wolter.de> — committed to boehan/openhab-addons by fwolter 4 years ago
- [homematic] Better OH3 compatibility (#9102) * Max value and format pattern were not correct for dimmers (Fixes #8799) * Fixed calls to deprecates methods/constructors * Make sure channelLinked is ... — committed to boehan/openhab-addons by MHerbst 4 years ago
- [astro] Trigger or not jobs restart when a positional channel is linked or unlinked (#9104) Don't rely on calls to channelLinked at startup Related to openhab/openhab-core#1707 Signed-off-by: L... — committed to boehan/openhab-addons by lolodomo 4 years ago
- [nikobus] fixed refresh handling (#9114) * * fixed refresh handing due `channelLinked` not called anymore on startup for example (similar to https://github.com/openhab/openhab-core/issues/1707), * "... — committed to boehan/openhab-addons by crnjan 4 years ago
- Adds channels that are linked to the poll set. See https://github.com/openhab/openhab-core/issues/1707 (#1493) Signed-off-by: Dan Cunningham <dan@digitaldan.com> — committed to xiweilej/openhab by xiweilej in 3 years
I will try and find some time to look at this for ZWave and ZigBee on Thursday or Friday.
Maybe, but that’s not relevant. If I understand correctly, the only buggy part is that the REFRESH command got called too many times. I think we can agree that shouldn’t be the case, but that is not related to this issue.
You make out like binding developers are doing something wrong, but in the past, even if not now, this was the case that this that this call WAS meant to be called after initialisation -:
https://github.com/eclipse-archived/smarthome/pull/1890
True, but that requires a change to the way things work, and as we see, it has broken things, and adding code to loads of bindings which doesn’t seem sensible.
Maybe it doesn’t now, but as I showed above - it looks like it used to - you even implemented this yourself.
I tried @wborn suggestion and it works. Specifically, I added something like:
I hope the decision is to fix this, not fixing it feels wrong. Also, at a minimum, the channelLinked javadoc will need to be updated to indicate that this might not get called and can not be relied on.