-
-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OH 4] Channel ID contains invalid characters #3336
Comments
Just to note that underscores have always been allowed in the past. The zwave thing IDs all use userscores since the database creates the thing id based on manufacturer, name, version - separated with underscores - eg Also to note that the xsd uses the following -:
|
I'm exploring more with @mhilbush on the forum. The error might be misleading or something else may be going on. We both have other Things with Channel UIDs that include underscores that are working just fine. I also went in and manually edited my JSONDB files to change the underscores to dashes for my Zigbee Things and I'm still getting the error. Has there been a recent change in the Zigbee binding that is now calling
Something merged in the past week or so? Given the behavior I'm not convinced any more that the error being reported is the actual root error. But I agree, the regex should be fixed in ChannelUID to match and IMO the XSD and code should be using the exact same regex. The XSD is actually more constrained than what's in the ChannelUID except for the inclusion of Hmmm, I wonder if the error is that the full Channel UID is being passed to the validator but the validator is only expecting the last segment? The name implies it wouldn't want the full UID and it's actually chocking on the |
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/openhab-4-0-snapshot-discussion/142322/108 |
There haven't been any significant changes to the zigbee binding for some time so I don't think changes to the binding should be causing this. https://github.com/openhab/org.openhab.binding.zigbee/pulls?q=is%3Apr+is%3Aclosed |
Well, there is this change. But I'm not immediately seeing how it could result in the error you're getting. |
But |
I guess we should wait for @J-N-K to peel this back further... |
Well, there is indeed a change. Before We can log a warning and return |
But even if the valid channelId-part were passed it would still fail the check because of the So as I see it there are three problems here.
|
The regex is fine. See https://docs.oracle.com/javase/tutorial/essential/regex/pre_char_classes.html |
That's what I get for going by memory. So we have two problems, 1 and 3. |
The XSD has the same characters. The backslash is needed because |
Even if they are logically the same it seems weird to define it two different ways in the two places. My concern is not that they are not equivalent but that the representations are different (though not realizing that the Given they define the allowed format for this same ID field it seems inconsistent and a little troubling to represent the REGEX two different ways, even if they are equivalent. But if the developers don't care, this isn't something that end users have to see and mentally work around so it's no big deal I guess. So do I need to file an issue on the add-on and close this one? |
Not a core isse. |
This is related to OH 4 SNAPSHOT build #3292.
After upgrading to the latest snapshot today I'm getting errors on the Zigbee binding.
Something recently changed which appears to now be enforcing that regex in the Channel IDs. In this particular case it doesn't like
_
in the channel ID.Looking at the code where the error is generated there hasn't been any meaningful changes to the code in years. At the same time, these UIDs created by the Zigbee binding have also been working in my OH for years without complaint.
My initial thought was to go file an issue on the binding, but it occurs to me that forcing the recreation of a bunch of Things to upgrade to OH 4 (I do not know whether the Zigbee binding is the only one impacted) is going to be a pretty big job to impose on the end users. So I wanted to open an issue here to float the idea of changing the regex to also allow underscore in addition to dash.
Unless there is some side effect or concern I'm unaware of this seems to be the smallest impact way to address the problem across the board.
The text was updated successfully, but these errors were encountered: