Some Thing definitions fail on yaml file-config migration

Hi guys…

Since we have a new year - btw happy new year to y’alll - I decided to upgrade from 5.0.2 to 5.1.0, and while doing that I decided to use textual yaml config for my things and items, because I used db-based config for 2-3 years now and never got warm with it…

What I did after upgrading to 5.1.0:

  • first of all i generated items and things config files in DSL and Yaml from MainUI to have a backup…
  • then I opened my karaf-console and removed all things, items and links while openhab was running (karaf commands: openhab:things clear, openhab:items clear, openhab:links clear).
  • then I stopped openhab, cleared the cache and added my MainUI generated yaml files to their folder.
  • now I started openhab and restarted it after 2-3 minutes to avoid any “first-start-hickups”

this went mostly good so far but i was missing things from two bindings:

  • ESPHome Binding
  • WLED Binding

i tried to extract the yaml config from the ESPs found in the inbox but this isn’t working like expected.

  esphome:device:mwsensor-04:
    label: ESPHome - Motion Gym
    location: Gym
    config:
      deviceId: mwsensor-04
      hostname: 192.168.xxx.xxx

  esphome:device:mwsensor-05:
    label: ESPHome - Motion Livingroom
    location: Livingroom
    config:
      deviceId: mwsensor-05
      hostname: 192.168.xxx.xxx

I also tried with more options gathered from the MainUI db-definition (which has more entries than the generated yaml).

  esphome:device:mwsensor-04:
    label: ESPHome - Motion Gym
    location: Gym
    config:
      deviceId: mwsensor-04
      hostname: 192.168.xxx.xxx
      port: 6053
      encryptionKey: <my key>
      reconnectInterval: 30
      pingInterval: 20
      maxPingTimeouts: 5
      deviceLogLevel: "INFO"
      enableBluetoothProxy: false

  esphome:device:mwsensor-05:
    label: ESPHome - Motion Livingroom
    location: Livingroom
    config:
      deviceId: mwsensor-05
      hostname: 192.168.xxx.xxx
      port: 6053
      encryptionKey: <my key>
      reconnectInterval: 30
      pingInterval: 20
      maxPingTimeouts: 5
      deviceLogLevel: "INFO"
      enableBluetoothProxy: false

after that I tried to add the non working things as DSL files but this is also not working. So I guess it is not a general yaml & DSL error but maybe something is expected from MainUI which is special to these Bindings - some extra definitions to make them work - otherwise I have to discuss this further with the binding-devs?!??

Has anyone got these Bindings running with yaml file-config?

Or maybe any ideas what else I could do to further debug this? The logs don’t give any info of what is happening while init of the things - they are ignored.

Have a nice day and thanks for any ideas or suggestions!

edit: I restarted again and this is part of my logs where openhab throws a warning while yaml init:

2026-01-05 09:37:21.774 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/androidtv.yml (1 things with AndroidTVHandlerFactory)
2026-01-05 09:37:21.783 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/harmony.yml (9 things with HarmonyHubHandlerFactory)
2026-01-05 09:37:21.786 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/chromecast.yml (1 things with ChromecastHandlerFactory)
2026-01-05 09:37:21.788 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/http.yml (3 things with HttpHandlerFactory)
2026-01-05 09:37:21.814 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/icalendar.yml (5 things with ICalendarHandlerFactory)
2026-01-05 09:37:21.834 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/jellyfin.yml (1 things with JellyfinHandlerFactory)
2026-01-05 09:37:21.851 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/mqtt.yml (36 things with MqttThingHandlerFactory)
2026-01-05 09:37:21.855 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/milight.yml (12 things with MilightHandlerFactory)
2026-01-05 09:37:21.872 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/network.yml (18 things with NetworkHandlerFactory)
2026-01-05 09:37:21.872 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/miio.yml (1 things with MiIoHandlerFactory)
2026-01-05 09:37:21.872 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/ntp.yml (2 things with NtpHandlerFactory)
2026-01-05 09:37:21.912 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.util.ConcurrentModificationException: null
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1687) ~[?:?]
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129) ~[?:?]
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527) ~[?:?]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513) ~[?:?]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150) ~[?:?]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647) ~[?:?]
at org.openhab.core.model.yaml.internal.things.YamlThingProvider.retryCreateThing(YamlThingProvider.java:314) ~[?:?]
at org.openhab.core.model.yaml.internal.things.YamlThingProvider.lambda$24(YamlThingProvider.java:284) ~[?:?]
at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
at org.openhab.core.model.yaml.internal.things.YamlThingProvider.lambda$22(YamlThingProvider.java:283) ~[?:?]
at java.util.concurrent.ConcurrentHashMap$KeySetView.forEach(ConcurrentHashMap.java:4709) ~[?:?]
at org.openhab.core.model.yaml.internal.things.YamlThingProvider.thingHandlerFactoryAdded(YamlThingProvider.java:277) ~[?:?]
at org.openhab.core.model.yaml.internal.things.YamlThingProvider.lambda$21(YamlThingProvider.java:260) ~[?:?]
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:?]
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1024) ~[?:?]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?]
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
at org.openhab.core.model.yaml.internal.things.YamlThingProvider.onReadyMarkerAdded(YamlThingProvider.java:259) ~[?:?]
at org.openhab.core.internal.service.ReadyServiceImpl.lambda$0(ReadyServiceImpl.java:54) ~[?:?]
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:?]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1858) ~[?:?]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?]
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
at org.openhab.core.internal.service.ReadyServiceImpl.notifyTrackers(ReadyServiceImpl.java:78) ~[?:?]
at org.openhab.core.internal.service.ReadyServiceImpl.markReady(ReadyServiceImpl.java:54) ~[?:?]
at org.openhab.core.config.core.xml.osgi.XmlDocumentBundleTracker.registerReadyMarker(XmlDocumentBundleTracker.java:417) ~[?:?]
at org.openhab.core.config.core.xml.osgi.XmlDocumentBundleTracker.finishBundle(XmlDocumentBundleTracker.java:360) ~[?:?]
at org.openhab.core.config.core.xml.osgi.XmlDocumentBundleTracker.processBundle(XmlDocumentBundleTracker.java:383) ~[?:?]
at org.openhab.core.config.core.xml.osgi.XmlDocumentBundleTracker$2.run(XmlDocumentBundleTracker.java:345) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
at java.lang.Thread.run(Thread.java:1583) [?:?]
2026-01-05 09:37:21.921 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/squeezebox.yml (14 things with SqueezeBoxHandlerFactory)
2026-01-05 09:37:21.922 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/openweathermap.yml (2 things with OpenWeatherMapHandlerFactory)
2026-01-05 09:37:21.935 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/upnpcontrol.yml (1 things with UpnpControlHandlerFactory)
2026-01-05 09:37:21.973 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/wled.yml (6 things with WLedHandlerFactory)
2026-01-05 09:37:22.069 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/astro.yml (2 things with AstroHandlerFactory)
2026-01-05 09:37:22.089 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/shelly.yml (3 things with ShellyHandlerFactory)
2026-01-05 09:37:22.114 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/ipcamera.yml (3 things with IpCameraHandlerFactory)
2026-01-05 09:37:22.147 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/mqtt.yml (2 things with MqttBrokerHandlerFactory)
2026-01-05 09:37:22.380 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/bluetooth.yml (1 things with ESPHomeHandlerFactory)
2026-01-05 09:37:22.382 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/denonmarantz.yml (1 things with ESPHomeHandlerFactory)
2026-01-05 09:37:22.598 [INFO ] [.influxdb.InfluxDBPersistenceService] - InfluxDB persistence service started.
2026-01-05 09:37:22.666 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing ‘esphome:device:mwsensor-01’ to inbox.
2026-01-05 09:37:22.723 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing ‘esphome:device:mwsensor-04’ to inbox.
2026-01-05 09:37:22.753 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing ‘esphome:device:mwsensor-02’ to inbox.
2026-01-05 09:37:22.782 [INFO ] [internal.ModuleHandlerFactoryStarter] - WebPushNotificationModuleHandlerFactory started by ModuleHandlerFactoryStarter
2026-01-05 09:37:22.802 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing ‘esphome:device:mwsensor-05’ to inbox.
2026-01-05 09:37:22.810 [WARN ] [.transport.servlet.ServletController] - Can’t find the request for https://192.168.15.161:8443/rest/inbox’s Observer
2026-01-05 09:37:22.816 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing ‘esphome:device:mwsensor-03’ to inbox.
2026-01-05 09:37:22.830 [WARN ] [.transport.servlet.ServletController] - Can’t find the request for https://192.168.15.161:8443/rest/inbox’s Observer
2026-01-05 09:37:22.881 [INFO ] [hab.ui.habot.tile.internal.HABotTile] - Started HABot at /habot
2026-01-05 09:37:23.428 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/mqtt.yml (1 things with HomieThingHandlerFactory)
2026-01-05 09:37:23.431 [INFO ] [ml.internal.things.YamlThingProvider] - Refreshing YAML model yaml/things/homie.yml (1 things with HomieThingHandlerFactory)
2

