Error displaying value in sitemap


I am having issue with one item in sitemap. It should display temperature value but it just shows blank and it shows the following error in the openhab.log error below:

[ERROR] [pse.smarthome.core.items.GenericItem] - Tried to set invalid state 77.198 (DecimalType) on item Kitchen_Temp of type StringItem, ignoring it

I have multiple of the same item type and those works just fine. Only having issue with one specific item.

Item info that is not working in sitemap:

Note: If I add “label” to the item and force the type, it works fine.

Working Item info with no issues:



The error has nothing to do with the sitemap. Something tried to set Kitchen_Temp to 77.198. The problem is Kitchen_Temp is a Number:Temperature which is a quantity type. Setting a quantity type requires passing the units of the measurement. I suspect 77.198 °F is required. Or you need to change the Item to be just a plain old Number without units of measurement.

I tried it without Temperature type. It gives a totally wrong value. But still it just displays blank in sitemap. I have 10 other items with exact same setup.

You haven’t asked it to display anything. See [state presentation] part of your label.

I am aware that from Paper UI if i have the labels and names set up correctly I can use Default in sitemap and it will bring in the the type automatically. So I tried to set the item as Text, it does not show anything. Only way I can get it to show in my sitemap is adding label=[%.1f F]. The strange part is that it is only for that specific item.

What do you want to happen?
If you specify no [state presentation], then you might not get a display depending on other factors.
If you do specify a [state presentation] then you get a display.

Well I want to make it work like rest of my items. Work without state presentation. I did get it to work by making a new item and linking it to the thing. It seems something with Kitchen_Temp is messing up, because even if i link kitchen_temp to other things it doesnt work.

Thanks for your help!

I don’t understand. If you want a display, then tell it so. This costs nothing, there is no penalty, the system does what you ask. You can configure this at the Item label if you don’t want to edit your sitemap.

I am aware of that. I wanted to know why it was causing that problem. If there are someplace in the openhab i can look up for that item.

As for the state presentation I only recently found that out that i can do that through paper ui. It made things so much more simple.

Okay, I do not fully follow the mechanism but when you link an Item to a channel/Thing/binding … the channel can “suggest” default state representations to an Item. (I don’t think many bindings implement this, zwave certainly does)

For example, we might have a zwave burglar sensor linking via a switch channel to Switch Item, this could suggest text “alarm!” for ON and “idle” for OFF states. These are only defaults, and you can always override with user configuration.
It’s just as valid to suggest an empty representation, the equivalent of [ ], which results in no display. Might happen if you make a config error for example. That’s fine, you can always insist in your user config.

I’ll bet my pants this does not get cleaned up if you remove a link and/or reassign an Item. Whether a later (re)link will properly or only partially replace an earlier setup, I could not say.

These are properties of the Item, so if really interested view your full Item with REST API and compare with the JSON of another Item that behaves differently.
stateDescription is the keyword.