The weather where I live has been flaky lately - it was in the 80s on Saturday and today the high is 66. So I’m trying to set up a basic set of rules for the thermostat that I can tweak by adjusting a selector in my openHAB app. Here is the error I get:
2020-05-18 17:00:00.094 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule ‘daytime test’: An error occurred during the script execution: Could not invoke method: org.eclipse.xtext.xbase.lib.IntegerExtensions.operator_minus(int,byte) on instance: null
And here is my selector item:
Number thermostat_adjustment
And the sitemap:
Frame label=“Climate” icon=“temperature” {
Selection item=thermostat_adjustment label=“Adjust Thermostat” mappings=[-3=“Very Cold”, 2=“Cold”, -1=“Cool”, 0=“Normal”, 1=“Warm”, 2=“Hot”, 3=“Very Hot”]}
And finally, a rule:
rule “wakeup temp”
when
Time cron “0 0 5 ? * * *”
then
var delta = thermostat_adjustment.state
thermostatCoolPoint.postUpdate(74 - delta)
thermostatHeatPoint.postUpdate(70 - delta)
end
If I set the variable delta to a fixed number, e.g. -1 the script runs fine. It just isn’t playing well with the item. Any idea what I need to do to get the item to interact properly?
Thanks.
Mike