Skip to content
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

[airq] naming conflic between CO and CO2 items #13909

Closed
MikeTheTux opened this issue Dec 11, 2022 · 9 comments · Fixed by openhab/openhab-webui#1578
Closed

[airq] naming conflic between CO and CO2 items #13909

MikeTheTux opened this issue Dec 11, 2022 · 9 comments · Fixed by openhab/openhab-webui#1578
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@MikeTheTux
Copy link
Contributor

When creating items for the channels CO Concentration and CO₂ Concentration, in both cases a short-name <thing>_COConcentration is proposed. This leads to a naming conflict.

The same problem might exist for other CO₂ channels as well.

Expected Behavior

Item <thing>_CO2Concentration for channel CO₂ Concentration
Item <thing>_COConcentration for channel CO Concentration

Current Behavior

Item <thing>_COConcentration for channel CO₂ Concentration
Item <thing>_COConcentration for channel CO Concentration
naming conflict

Your Environment

openHAB 3.4.0.M4

@MikeTheTux MikeTheTux added the bug An unexpected problem or unintended behavior of an add-on label Dec 11, 2022
@lolodomo
Copy link
Contributor

https://github.com/openhab/openhab-addons/blob/main/bundles/org.openhab.binding.airq/src/main/resources/OH-INF/thing/thing-types.xml#L191

This is certainly due to the special 2 character that will be ignored.
Replacing with CO2 in the channel label should fix the problem.

@MikeTheTux
Copy link
Contributor Author

In addition, is there a reason why performance and health shows up as a number between 0 and 1000 and not as a percentage (0 ... 100%)? Number:Dimensionless is used as DataType already.

@lolodomo
Copy link
Contributor

Pinging binding author/maintainer: @aurelio1

@MikeTheTux
Copy link
Contributor Author

It also seems that the binding throws a StringIndexOutOfBoundsException, in case of empty "usercalib":{}:

...
2022-12-12 14:56:04.660 [DEBUG] [ab.binding.airq.internal.AirqHandler] - air-Q - airqHandler - getConfigData(): decObj={"mqtt":null, ... "usercalib":{}, ...}
...
2022-12-12 14:56:04.687 [TRACE] [ab.binding.airq.internal.AirqHandler] - air-Q - airqHandler - processType(): airqName=usercalib, channelName=userCalib, type=calib
2022-12-12 14:56:04.688 [WARN ] [ab.binding.airq.internal.AirqHandler] - air-Q - airqHandler - getConfigData(): Error in processConfigData(): java.lang.StringIndexOutOfBoundsException: begin 0, end -1, length 0
...

Can we treat this within this issue or shall I create another one?

@lolodomo
Copy link
Contributor

One issue per problem please. So, you have 2 more issues to create.
The current one is only for your initial problem jCO2).

@lolodomo
Copy link
Contributor

Looking at the XML thing description, I realize that the author of this binding makes a mismatch between channel label and description. I find no channel description and channel label are most of the time a description, not a short label !
I can fix the CO2 channel but a full update of channels would be better.

lolodomo added a commit to lolodomo/openhab-addons that referenced this issue Dec 12, 2022
Subscript digits in channel label are ignored by UI when the item name is built.

Fix openhab#13909

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
lolodomo added a commit to lolodomo/openhab-addons that referenced this issue Dec 12, 2022
Subscript digits in channel label are ignored by UI when the item name is built.

Fix openhab#13909

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
@MikeTheTux
Copy link
Contributor Author

created #13926 and #13928

Hilbrand added a commit to Hilbrand/openhab-webui that referenced this issue Dec 13, 2022
Normalizing allows for channel names to contain subscript characters like in units; CO2.

Fixes openhab/openhab-addons#13909

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Hilbrand added a commit to Hilbrand/openhab-webui that referenced this issue Dec 13, 2022
Normalizing allows for channel names to contain subscript characters like in units; CO2.

Fixes openhab/openhab-addons#13909

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Hilbrand added a commit to Hilbrand/openhab-webui that referenced this issue Dec 15, 2022
The util function adds additional support:
* Use normalize to allow for channel names to contain subscript characters like in units; CO2.
* Convert spaces to underscore.
* Allow underscore in name.

Fixes openhab/openhab-addons#13909

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Hilbrand added a commit to Hilbrand/openhab-webui that referenced this issue Dec 16, 2022
The util function adds additional support:
* Use normalize to allow for channel names to contain subscript characters like in units; CO2.
* Convert spaces to underscore.
* Allow underscore in name.

Fixes openhab/openhab-addons#13909

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
ghys pushed a commit to openhab/openhab-webui that referenced this issue Dec 16, 2022
…rt (#1578)

The util function adds additional support:
* Use normalize to allow for channel names to contain subscript characters like in units; CO2.
* Convert spaces to underscore.
* Allow underscore in name.

Fixes openhab/openhab-addons#13909

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
@lolodomo
Copy link
Contributor

@Hilbrand : is this issue now fixed since the UI PR is merged?

@MikeTheTux : I would suggest that you test with 3.4RC1 coming this evening.

@Hilbrand
Copy link
Member

Yes this should be fixed with the UI PR merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
3 participants