rule "Energy Timeslot"
when
Time cron "0 0 0/1 1/1 * ? *" or
System started
then
if ((now.getDayOfWeek == 1) && (LocalTime_Holiday == OFF)) {
val int thisHour = now.getHourOfDay
switch thisHour {
case thisHour < 7: Auto_Energy_Timeslot.postUpdate(3)
case thisHour = 7: Auto_Energy_Timeslot.postUpdate(2)
case (thisHour > 7 && thisHour < 19): Auto_Energy_Timeslot.postUpdate(1)
case (thisHour >= 19 && this Hour < 23): Auto_Energy_Timeslot.postUpdate(2)
case thisHour >= 23: Auto_Energy_Timeslot.postUpdate(3)
}
}
end
2018-12-31 11:11:27.052 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'power-consumption.rules', using it anyway:
Assignment to final variable