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" } }
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:
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”
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: