Cron didn't fire - Summer time issue?

Hi!

The state of my switch item SleepingHours did not get updated this morning, which should have happened at 9am. I included the rule below. It is suppoed to enable sleeping hours between 10pm and 8am at working days and 10pm and 9am at weekends. I use it e.g. to control roller shutters which do not go up automatically during sleeping hours.

Here is the last log entry concerning SleepingHours:

2018-03-24 22:00:00.047 [vent.ItemStateChangedEvent] - SleepingHours changed from OFF to ON

There is no newer entry, which would indicate that the rule didn’t trigger (as it is designed to post an update in any case).

For context: The state of the switch item WorkingDay (which is involved in the rule) changed to OFF at the start of the weekend as it should be. Last log entry:

2018-03-24 00:00:00.054 [vent.ItemStateChangedEvent] - WorkingDay changed from ON to OFF

Since summer time started today, I am a bit suspicious that this could be related. Has anyone experienced similar problems? I think there is nothing wrong with the rule, because it has been working as expected for quite a while.

I am running openHAB 2.2.0~20171125131803-1 (Build #1098) on a Raspberry Pi 3.

rule "Sleeping Hours"
when
	System started or
	Time cron "0 0 8,9,22 * * ? *" or
	Item WorkingDay changed
then
	// This is safe, because Yoda time always returns copies
	val startOfDay = now.withTimeAtStartOfDay
	SleepingHours.postUpdate([|
		if (WorkingDay.state == ON &&
			(now.isAfter(startOfDay.plusHours(22)) ||
   			 now.isBefore(startOfDay.plusHours(8)))) {
			return ON
		}
		if (WorkingDay.state == OFF &&
			(now.isAfter(startOfDay.plusHours(22)) || 
   			 now.isBefore(startOfDay.plusHours(9)))) {
			return ON
		}
		return OFF
	].apply())
end

Thanks a lot in advance. :slight_smile:
Jens

Hi Jens,

have a look here

1 Like

Time to update.

Thanks, Christoph! :+1:

To anyone who updates to #1230 or later and like me makes heavy use of lambdas in rules: Save yourself an hour of despair and insert a space before the first argument of every lambda. Otherwise the rules will be broken. Source:

Unfortunately one year later the exact same thing happened. The above rule did not fire this morning after the switch to summer time. It shoud have triggered at 9:00 but didn’t. These are the last events the item received up until now (10:15). WorkingDay has been OFF all weekend.

...
2019-03-29 21:30:00.005 [vent.ItemStateChangedEvent] - SleepingHours changed from OFF to ON
2019-03-30 09:00:00.012 [vent.ItemStateChangedEvent] - SleepingHours changed from ON to OFF
2019-03-30 21:30:00.005 [vent.ItemStateChangedEvent] - SleepingHours changed from OFF to ON

Is it just me?

EDIT: Now on openHAB 2.5.0.M1 / MacOS.

Thanks,
Jens