Thx for reply at first. You are right that to quote measurements as the safest way to compare and to avoid problems. I have to excuse, but my English is not the best. (learned 50 years ago)
I think the setup on Windows-Machine differs a bit from my openhabian-hassle free version.
I came to openHAB and Linux and that stuff a year ago or bit more using a RPi 3b. On this machine I’m now on 2.5.0.M4.
I never had problems with transformations of Units, either with or without Quotation Marks or with transforming it, as I learned a lot in this time from you and others (Rich, Udo, Scott, Jürgen, Bruce,etc.).
But yesterday I got my new RPi 4b and I made a complete new install of OH with the latest distro (which includes the workaround of the java problem) based on OH 2.4 stable.
At the end of the install-procedure I got the information that’s something wrong with the language settings. (I think it was a perl-script within the initial startup-procedure, which told me that something’s wrong with the environment variables LANG and LANGUAGE).
I tried to solve it with “openhabian-config” and setting it manually with the options of topic “30” | System Settings but it doesn’t work, and I saw that on my new system my test-rule produced the same error as @dsspindler described it.
When comparing my Environment-Setings from my “old RPI3b-Machine” and the new one , I found the environtment-variables LANG and LANGUAGE where different and so I changed it from
to
LANGUAGE=de_DE.UTF-8
LANG=de_DE.UTF-8
using the following commands on the shell:
export LANGUAGE=de_DE.UTF-8
export LANG=de_DE.UTF-8
I hope this can help others, to look on those variables when a similar problem comes up.
Cheers,
Peter
BTW: Thx for this snippet
// Temperature
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// version of rossko57 for better error-handling
// The idea is to toughen this expression against surprises
// by doing it longhand
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// get a sorted but unfiltered list
var myTempItemList = gTemp.members.sortBy[state]
// logInfo(rulename,"2: sorted but unfiltered - myTempItemList: " + myTempItemList)
var Number sumTemp = 0
var avgTemp = 0
var countTemp = 0
var minTemp = 100.0
var maxTemp = -100.0
myTempItemList.forEach[ g |
// do the filter now
val thisNamePart = g.name.split("_").get(1) // I'm not sure if this might error or not
// logInfo(rulename,"3: g.name:" + thisNamePart)
if (thisNamePart !== null) {
// should be safe to parse now
if (Integer.parseInt(thisNamePart) > daymin && Integer.parseInt(thisNamePart) <= daymax) {
// now process
var thisValue = (g.state as Number ).floatValue
// logInfo(rulename,"4: thisValue: {} thisNamePart {} ", thisValue, Integer.parseInt(thisNamePart))
sumTemp = sumTemp + thisValue
if (thisValue > maxTemp) { maxTemp = thisValue }
if (thisValue < minTemp) { minTemp = thisValue }
countTemp = countTemp + 1 // bump counter
// logInfo(rulename,"5: countTemp:" + countTemp)
} // else filter this one out
} else {
logInfo("test", "6: gTemp name unexpected - " + g.name)
}
] // end of foreach
// logInfo(rulename,"7: avgTemp: {} countTemp: {} sumTemp: {} " , avgTemp, countTemp, sumTemp)