So I’ve done some RTFMing and gave up, need some help.
Why does the code below:
var QuantityType = (this.QuantityType === undefined) ? Java.type("org.openhab.core.types.QuantityType") : this.QuantityType; var logger = Java.type('org.slf4j.LoggerFactory').getLogger('org.openhab.rule.' + ctx.ruleUID); logger.info('thermostat1_sensortemperature'); logger.info(itemRegistry.getItem('thermostat1_sensortemperature').getState()); var awayTemp = 16.5|°C; logger.info('Quantity Type Test:'); logger.info(awayTemp.toString());
Result in this log below. Isn’t awayTemp supposed to become a QuantityType like expressed in this page https://www.openhab.org/docs/configuration/rules-dsl.html#scripts ?
2021-02-01 19:53:25.966 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'f54a140f0f' failed: <eval>:9:20 Expected an operand but found error var awayTemp = 16.5|°C; ^ in <eval> at line number 9 at column number 20