Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

kWh are not recognized as Energy values #5341

Closed
kaikreuzer opened this issue Apr 3, 2018 · 8 comments · Fixed by #5336
Closed

kWh are not recognized as Energy values #5341

kaikreuzer opened this issue Apr 3, 2018 · 8 comments · Fixed by #5336
Labels

Comments

@kaikreuzer
Copy link
Contributor

The recently introduced unit support has an "Energy" dimension defined, which uses by default the SI unit "J" (Joule).
In practice, the alternative "Wh" are used much more frequently and thus I would expect this unit to be usable for items with Energy dimension.

I defined an Item like this:

Number:Energy Energie			"Energie [%.1f kWh]"

Sending a value on the console

smarthome send Energie 123.456

results in

2018-04-03 13:27:05.491 [DEBUG] [.e.s.core.types.util.UnitUtils:108  ] - Unknown unit from pattern: kWh

and no unit being assigned to the item state.

As energy is likely the most common use case besides weather for units, I'd consider this a rather critical issue that needs to be addressed quickly. See also https://github.com/openhab/openhab2-addons/pull/2167#discussion_r178578851.

@J-N-K
Copy link
Contributor

J-N-K commented Apr 3, 2018

I have created a patch for that. Please note, that kW·h is the correct notation, not kWh.

@ggzengel
Copy link

ggzengel commented Apr 3, 2018

@ggzengel
Copy link

ggzengel commented Apr 3, 2018

I was a little bit more searching and found here https://en.wikipedia.org/wiki/Kilowatt_hour:

The symbol "kWh" is commonly used in commercial, educational, scientific and media publications,[5][6] and is the usual practice in electrical power engineering.[7]

The main usage in OH2 is for reference of electrical power, so I would like to see (k)Wh.

@ggzengel
Copy link

ggzengel commented Apr 3, 2018

@kaikreuzer
Copy link
Contributor Author

Please note, that kW·h is the correct notation, not kWh

kWh, just like Wh and Ws must be supported. As @ggzengel rightly pointed out, these are also the officially used unit identifiers.

@J-N-K
Copy link
Contributor

J-N-K commented Apr 3, 2018

I‘ll see what can be done about that.

@J-N-K
Copy link
Contributor

J-N-K commented Apr 3, 2018

Thanks. I already found a solution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants