My sitemap item is:
Text item=WassermesserSensor_1_GasEnergyCounter label=“Wasserzähler Stand [JS(Wasseruhr_offset.js):%s]” icon=“wasserzaehler”
My JS file adds the watermeter offset to the actual water counter value and the unit m3. This worked out fine with snapshot #111 (the last i had running).
Here is the JS file:
(function(i) {
var scale = " m3"; //workaround for display of the unit m3
var total = parseFloat(i) + 623.162; //sum of the water meter offset and the HomeMatic counter
var new_total = total.toFixed(3); //limits the digits after the dot to 3
return new_total.replace(’.’, ‘,’) + scale; //replaces dot by comma and adds the unit m3
})(input)
The error log shows:
2020-05-28 23:51:09.058 [ERROR] [b.core.service.AbstractActiveService] - Error while executing background thread HTTP Refresh Service
java.lang.NullPointerException: null
at org.openhab.transform.javascript.internal.JavaScriptEngineManager.getScript(JavaScriptEngineManager.java:68) ~[?:?]
at org.openhab.transform.javascript.internal.JavaScriptTransformationService.transform(JavaScriptTransformationService.java:74) ~[?:?]
at org.openhab.core.transform.TransformationHelper$TransformationServiceDelegate.transform(TransformationHelper.java:69) ~[bundleFile:?]
at org.openhab.binding.http.internal.HttpBinding.execute(HttpBinding.java:218) ~[?:?]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:146) ~[bundleFile:?]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:169) [bundleFile:?]
For snapshot #111 and enabled sitemap line item as above the output is e.g.: 629,632 m3
For snapshot #131, i need to disable the sitemap line item in order to make at least the other members of the group working. With enabled item, the whole Group doesn’t open.
Hope that this Information helps?