We don’t have a debugger => OK,
We need to debug using the log mechanisms => OK,
but why can’t the log not tell us WHERE the hell the error occured???
All I get is:
Error during the execution of rule ‘HeatUpWhenEnoughPower’: An error occurred during the script execution: Could not invoke method: org.eclipse.smarthome.model.script.lib.NumberExtensions.operator_greaterThan(org.eclipse.smarthome.core.types.Type,java.lang.Number) on instance: null
Any chance to get a line number or any other option to point to the line where it fails?
The error points to a comparison involving >
And from experience, it’s most likely about typing of your variables.
You might have something like if ( fred > mary )
where fred is an integer and mary is a number/decimal
Well, as long as I cannot define functions/procedures/methods to call from a rule, all discussion about lengthy rules are useless.
the rules file consists of 13 event driven rules, but to decide if you should switch on the tub or not, based on several parameters, just needs a lot of comparisons.
Here the individual items to be taken into account:
PV_Meter.state (to know how much energy is currently on the way to or from the grid into the home)
KebaPlugLocked (to know if the electrical car is plugged in or not)
BALBOA_SET_TEMP (current set temp from tub)
BALBOA_MANUAL (Switch to heat up once only, but leave operation mode AUTO)