Group:Number:AVG g "Temperature [%.1f °C]"
Number temp1 "t1 Temperature [%.1f °C]" (g) { mqtt="<[broker:/heating1/temp/temp:state:default]" }
Number temp2 "t2 Temperature [%.1f °C]" (g) { mqtt="<[broker:/heating2/temp/temp:state:default]" }
Number temp3 "t3 Temperature [%.1f °C]"
rule tmp
when
System started
then
temp1.postUpdate(19.8)
temp2.postUpdate(20.4)
var avgTemp = (temp1.state as DecimalType + temp2.state as DecimalType) / 2
temp3.postUpdate(avgTemp)
end
sitemap tmp label="TMP" {
Group item=g
Text item=temp1
Text item=temp2
Text item=temp3
}
2018-03-08 17:56:10.089 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value ‘19.10000000’ of item temp1switchstate with format ‘%d °C’: java.util.IllegalFormatConversionException: d != java.math.BigDecimal