Description
When discovering this Thing:
clicking it and selecting "Copy DSL Definition", the following output is generated:
Thing danfossairunit:airunit:"-1062731542" [host="ccm.local"]
Putting this into a .things file will result in the following error:
2025-03-17 21:09:46.503 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'danfoss2.things'
2025-03-17 21:09:46.508 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'danfoss2.things' has errors, therefore ignoring it: [1,30]: missing RULE_ID at '"-1062731542"'
After manually removing the quotes:
Thing danfossairunit:airunit:-1062731542 [host="ccm.local"]
this is the result:
2025-03-17 21:11:44.748 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'danfoss2.things'
2025-03-17 21:11:44.752 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'danfoss2.things' has errors, therefore ignoring it: [1,30]: extraneous input '-' expecting RULE_ID
It looks like DSL doesn't accept this syntax, although it does appear to be a valid ThingUID:
So either the UID validation is not strict enough, or the DSL validation is too strict?
Related to #4569, but also has UI impact here where none of the buttons can be clicked:
Expected Behavior
Either validateSegment
should throw:
Or it should be possible to provide this ThingUID in a .things file.
Current Behavior
This constructor:
accepts:
new ThingTypeUID("danfossairunit", "airunit"), "-123"
Possible Solution
TBD.
Steps to Reproduce (for Bugs)
See above.
In 4.3 the UI allowed to add this ThingUID as a managed Thing:
Also it was accepted when manually creating a Thing:
whereas in 5.0:
This is related to openhab/openhab-webui#3059
Context
I'm working on the Danfoss Air Unit binding, and found this old oddness:
I can easily fix this in case the outcome of this issue is that the ThingUID
validation is made more strict.
Your Environment
- Version used: 5.0 snapshot 4547