Different initialization behaviour for Things text based vs MainUI

I’ve noticed a difference in the initialization of things depending on if it is text based (yaml or DSL) vs MainUI configured. I’ve only noticed this with the dirigera and zwave binding based things. Behaviour is very similar but not exact.

Things configured via MainUI are initialized immediately and channels are available.

If configured via text (yaml or DSL) they do not become fully initialized, and channels are not available, and does not fully come online. If the thing is disabled and enabled the thing becomes online immediately showing all channels.

The difference I noticed with the dirigera things is that they are shown as uninitialized, where as with zwave they are shown online but the type is unknown. No channels show up in either case.

I don’t see anything special in the logs, but not sure if it’s a binding issue or openhab issue.

The disable-and-enable workaround is a useful clue, because it suggests the text-defined Thing is being created before its bridge or required configuration is ready, rather than the binding itself being broken. Compare the MainUI-created Thing with the text version field by field, especially the bridge UID and any channel or configuration parameters that MainUI fills in by default. It would also help to enable debug logging for the Dirigera and Z-Wave bindings during a restart, since the first initialization attempt may be failing silently before the manual re-enable succeeds.

I think @mikaelkorhonen is on the right track. But there is one unanswered question, does this happen every time OH starts or only after an upgrade or cache clearing?

This happens when new thing is added.

Startup behaviour is different as well. For Dirigera, the Things are all unknown (except for the gateway) and do not become online until I enable/disable them. The same happens if the gateway goes offline momentarily, the status of the Things become unknown.
For Z-Wave, after startup, the things all become online, but never fully initialize. The thing type shows “unknown device” until I disable/enable the Thing. For both bindings, things configured via the MainUI, after startup then are both online and thing type is immediately known for zwave. Thing type is always known for Dirigera regardless.

Another odd thing for text based with Zwave, if I have a dead node, on startup it’s always shown as online, until I disable/enable it then it shows offline/communication error. MainUI configured Things that are a dead node are immediate shown as offline/communication error.

Looking at the logs, I don’t see anything obvious. With ZWave, for the Node I see “Polling deferred until initialisation complete” and initialization never happens for text based.