- Platform information:
- OS: latest stable docker container
- openHAB version: 4.1
- Issue of the topic: Sometimes displayState is not shown correctly
Hello,
previously I used the math rounding function and added “°C” manually to the label text in widgets and cells.
With the Units of Measurement concept I defined now all the items with the according unit, e.g:
Number:Temperature Raumtemperatur_EG_WC "EG WC Temperatur [%.1f %unit%]" <temperature> (gRaumtemperatur, gAvgRaumtemperatur) ["Measurement", "Temperature"] { channel="knx:device:bridge:rtemp:Raumtemperatur_EG_WC", unit="°C"}
Number:Temperature Raumtemperatur_EG_Wohnen "EG Wohnen Temperatur [%.1f %unit%]" <temperature> (gRaumtemperatur, gAvgRaumtemperatur) ["Measurement", "Temperature"] { channel="knx:device:bridge:rtemp:Raumtemperatur_EG_Wohnen", unit="°C"}
[%.1f %unit%] should display the temperature value in °C with one digit after the comma.
In a simple widget I use:
label: =items[props.vItemTempIst].state
As expected the rounding is not applied as the state is used:
As you can see the OG Büro value has too many digits.
Thus I modified the label in the custom widget to:
label: =items[props.vItemTempIst].displayState
On some widget instantiations the value is not displayed:
The value of “OG Bad” is undefined.
In the console:
openhab> openhab:items list Raumtemperatur_OG_Bad
Raumtemperatur_OG_Bad (Type=NumberItem, State=22.1 °C, Label=OG Bad Temperatur, Category=temperature, Tags=[Measurement, Temperature], Groups=[gRaumtemperatur, gAvgRaumtemperatur, Bad])
openhab>
This behavior is sporadic.
Any Idea how I can debug this further?