At least the ESPHome binding appears to be running since it detected your ESPs and added them to the inbox.

AFAIK the only 3 config props necessary are deviceId, hostname and encryptionKey, the rest are optional.

  1. Does the ESPs work if you add them through MainUI?
  2. What does your DSL config look like when you tested?
  3. Which log messages were shown when it wasn’t working with DSL?

I’ve never tested the new YAML file format, so cannot assist with that.

Hi Arne…

meanwhile I tested a workaround before I read your reply… i added the things from the inbox - this is only partly working.

Actual behavior is:
add things from inbox, change hostname to the actual esphome ip-addresses and everything works just fine - but not like expected.

Because - like mentioned in the ESPHome Binding FAQ - openhab defaults the hostname to “espname.local.” (the . on the end is not a typo!) on reboot.

But the devices never register using a domain-/hostname but are only reachable using their ip …the only workaround for this is using textual config (which is sort of funny)… btw I’m not using DSL but yaml config for my textual config, because you mentioned DSL.

So it is a workaround to use the MainUI db for esphome, but it does not survive a reboot…


Edit: I just realized that even if I add the things from the MainUI inbox, all channel links which are defined in my items.yaml and parsed by MainUI are not added for the ESPHome Binding items.

Even though the channel names match.

The things are listed now but without the item channel links. So until I manually add these links nothing is working…

You mentioned

first of all i generated items and things config files in DSL

that is why I asked.

A simple line in a .things file like this works well for me;

esphome:device:mydevice "ESPHome Device" [hostname="192.168.XXX.XXX", encryptionKey="XXXX0=", deviceId="mydevice"]

could you try that?

It if doesn’t work, you’ll need to share some DEBUG level logs of your startup sequence for me to further assist you.

BRG

:wink: You’re right I mentioned DSL but only for backup purposes….

I’ll give it a try if this survives a reboot… wait a minute :slight_smile:


Edit Ok, tried a few things now…

At first I added my “complete” yaml definitions do a DSL dummy and added it to my things folder.
Then I removed my esphome.yaml and restarted the first time - no changes

Then i additionally removed the db entries lately added - also no change

Finally I removed all unnecessary config from the DSL dummy so that only

  • name
  • location
  • hostname (ip)
  • encryption key

This worked - the dummy esphome item shows up… but also without any channel linking.

Next I will try if linking my items will survive a reboot…

Thanks for your help! …I’m not glad with this solution but should be a workaround if rebooting is fine. We’ll see :wink:

I’ll report back…

Ok, so far it is working - even after reboots the linking is still intact…

Thanks a ton for this workaround! :slight_smile:

Just a quick update…

I installed 5.1.1 Yesterday and removed the workaround with the DSL definitions - now everything works like expected after the update :wink: fine!

I mark this as solved…