Problem showing item value (resolved)

Hi,
I am getting into OpenHAB configuration and I do request a simple url and parse the value with regex. So far so good, it’s cached and value is available for the item as expected
String DaikinOuterTemp "[%.1f �C]" {http="<[daikinSensors:60000:REGEX(.*,otemp=([0-9.-]{1,4}),.*)]"}

But as I try to put it in the sitemap I don’t see any value there at all. Anyone can help? Below is my sitemap
{ Frame { Text item=DaikinOuterTemp label="Outdoor temp" icon="temperature" } }

Would really appreciate any idea

Hi Boyan!

By default, sitemaps use the label that you have defined in the item definition, but you can override it specifying the label attribute in the sitemap definition. This is what’s happening here, you have defined a label in the item definition ("[%.1f ºC]"), but you are overriding it when defining the sitemap (label=“Outdoor temp”).

You have two options to fix it:

  1. Include the “Outdoor temp” text in your item’s label:
  • String DaikinOuterTemp “Outdoor temp [%.1f ºC]” {http="<[daikinSensors:60000:REGEX(.,otemp=([0-9.-]{1,4}),.)]"}
    and remove the label property in the sitemap:
  • Text item=DaikinOuterTemp icon=“temperature”
  1. Include the format specification in the sitemap label:
  • Text item=DaikinOuterTemp label=“Outdoor temp [%.1f ºC]” icon=“temperature”

I would recommend the first approach, in fact I will also include the icon in the item definition:

  • String DaikinOuterTemp “Outdoor temp [%.1f ºC]” {http="<[daikinSensors:60000:REGEX(.,otemp=([0-9.-]{1,4}),.)]"}

I hope that things are more clear to you now, if you have any question don’t hesitate to ask :wink:

Best regards,

Aitor

dont mind my post, it seem i was not right :slightly_smiling:

For a string? Did you try with an item Number?

Number DaikinOuterTemp "[%.1f �C]" {http="<[daikinSensors:60000:REGEX(.*,otemp=([0-9.-]{1,4}),.*)]"}

i dont know if that will work. but i am sure that you can’t round a string :wink:

Of course I can’t . Removing the label in Sitemap helped. Thanks. For now I just print the string with %s.

Thanks a lot for the help