- Platform information:
Raspberry pi3 and latest Openhabian 3.x
Can anybody tell me what I am doing wrong in this rule:
// Global Variables and values
var Number Thermostats = 0
var Number OldThermostat = 0
val Lowtemp = 19
val HighTemp = 23
val StartLowTempTime = ZonedDateTime.now().with(LocalTime.MIDNIGHT).plusHours(0).plusMinutes(0)
val StopLowTemptTime = ZonedDateTime.now().with(LocalTime.MIDNIGHT).plusHours(5).plusMinutes(30)
rule "Nattemp"
when
Time cron "0 0 * * * ?"
then
OldThermostat = Thermostats
if (now.isAfter(StartLowTempTime) && now.isBefore(StopLowTempTime)) {
Thermostats = LowTemp
logInfo("heating","Rule nattemp triggering Low temp")
}
else
{
if(HolidayMode.state == OFF)
{
logInfo("heating","Rule nattemp triggering High temp")
Thermostats = HighTemp
}
}
var triggertDevices = gThermostats.members
if (OldThermostat != Thermostats){
triggertDevices.forEach [ i |
sendCommand(i, Thermostats)
]
}
end
The log gives me:
2022-01-12 16:00:00.926 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'nattemp-1' failed: The name 'StopLowTempTime' cannot be resolved to an item or type; line 25, column 52, length 15 in nattemp