You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually, that doesn't seem easy to solve. Afaik openHAB doesn't actually keep a unit parameter with an item, only a "dimension", like temperature. The unit is then chosen by the locale setting and can be overwritten in the state description, to e.g. automatically convert from °F to °C.
Right now, for charts the UI simply assumes the unit to be the second part of either the transformed state, state or if set the state description. While this mostly works, it breaks in multiple situations:
if the state description converts the dimension for some reason (e.g. °C to °F), the chart still displays °C (IMHO this is actually a new, different bug)
the correct unit is not detected for dimensionless items, and even displays wrong when the state description doesn't follow the " " pattern. Instead for currency values defined as $ %d it shows %d as value
it doesn't take the required double percent sign into account, required for the server side printf(?) (unfortunately, the dimension "percentage" doesn't exist explicitly, which I also would have liked to use multiple times)
For now I think the UI could simply detect the double %%, which would solve many cases. But I think for 1. and 2. there's no easy solution...
hubsif
added a commit
to hubsif/openhab-webui
that referenced
this issue
Mar 25, 2021
The problem
In the state description the value %d %% is entered as a pattern:
In the analyze chart %% is displayed on x axis as well as the selectable axis in the control area.
Expected behavior
Only % is displayed like for other values e.g. kWh or °C.
Steps to reproduce
%d %%
as pattern in the state descriptionYour environment
openHAB 3.0.1 Release Build
Docker on Synology DS918+
Browser console
Error occurs seems to occur in the backgound but not in the analyze overlay.
Browser network traffic
Additional information
None
The text was updated successfully, but these errors were encountered: