Hi All
I have been using OH4 for some time so have my UoM pretty much sorted (I think). I have however just run into a weird issue with displayState that I do not recall seeing before.
The symptom is that occasionally the value for displayState becomes undefined.
As a test I have created a dummy item as follows:
label: ZZ Test display State
type: Number:Frequency
category: ""
groupNames: []
groupType: None
function: null
tags: []
with Metadata as follows:
Unit: Hz
State Description: %.1f Hz
Which from my understanding and past experience should display the item with a single decimal place, as follows:
This works correctly for some values, however occasionally goes to undefined as can be seen in the following widget:
uid: Test_displayState
tags: []
props:
parameterGroups: []
timestamp: Aug 23, 2023, 8:47:59 AM
component: f7-block
config:
style:
margin: 0
padding: 0
title: Test displayState
slots:
default:
- component: f7-block
config:
popupClose: .sunSynk-pop-test
style:
--f7-popup-tablet-height: 720px
--f7-popup-tablet-width: 360px
background-color: rgb(220,220,220)
border-radius: 30px
text-overflow: ellipsis
width: 360px
slots:
default:
- component: Label
config:
style:
font-size: 25px
font-weight: 500
padding-left: 50px
width: 100%
text: Test displayState
- component: f7-block
config:
style:
--f7-popup-tablet-height: 300px
--f7-popup-tablet-width: 326px
background-color: rgba(232,232,232)
border: 1px solid black
border-radius: 10px
margin: 0
padding: 0
position: absolute
top: 45px
width: 326px
slots:
default:
- component: Label
config:
style:
font-size: 18px
text: ="STATE - " + items.ZZ_Test_displayState.state
- component: Label
config:
style:
font-size: 18px
text: ="DISPLAY STATE - " + items.ZZ_Test_displayState.displayState
I used the API Explorer to assign values to the item, results as follows:
I can’t work out why some values are undefined, surely they should be displayed correctly with 1 decimal place?
Thanks
Mark
EDIT: More detailed table





