StateDescription Problem

Using OH 4.2.3 on the RaspiPi 4

I have defined an item (Sonoff Zigbee Temp. Sensor) and placed a pattern %.1f%% in the state desscription. this works nice and gives me a clear value:

I wish to see the same in the Basic UI and in my sitemap I have:

Default    item= SONOFF_TEMP_SENSOR_01_Humidity label="Humidity Sonoff 1 [%.1f%%]"

The issue is. When I save the file the Basic UI will be empty. None of defined in the section values and icons are displayed.
I do not have any warning in the event.log
I tried to define other formats, %s%% for example.
I tried to change from Default item to text. I simply can not display the Humidity section in the Basic UI.

non-formated number is just a floating point number with two numbers after dec. value.
Any suggestions how to display it properly in the Basic UI?

I don’t know I just have

Text item=UpstairsThermostat21_SensorRelativeHumidity2 label="Upstairs Humidity"
Text item=MainThermostat14_SensorRelativeHumidity2 label="Main Floor Humidity"

for

more pictures;
humidity2 2024-12-06 182947
humidity3 2024-12-06 183022

It does not work for me.
This is the sitemap code:

            Text label="SONOFF" icon="temperature"{
                Default    item= SONOFF_TEMP_SENSOR_01_Temperature label="Temperature Sonoff 1"
                Default    item= SONOFF_TEMP_SENSOR_01_Humidity label="Humidity Sonoff 1"
                Default    item= SONOFF_TEMP_SENSOR_01_Battery_Level label="Battery Sonoff 1"
            }

I tried several options with text, default with different patterns.
If the second line is commented it looks like that:

As soon as the second line is un-commented i see this picture:

I believe the space after “item=” could be the source of your issue.

I do not think so. All of my items are specified this way in the sitemap and it works.
Anyway i listened you suggestion and placed the space what caused immediate error

2024-12-08 12:44:41.734 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'home.sitemap' has errors, therefore ignoring it: [29,28]: no viable alternative at input 'item'

Removing the space after the “item=” is not resolving the issue

as well as adding space is not resolving the issue:

You have apparently a syntax error at line 29.
What is this line?

I’m no expert, but that tends to indicate something in the second line throws the whole section off. Maybe there is some sort of hidden character. I would try to delete the line and recreate, copying the item directly from the UI item page. I’d also temporarily create a separate section “SONOFF2” just for the humidity item

Line 29 is exactly the line of the Humidity Item to be displayed. I do not see anything wrong here or I am already sitting too long on this subject and missing something obvious…

I did. Excluded Humidity item form SONOFF section and created a new one: SONOFF 2.
Humidity in the new section does not show up :roll_eyes:

            Text label="SONOFF" icon="temperature"{
                Default item= SONOFF_TEMP_SENSOR_01_Temperature label="Temperature Sonoff 1"
                //Default item= SONOFF_TEMP_SENSOR_01_Humidity label="Humidity Sonoff 1"
                Default item= SONOFF_TEMP_SENSOR_01_Battery_Level label="Battery Sonoff 1"
            }

            Text label="SONOFF 2" icon="humidity"{
                Default item=SONOFF_TEMP_SENSOR_01_Humidity label="Humidity Sonoff 1"
            }

Check/replace the characters between Default and item=

What are the item definitions of the working and non-working items? I notice your humidity item as of type Number. Are the working ones as well, or do they have a dimension?

I also see the working ones have a space between the number and the unit. You don’t in your original state description.

This Item, form another sensor works perfectly.


Its patter is defined as string with % character at the end

But even changing to the same “%s%%” patter it does not help

I admit this is flailing. Two more ideas; 1) delete the state meta data from the item 2A&B ) try Text, Number in place of default (if you haven’t already)

this works!!!
It seams if you define the pattern in the item configuration %.1f%% it is displayed properly in the item UI like below. But in this case you can not display item in the Basic UI at all and the whole section disappears

If you remove pattern in the UI of the item. the row number is displayed. But in this case you can format it in the sitemap properly.
I think there is something wrong with this.

First congrats. What does the item UI page look like without the metadata? Is it percent? fraction or integer?

It is just a float number:

Interesting?!. I think there is some mismatch between what the channel sends and the item is setup with the metadata and the sitemap “Default” was confused. Just a theory. Beyond my knowledge on how to fix.

Did you try putting a space before %? %s%% would be treated differently then when usinga number format. It may try to interpret as a unit.

try state description

%.1f %%

then it shows correct in sitemap too.

How the syntax error at line 29 in the sitemap file could be linked to state description of item ?!
You are probably cumulating different problems.