-
-
Notifications
You must be signed in to change notification settings - Fork 428
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
Unit °dH could not be parsed to a known unit for Item Number:AmountOfSubstance #4307
Comments
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/gruenbeck-water-softener-widget/157104/5 |
I think there is a bug here: openhab-core/bundles/org.openhab.core/src/main/java/org/openhab/core/library/unit/Units.java Lines 94 to 95 in 918b4fa
the type-cast looks suspicious and I think this is part of the explanation. You cannot convert mol to °dH, but you can convert mol/l to °dH. I think the problem is that mole is a unit for the amount of substance: openhab-core/bundles/org.openhab.core/src/main/java/org/openhab/core/library/unit/Units.java Line 91 in 918b4fa
but moles per liter is a unit of concentration, indicating the number of moles of substance per liter of solution. So the type-cast is forcing I don't think we currently have a dimension for concentration, but this could be added. @J-N-K might have some more insights/domain knowledge, I have really just been googling this topic without any prior knowledge, so might be complete nonsense. 😉 |
So it should be dimensionless (like ppm). |
When configuring an item of type Number:AmountOfSubstance and specifying to use unit °dH (by adding unit="°dH" in channel-linkage) openHab keeps using unit "mol" and issues a warning message to the log such as:
2024-07-08 11:28:33.129 [WARN ] [penhab.core.library.items.NumberItem] - **Unit '°dH' could not be parsed to a known unit. Keeping old unit 'mol' for item** 'gruenbeckRawWater'.
Also See:
https://community.openhab.org/t/problem-with-unit-dh-for-item-of-type-number-amountofsubstance-using-mol-instead-of-dh/157079
Expected Behavior
The system should use the specified unit °dH as per current documentation in chapter “SI (base unit symbols)”
of https://www.openhab.org/docs/concepts/units-of-measurement.html
Current Behavior
openHab issues a warning message and keeps using the default(?) unit mol
Possible Solution
no clue since I'm by far to novice of a developer to say ;-)
Steps to Reproduce (for Bugs)
setup an item such as:
Number:AmountOfSubstance gruenbeckRawWater "Wasserhärte Rohwasser [%.2f %unit%]" {channel="mqtt:topic:MQTTMosquittoBridge:gruenbeckSoftliqSd21:rawWater", unit="°dH"}
and link it to any channel providing a pure number value
Context
Encountered the issue while creating a widget for my water softener
for context details: see https://community.openhab.org/t/gruenbeck-water-softener-widget/157104
Your Environment
openHab 4.2.0 release build
Raspberry pi 5b 8GB
Debian GNU/Linux 12 (bookworm)
OpenJDK 64-Bit Server VM (build 17.0.11+9-Debian-1deb12u1, mixed mode
The text was updated successfully, but these errors were encountered: