Exception: ID segment contains invalid characters - control character in ID of homematic device

I get an exception ‘ID segment contains invalid characters’ in my log file of my Openhab 3 with homematic binding.

As you can see in the exception below the ID contains a ‘18’ (hex) control character between ‘A1’ and ‘A9’ of the ID ‘000A1A996E7B1’. This character is invisible but may appear if you mark the id with the mouse in the stacktrace.

The thing could be a Homematic IP HmIP-eTRV-2 with the serial number ‘000A18A996E7B1’. But this ID contains an ‘8’ instead of the wrong character.
I added this device via the openhab 3 UI with auto discovery. So the thing id should be determined by the homematic binding.

So this leads me to the following questions:

  1. Any idea how that can happen?
  2. And more important: any idea how I can correct that?

Thank You!

2022-06-18 16:03:55.620 [ERROR] [ternal.handler.HomematicThingHandler] - ID segment '000A1A996E7B1' contains invalid characters. Each segment of the ID must match the pattern [\w-]*.
java.lang.IllegalArgumentException: ID segment '000A1A996E7B1' contains invalid characters. Each segment of the ID must match the pattern [\w-]*.
	at org.openhab.core.common.AbstractUID.validateSegment(AbstractUID.java:98) ~[?:?]
	at org.openhab.core.common.AbstractUID.<init>(AbstractUID.java:76) ~[?:?]
	at org.openhab.core.common.AbstractUID.<init>(AbstractUID.java:59) ~[?:?]
	at org.openhab.core.thing.UID.<init>(UID.java:57) ~[?:?]
	at org.openhab.core.thing.ThingUID.<init>(ThingUID.java:139) ~[?:?]
	at org.openhab.core.thing.ChannelUID.getThingUID(ChannelUID.java:150) ~[?:?]
	at org.openhab.core.thing.internal.CommunicationManager.stateUpdated(CommunicationManager.java:530) ~[?:?]
	at org.openhab.core.thing.internal.ThingManagerImpl$1.stateUpdated(ThingManagerImpl.java:176) ~[?:?]
	at org.openhab.core.thing.binding.BaseThingHandler.updateState(BaseThingHandler.java:231) ~[?:?]
	at org.openhab.binding.homematic.internal.handler.HomematicThingHandler.updateChannelState(HomematicThingHandler.java:439) ~[?:?]
	at org.openhab.binding.homematic.internal.handler.HomematicThingHandler.updateDatapointState(HomematicThingHandler.java:411) ~[?:?]
	at org.openhab.binding.homematic.internal.handler.HomematicBridgeHandler.onStateUpdated(HomematicBridgeHandler.java:281) ~[?:?]
	at org.openhab.binding.homematic.internal.communicator.AbstractHomematicGateway.lambda$1(AbstractHomematicGateway.java:744) ~[?:?]
	at org.openhab.binding.homematic.internal.misc.DelayedExecuter.start(DelayedExecuter.java:65) ~[?:?]
	at org.openhab.binding.homematic.internal.communicator.AbstractHomematicGateway.eventReceived(AbstractHomematicGateway.java:741) ~[?:?]
	at org.openhab.binding.homematic.internal.communicator.server.RpcResponseHandler.handleEvent(RpcResponseHandler.java:98) ~[?:?]
	at org.openhab.binding.homematic.internal.communicator.server.RpcResponseHandler.handleMethodCall(RpcResponseHandler.java:51) ~[?:?]
	at org.openhab.binding.homematic.internal.communicator.server.RpcResponseHandler.handleMethodCall(RpcResponseHandler.java:68) ~[?:?]
	at org.openhab.binding.homematic.internal.communicator.server.XmlRpcServer$ResponseHandler.handle(XmlRpcServer.java:125) ~[?:?]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.Server.handle(Server.java:516) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:386) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) [bundleFile:9.4.43.v20210629]
	at java.lang.Thread.run(Thread.java:829) [?:?]

Hi Michael,

that’s a bit weird. Maybe the log can help us to figure out what’s going wrong. Please try the following:

  • set the log level for the Homematic binding to TRACE
  • restart openHAB
  • start a new discovery and try to create a thing for the device

Post the openhab.log file with the content from the openHAB start until the stacktrace.

BTW: please give us some information about the environment (openHAB version, used hardware and operating system).