Only last created timer is executed

I wrote a rule which creates a timer for every roller shutter.
But only the last one is executed.
The log shows that the rule creates both timers for every roller shutter.
Any suggestions.


import java.lang.String
import java.util.Map

val Map<String, Timer> DaytimeTimers = newHashMap
val Map<String, Timer> NighttimeTimers = newHashMap

rule Rollershutter_Timercalculation
when
	System started or
	Time is midnight
then

	CounterRollershutterTestTimercalculation.postUpdate((CounterRollershutterTestTimercalculation.state as Number) + 1)
	LastRunRollershutterTestTimercalculation.postUpdate(new DateTimeType)

	val String today = CurrentDateTime.state.format("%1$tA")

	DaytimeTimers.clear
	NighttimeTimers.clear

	gRolladen.allMembers.forEach[ i | 

		logInfo("Test.rules", "Name of the Rollershutter: " + i.name)
		logInfo("Test.rules", "State of the Rollershutter: " + i.state.toString)

		var DateTime Daytime
		var DateTime Nighttime

		val String NormalName = i.name.substring(i.name.indexOf("_") + 1)

		logInfo("Test.rules", "NormalName of the Rollershutter: " + NormalName)

		val StringItem NighttimeMode = gRolladen_Nighttime_Mode.members.findFirst[ t | t.name == "Rolladen_" + NormalName + "_Nighttime_Mode"] as StringItem

		logInfo("Test.rules", "Name of the Rollershutter Mode: " + NighttimeMode.name)
		logInfo("Test.rules", "State of the Rollershutter Mode: " + NighttimeMode.state.toString)

		switch(NighttimeMode.state.toString) {
			case "ASTRO": {
				Daytime = new DateTime(SunriseTime.state.toString)
				Nighttime = new DateTime(SunsetTime.state.toString)
			}
			case "GLOBAL": {
				if(0 < now.getDayOfWeek && now.getDayOfWeek < 6){
					Daytime = now.withTimeAtStartOfDay.plusHours((Rolladen_Hoch_Stunde_Werktags.state as Number).intValue).plusMinutes((Rolladen_Hoch_Minute_Werktags.state as Number).intValue)
					Nighttime = now.withTimeAtStartOfDay.plusHours((Rolladen_Runter_Stunde_Werktags.state as Number).intValue).plusMinutes((Rolladen_Runter_Minute_Werktags.state as Number).intValue)
				} else if(5 < now.getDayOfWeek && now.getDayOfWeek < 8){
					Daytime = now.withTimeAtStartOfDay.plusHours((Rolladen_Hoch_Stunde_Wochenende.state as Number).intValue).plusMinutes((Rolladen_Hoch_Minute_Wochenende.state as Number).intValue)
					Nighttime = now.withTimeAtStartOfDay.plusHours((Rolladen_Runter_Stunde_Wochenende.state as Number).intValue).plusMinutes((Rolladen_Runter_Minute_Wochenende.state as Number).intValue)
				}
			}
			case "LOCAL": {
				val NumberItem DaytimeHour = gRolladen_Time_Daytime.allMembers.findFirst[ j | j.name.contains(i.name + "_Hoch_Stunde" + today) ] as NumberItem
				val NumberItem DaytimeMinute = gRolladen_Time_Daytime.allMembers.findFirst[ j | j.name.contains(i.name + "_Hoch_Minute" + today) ] as NumberItem
				Daytime = now.withTimeAtStartOfDay.plusHours((DaytimeHour.state as Number).intValue).plusMinutes((DaytimeMinute.state as Number).intValue)
				val NumberItem NighttimeHour = gRolladen_Time_Nighttime.allMembers.findFirst[ j | j.name.contains(i.name + "_Runter_Stunde" + today) ] as NumberItem
				val NumberItem NighttimeMinute = gRolladen_Time_Nighttime.allMembers.findFirst[ j | j.name.contains(i.name + "_Runter_Minute" + today) ] as NumberItem
				Nighttime = now.withTimeAtStartOfDay.plusHours((NighttimeHour.state as Number).intValue).plusMinutes((NighttimeMinute.state as Number).intValue)
			}
		}

		logInfo("Test.rules", "Daytime of the Rollershutter: " + Daytime.toString)
		logInfo("Test.rules", "Nighttime of the Rollershutter: " + Nighttime.toString)

		val StringItem State = gRolladen_State.allMembers.findFirst[ t | t.name == i.name + "_State" ] as StringItem

		logInfo("Test.rules", "Name of the Rollershutter State: " + State.name)
		logInfo("Test.rules", "State of the Rollershutter State: " + State.state.toString)

		logInfo("Test.rules", "Add timers for " + i.name)
		DaytimeTimers.put(i.name, createTimer(Daytime, [|
				logInfo("Test.rules", "Execute daytime timer for  " + i.name)
				State.sendCommand("Daytime")
				DaytimeTimers.remove(i.name)
			]))

		NighttimeTimers.put(i.name, createTimer(Nighttime, [|
				logInfo("Test.rules", "Execute nighttime timer for  " + i.name)
				State.sendCommand("Nighttime")
				NighttimeTimers.remove(i.name)
			]))
		
		logInfo("Test.rules", "DaytimeTimers Size: " + DaytimeTimers.size)
		logInfo("Test.rules", "NighttimeTimers Size: " + NighttimeTimers.size)
	]

	logInfo("Test.rules", "DaytimeTimers Size: " + DaytimeTimers.size)
	logInfo("Test.rules", "NighttimeTimers Size: " + NighttimeTimers.size)
	
end

Each your rule runs, it clears your ‘arrays’ of Timers. Looks like a good suspect but shouldn’t be happening.

Are you not seeing expected messages? May we see the logs for the timer adding part?

I’m a bit curious now about creating multiple timers for the same exact instant; most often we deal with offsets which never come out identical from a moving ‘now’.

Here is the log when the rule is running

2019-07-26 02:52:57.440 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter: RolladenSeite_OG_Kinderzimmer
2019-07-26 02:52:57.446 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter: 100
2019-07-26 02:52:57.552 [INFO ] [se.smarthome.model.script.Test.rules] - NormalName of the Rollershutter: OG_Kinderzimmer
2019-07-26 02:52:57.555 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter Mode: Rolladen_OG_Kinderzimmer_Nighttime_Mode
2019-07-26 02:52:57.588 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter Mode: GLOBAL
2019-07-26 02:52:57.592 [INFO ] [se.smarthome.model.script.Test.rules] - Daytime of the Rollershutter: 2019-07-26T06:00:00.000+02:00
2019-07-26 02:52:57.636 [INFO ] [se.smarthome.model.script.Test.rules] - Nighttime of the Rollershutter: 2019-07-26T22:00:00.000+02:00
2019-07-26 02:52:57.667 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter State: RolladenSeite_OG_Kinderzimmer_State
2019-07-26 02:52:57.720 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter State: Daytime
2019-07-26 02:52:57.725 [INFO ] [se.smarthome.model.script.Test.rules] - Add timers for RolladenSeite_OG_Kinderzimmer
2019-07-26 02:52:57.753 [INFO ] [se.smarthome.model.script.Test.rules] - DaytimeTimers Size: 1
2019-07-26 02:52:57.757 [INFO ] [se.smarthome.model.script.Test.rules] - NighttimeTimers Size: 1
2019-07-26 02:52:57.773 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter: Rolladen_OG_Arbeitszimmer
2019-07-26 02:52:57.812 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter: 58
2019-07-26 02:52:57.813 [INFO ] [se.smarthome.model.script.Test.rules] - NormalName of the Rollershutter: OG_Arbeitszimmer
2019-07-26 02:52:57.887 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter Mode: Rolladen_OG_Arbeitszimmer_Nighttime_Mode
2019-07-26 02:52:57.888 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter Mode: GLOBAL
2019-07-26 02:52:57.889 [INFO ] [se.smarthome.model.script.Test.rules] - Daytime of the Rollershutter: 2019-07-26T06:00:00.000+02:00
2019-07-26 02:52:57.962 [INFO ] [se.smarthome.model.script.Test.rules] - Nighttime of the Rollershutter: 2019-07-26T22:00:00.000+02:00
2019-07-26 02:52:57.964 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter State: Rolladen_OG_Arbeitszimmer_State
2019-07-26 02:52:57.966 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter State: Daytime
2019-07-26 02:52:57.968 [INFO ] [se.smarthome.model.script.Test.rules] - Add timers for Rolladen_OG_Arbeitszimmer
2019-07-26 02:52:57.982 [INFO ] [se.smarthome.model.script.Test.rules] - DaytimeTimers Size: 2
2019-07-26 02:52:58.048 [INFO ] [se.smarthome.model.script.Test.rules] - NighttimeTimers Size: 2
2019-07-26 02:52:58.049 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter: Rolladen_OG_Bad
2019-07-26 02:52:58.050 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter: 0
2019-07-26 02:52:58.051 [INFO ] [se.smarthome.model.script.Test.rules] - NormalName of the Rollershutter: OG_Bad
2019-07-26 02:52:58.121 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter Mode: Rolladen_OG_Bad_Nighttime_Mode
2019-07-26 02:52:58.136 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter Mode: GLOBAL
2019-07-26 02:52:58.141 [INFO ] [se.smarthome.model.script.Test.rules] - Daytime of the Rollershutter: 2019-07-26T06:00:00.000+02:00
2019-07-26 02:52:58.143 [INFO ] [se.smarthome.model.script.Test.rules] - Nighttime of the Rollershutter: 2019-07-26T22:00:00.000+02:00
2019-07-26 02:52:58.149 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter State: Rolladen_OG_Bad_State
2019-07-26 02:52:58.151 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter State: Daytime
2019-07-26 02:52:58.208 [INFO ] [se.smarthome.model.script.Test.rules] - Add timers for Rolladen_OG_Bad
2019-07-26 02:52:58.212 [INFO ] [se.smarthome.model.script.Test.rules] - DaytimeTimers Size: 3
2019-07-26 02:52:58.247 [INFO ] [se.smarthome.model.script.Test.rules] - NighttimeTimers Size: 3
2019-07-26 02:52:58.254 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter: Rolladen_EG_Schlafzimmer
2019-07-26 02:52:58.260 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter: 100
2019-07-26 02:52:58.285 [INFO ] [se.smarthome.model.script.Test.rules] - NormalName of the Rollershutter: EG_Schlafzimmer
2019-07-26 02:52:58.326 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter Mode: Rolladen_EG_Schlafzimmer_Nighttime_Mode
2019-07-26 02:52:58.341 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter Mode: GLOBAL
2019-07-26 02:52:58.354 [INFO ] [se.smarthome.model.script.Test.rules] - Daytime of the Rollershutter: 2019-07-26T06:00:00.000+02:00
2019-07-26 02:52:58.418 [INFO ] [se.smarthome.model.script.Test.rules] - Nighttime of the Rollershutter: 2019-07-26T22:00:00.000+02:00
2019-07-26 02:52:58.430 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter State: Rolladen_EG_Schlafzimmer_State
2019-07-26 02:52:58.431 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter State: Daytime
2019-07-26 02:52:58.444 [INFO ] [se.smarthome.model.script.Test.rules] - Add timers for Rolladen_EG_Schlafzimmer
2019-07-26 02:52:58.458 [INFO ] [se.smarthome.model.script.Test.rules] - DaytimeTimers Size: 4
2019-07-26 02:52:58.474 [INFO ] [se.smarthome.model.script.Test.rules] - NighttimeTimers Size: 4
2019-07-26 02:52:58.477 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter: Rolladen_EG_Gaestezimmer
2019-07-26 02:52:58.487 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter: 100
2019-07-26 02:52:58.493 [INFO ] [se.smarthome.model.script.Test.rules] - NormalName of the Rollershutter: EG_Gaestezimmer
2019-07-26 02:52:58.521 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter Mode: Rolladen_EG_Gaestezimmer_Nighttime_Mode
2019-07-26 02:52:58.530 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter Mode: GLOBAL
2019-07-26 02:52:58.542 [INFO ] [se.smarthome.model.script.Test.rules] - Daytime of the Rollershutter: 2019-07-26T06:00:00.000+02:00
2019-07-26 02:52:58.573 [INFO ] [se.smarthome.model.script.Test.rules] - Nighttime of the Rollershutter: 2019-07-26T22:00:00.000+02:00
2019-07-26 02:52:58.595 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter State: Rolladen_EG_Gaestezimmer_State
2019-07-26 02:52:58.596 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter State: Daytime
2019-07-26 02:52:58.605 [INFO ] [se.smarthome.model.script.Test.rules] - Add timers for Rolladen_EG_Gaestezimmer
2019-07-26 02:52:58.660 [INFO ] [se.smarthome.model.script.Test.rules] - DaytimeTimers Size: 5
2019-07-26 02:52:58.661 [INFO ] [se.smarthome.model.script.Test.rules] - NighttimeTimers Size: 5
2019-07-26 02:52:58.662 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter: Rolladen_OG_Schlafzimmer
2019-07-26 02:52:58.662 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter: 0
2019-07-26 02:52:58.663 [INFO ] [se.smarthome.model.script.Test.rules] - NormalName of the Rollershutter: OG_Schlafzimmer
2019-07-26 02:52:58.730 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter Mode: Rolladen_OG_Schlafzimmer_Nighttime_Mode
2019-07-26 02:52:58.734 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter Mode: GLOBAL
2019-07-26 02:52:58.784 [INFO ] [se.smarthome.model.script.Test.rules] - Daytime of the Rollershutter: 2019-07-26T06:00:00.000+02:00
2019-07-26 02:52:58.797 [INFO ] [se.smarthome.model.script.Test.rules] - Nighttime of the Rollershutter: 2019-07-26T22:00:00.000+02:00
2019-07-26 02:52:58.811 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter State: Rolladen_OG_Schlafzimmer_State
2019-07-26 02:52:58.820 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter State: Daytime
2019-07-26 02:52:58.872 [INFO ] [se.smarthome.model.script.Test.rules] - Add timers for Rolladen_OG_Schlafzimmer
2019-07-26 02:52:58.886 [INFO ] [se.smarthome.model.script.Test.rules] - DaytimeTimers Size: 6
2019-07-26 02:52:58.933 [INFO ] [se.smarthome.model.script.Test.rules] - NighttimeTimers Size: 6
2019-07-26 02:52:58.934 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter: Rolladen_EG_Kueche
2019-07-26 02:52:58.935 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter: 0
2019-07-26 02:52:58.947 [INFO ] [se.smarthome.model.script.Test.rules] - NormalName of the Rollershutter: EG_Kueche
2019-07-26 02:52:58.958 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter Mode: Rolladen_EG_Kueche_Nighttime_Mode
2019-07-26 02:52:59.035 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter Mode: GLOBAL
2019-07-26 02:52:59.037 [INFO ] [se.smarthome.model.script.Test.rules] - Daytime of the Rollershutter: 2019-07-26T06:00:00.000+02:00
2019-07-26 02:52:59.052 [INFO ] [se.smarthome.model.script.Test.rules] - Nighttime of the Rollershutter: 2019-07-26T22:00:00.000+02:00
2019-07-26 02:52:59.081 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter State: Rolladen_EG_Kueche_State
2019-07-26 02:52:59.086 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter State: Daytime
2019-07-26 02:52:59.089 [INFO ] [se.smarthome.model.script.Test.rules] - Add timers for Rolladen_EG_Kueche
2019-07-26 02:52:59.146 [INFO ] [se.smarthome.model.script.Test.rules] - DaytimeTimers Size: 7
2019-07-26 02:52:59.152 [INFO ] [se.smarthome.model.script.Test.rules] - NighttimeTimers Size: 7
2019-07-26 02:52:59.153 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter: RolladenBalkon_OG_Wohnzimmer
2019-07-26 02:52:59.154 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter: 0
2019-07-26 02:52:59.159 [INFO ] [se.smarthome.model.script.Test.rules] - NormalName of the Rollershutter: OG_Wohnzimmer
2019-07-26 02:52:59.188 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter Mode: Rolladen_OG_Wohnzimmer_Nighttime_Mode
2019-07-26 02:52:59.189 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter Mode: GLOBAL
2019-07-26 02:52:59.259 [INFO ] [se.smarthome.model.script.Test.rules] - Daytime of the Rollershutter: 2019-07-26T06:00:00.000+02:00
2019-07-26 02:52:59.268 [INFO ] [se.smarthome.model.script.Test.rules] - Nighttime of the Rollershutter: 2019-07-26T22:00:00.000+02:00
2019-07-26 02:52:59.353 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter State: RolladenBalkon_OG_Wohnzimmer_State
2019-07-26 02:52:59.354 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter State: Daytime
2019-07-26 02:52:59.355 [INFO ] [se.smarthome.model.script.Test.rules] - Add timers for RolladenBalkon_OG_Wohnzimmer
2019-07-26 02:52:59.421 [INFO ] [se.smarthome.model.script.Test.rules] - DaytimeTimers Size: 8
2019-07-26 02:52:59.422 [INFO ] [se.smarthome.model.script.Test.rules] - NighttimeTimers Size: 8
2019-07-26 02:52:59.450 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter: RolladenFenster_EG_Wohnzimmer
2019-07-26 02:52:59.453 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter: 100
2019-07-26 02:52:59.455 [INFO ] [se.smarthome.model.script.Test.rules] - NormalName of the Rollershutter: EG_Wohnzimmer
2019-07-26 02:52:59.508 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter Mode: Rolladen_EG_Wohnzimmer_Nighttime_Mode
2019-07-26 02:52:59.509 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter Mode: GLOBAL
2019-07-26 02:52:59.518 [INFO ] [se.smarthome.model.script.Test.rules] - Daytime of the Rollershutter: 2019-07-26T06:00:00.000+02:00
2019-07-26 02:52:59.530 [INFO ] [se.smarthome.model.script.Test.rules] - Nighttime of the Rollershutter: 2019-07-26T22:00:00.000+02:00
2019-07-26 02:52:59.550 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter State: RolladenFenster_EG_Wohnzimmer_State
2019-07-26 02:52:59.555 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter State: Daytime
2019-07-26 02:52:59.562 [INFO ] [se.smarthome.model.script.Test.rules] - Add timers for RolladenFenster_EG_Wohnzimmer
2019-07-26 02:52:59.603 [INFO ] [se.smarthome.model.script.Test.rules] - DaytimeTimers Size: 9
2019-07-26 02:52:59.636 [INFO ] [se.smarthome.model.script.Test.rules] - NighttimeTimers Size: 9
2019-07-26 02:52:59.641 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter: RolladenFenster_OG_Wohnzimmer
2019-07-26 02:52:59.694 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter: 0
2019-07-26 02:52:59.703 [INFO ] [se.smarthome.model.script.Test.rules] - NormalName of the Rollershutter: OG_Wohnzimmer
2019-07-26 02:52:59.710 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter Mode: Rolladen_OG_Wohnzimmer_Nighttime_Mode
2019-07-26 02:52:59.712 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter Mode: GLOBAL
2019-07-26 02:52:59.730 [INFO ] [se.smarthome.model.script.Test.rules] - Daytime of the Rollershutter: 2019-07-26T06:00:00.000+02:00
2019-07-26 02:52:59.795 [INFO ] [se.smarthome.model.script.Test.rules] - Nighttime of the Rollershutter: 2019-07-26T22:00:00.000+02:00
2019-07-26 02:52:59.796 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter State: RolladenFenster_OG_Wohnzimmer_State
2019-07-26 02:52:59.797 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter State: Daytime
2019-07-26 02:52:59.797 [INFO ] [se.smarthome.model.script.Test.rules] - Add timers for RolladenFenster_OG_Wohnzimmer
2019-07-26 02:52:59.851 [INFO ] [se.smarthome.model.script.Test.rules] - DaytimeTimers Size: 10
2019-07-26 02:52:59.852 [INFO ] [se.smarthome.model.script.Test.rules] - NighttimeTimers Size: 10
2019-07-26 02:52:59.874 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter: Rolladen_EG_Anbau
2019-07-26 02:52:59.876 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter: 100
2019-07-26 02:52:59.886 [INFO ] [se.smarthome.model.script.Test.rules] - NormalName of the Rollershutter: EG_Anbau
2019-07-26 02:52:59.943 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter Mode: Rolladen_EG_Anbau_Nighttime_Mode
2019-07-26 02:52:59.945 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter Mode: GLOBAL
2019-07-26 02:52:59.958 [INFO ] [se.smarthome.model.script.Test.rules] - Daytime of the Rollershutter: 2019-07-26T06:00:00.000+02:00
2019-07-26 02:53:00.030 [INFO ] [se.smarthome.model.script.Test.rules] - Nighttime of the Rollershutter: 2019-07-26T22:00:00.000+02:00
2019-07-26 02:53:00.042 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter State: Rolladen_EG_Anbau_State
2019-07-26 02:53:00.044 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter State: Nighttime
2019-07-26 02:53:00.050 [INFO ] [se.smarthome.model.script.Test.rules] - Add timers for Rolladen_EG_Anbau
2019-07-26 02:53:00.059 [INFO ] [se.smarthome.model.script.Test.rules] - DaytimeTimers Size: 11
2019-07-26 02:53:00.065 [INFO ] [se.smarthome.model.script.Test.rules] - NighttimeTimers Size: 11
2019-07-26 02:53:00.067 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter: Rolladen_Treppe
2019-07-26 02:53:00.073 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter: 100
2019-07-26 02:53:00.074 [INFO ] [se.smarthome.model.script.Test.rules] - NormalName of the Rollershutter: Treppe
2019-07-26 02:53:00.079 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter Mode: Rolladen_Treppe_Nighttime_Mode
2019-07-26 02:53:00.086 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter Mode: GLOBAL
2019-07-26 02:53:00.091 [INFO ] [se.smarthome.model.script.Test.rules] - Daytime of the Rollershutter: 2019-07-26T06:00:00.000+02:00
2019-07-26 02:53:00.171 [INFO ] [se.smarthome.model.script.Test.rules] - Nighttime of the Rollershutter: 2019-07-26T22:00:00.000+02:00
2019-07-26 02:53:00.186 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter State: Rolladen_Treppe_State
2019-07-26 02:53:00.320 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter State: NULL
2019-07-26 02:53:00.324 [INFO ] [se.smarthome.model.script.Test.rules] - Add timers for Rolladen_Treppe
2019-07-26 02:53:00.365 [INFO ] [se.smarthome.model.script.Test.rules] - DaytimeTimers Size: 12
2019-07-26 02:53:00.403 [INFO ] [se.smarthome.model.script.Test.rules] - NighttimeTimers Size: 12
2019-07-26 02:53:00.409 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter: Rolladen_EG_Esszimmer
2019-07-26 02:53:00.416 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter: 0
2019-07-26 02:53:00.421 [INFO ] [se.smarthome.model.script.Test.rules] - NormalName of the Rollershutter: EG_Esszimmer
2019-07-26 02:53:00.465 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter Mode: Rolladen_EG_Esszimmer_Nighttime_Mode
2019-07-26 02:53:00.466 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter Mode: GLOBAL
2019-07-26 02:53:00.480 [INFO ] [se.smarthome.model.script.Test.rules] - Daytime of the Rollershutter: 2019-07-26T06:00:00.000+02:00
2019-07-26 02:53:00.502 [INFO ] [se.smarthome.model.script.Test.rules] - Nighttime of the Rollershutter: 2019-07-26T22:00:00.000+02:00
2019-07-26 02:53:00.567 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter State: Rolladen_EG_Esszimmer_State
2019-07-26 02:53:00.573 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter State: Daytime
2019-07-26 02:53:00.577 [INFO ] [se.smarthome.model.script.Test.rules] - Add timers for Rolladen_EG_Esszimmer
2019-07-26 02:53:00.592 [INFO ] [se.smarthome.model.script.Test.rules] - DaytimeTimers Size: 13
2019-07-26 02:53:00.600 [INFO ] [se.smarthome.model.script.Test.rules] - NighttimeTimers Size: 13
2019-07-26 02:53:00.605 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter: RolladenTerrasse_EG_Wohnzimmer
2019-07-26 02:53:00.610 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter: 100
2019-07-26 02:53:00.617 [INFO ] [se.smarthome.model.script.Test.rules] - NormalName of the Rollershutter: EG_Wohnzimmer
2019-07-26 02:53:00.628 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter Mode: Rolladen_EG_Wohnzimmer_Nighttime_Mode
2019-07-26 02:53:00.628 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter Mode: GLOBAL
2019-07-26 02:53:00.630 [INFO ] [se.smarthome.model.script.Test.rules] - Daytime of the Rollershutter: 2019-07-26T06:00:00.000+02:00
2019-07-26 02:53:00.630 [INFO ] [se.smarthome.model.script.Test.rules] - Nighttime of the Rollershutter: 2019-07-26T22:00:00.000+02:00
2019-07-26 02:53:00.649 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter State: RolladenTerrasse_EG_Wohnzimmer_State
2019-07-26 02:53:00.650 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter State: NULL
2019-07-26 02:53:00.651 [INFO ] [se.smarthome.model.script.Test.rules] - Add timers for RolladenTerrasse_EG_Wohnzimmer
2019-07-26 02:53:00.731 [INFO ] [se.smarthome.model.script.Test.rules] - DaytimeTimers Size: 14
2019-07-26 02:53:00.731 [INFO ] [se.smarthome.model.script.Test.rules] - NighttimeTimers Size: 14
2019-07-26 02:53:00.732 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter: RolladenVorne_OG_Kinderzimmer
2019-07-26 02:53:00.732 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter: 100.0
2019-07-26 02:53:00.733 [INFO ] [se.smarthome.model.script.Test.rules] - NormalName of the Rollershutter: OG_Kinderzimmer
2019-07-26 02:53:00.735 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter Mode: Rolladen_OG_Kinderzimmer_Nighttime_Mode
2019-07-26 02:53:00.736 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter Mode: GLOBAL
2019-07-26 02:53:00.740 [INFO ] [se.smarthome.model.script.Test.rules] - Daytime of the Rollershutter: 2019-07-26T06:00:00.000+02:00
2019-07-26 02:53:00.741 [INFO ] [se.smarthome.model.script.Test.rules] - Nighttime of the Rollershutter: 2019-07-26T22:00:00.000+02:00
2019-07-26 02:53:00.751 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter State: RolladenVorne_OG_Kinderzimmer_State
2019-07-26 02:53:00.808 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter State: NULL
2019-07-26 02:53:00.809 [INFO ] [se.smarthome.model.script.Test.rules] - Add timers for RolladenVorne_OG_Kinderzimmer
2019-07-26 02:53:00.844 [INFO ] [se.smarthome.model.script.Test.rules] - DaytimeTimers Size: 15
2019-07-26 02:53:00.845 [INFO ] [se.smarthome.model.script.Test.rules] - NighttimeTimers Size: 15
2019-07-26 02:53:00.845 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter: Rolladen_EG_Bad
2019-07-26 02:53:00.846 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter: 100
2019-07-26 02:53:00.885 [INFO ] [se.smarthome.model.script.Test.rules] - NormalName of the Rollershutter: EG_Bad
2019-07-26 02:53:00.950 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter Mode: Rolladen_EG_Bad_Nighttime_Mode
2019-07-26 02:53:00.951 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter Mode: GLOBAL
2019-07-26 02:53:00.980 [INFO ] [se.smarthome.model.script.Test.rules] - Daytime of the Rollershutter: 2019-07-26T06:00:00.000+02:00
2019-07-26 02:53:00.980 [INFO ] [se.smarthome.model.script.Test.rules] - Nighttime of the Rollershutter: 2019-07-26T22:00:00.000+02:00
2019-07-26 02:53:00.982 [INFO ] [se.smarthome.model.script.Test.rules] - Name of the Rollershutter State: Rolladen_EG_Bad_State
2019-07-26 02:53:00.983 [INFO ] [se.smarthome.model.script.Test.rules] - State of the Rollershutter State: NULL
2019-07-26 02:53:00.983 [INFO ] [se.smarthome.model.script.Test.rules] - Add timers for Rolladen_EG_Bad
2019-07-26 02:53:01.045 [INFO ] [se.smarthome.model.script.Test.rules] - DaytimeTimers Size: 16
2019-07-26 02:53:01.067 [INFO ] [se.smarthome.model.script.Test.rules] - NighttimeTimers Size: 16
2019-07-26 02:53:01.080 [INFO ] [se.smarthome.model.script.Test.rules] - DaytimeTimers Size: 16
2019-07-26 02:53:01.088 [INFO ] [se.smarthome.model.script.Test.rules] - NighttimeTimers Size: 16

And this is the only log from a timer.

2019-07-26 06:00:00.240 [INFO ] [se.smarthome.model.script.Test.rules] - Execute daytime timer for  Rolladen_EG_Bad

I just made a little test rule (OH2.4)

	val myInstant = now.withTimeAtStartOfDay.plusMinutes(710)
	logInfo("Test.rules", "target " + myInstant)
	createTimer(myInstant, [|
		logInfo("Test.rules", "Execute timer A")
	])
	createTimer(myInstant, [|
		logInfo("Test.rules", "Execute timer B")
	])

and then ran the rule twice. We would expect four Timers to exist and produce logs A B A B or A A B B etc.

Actual result -

2019-07-26 11:50:00.011 [INFO ] [se.smarthome.model.script.Test.rules] - Execute timer B

Conclusion: whatever it is that Quartz does to schedule or reference Timers, you’ll get only one trigger for any particular instant.

To actually get your rule working, you could have a little counter N incrementing each time you make a Timer and use plusSeconds(N) to offset each target time a little.
That might work out nicer anyway, staggering whatever it is the rule is supposed to do.

Enhanced the test to examine Timer handles

	val myInstant = now.withTimeAtStartOfDay.plusMinutes(736)
	logInfo("Test.rules", "target " + myInstant)
	var aa = createTimer(myInstant, [|
		logInfo("Test.rules", "Execute timer A")
	])
	logInfo("Test.rules", "handle timer A " + aa)
	var bb = createTimer(myInstant, [|
		logInfo("Test.rules", "Execute timer B")
	])
	logInfo("Test.rules", "handle timer B " + bb)

and again ran rule twice for four timers

2019-07-26 12:15:11.923 [INFO ] [se.smarthome.model.script.Test.rules] - target 2019-07-26T12:16:00.000+01:00
2019-07-26 12:15:11.926 [INFO ] [se.smarthome.model.script.Test.rules] - handle timer A org.eclipse.smarthome.model.script.internal.actions.TimerImpl@14e0fda
2019-07-26 12:15:11.929 [INFO ] [se.smarthome.model.script.Test.rules] - handle timer B org.eclipse.smarthome.model.script.internal.actions.TimerImpl@cb09f9
2019-07-26 12:15:14.862 [INFO ] [se.smarthome.model.script.Test.rules] - target 2019-07-26T12:16:00.000+01:00
2019-07-26 12:15:14.865 [INFO ] [se.smarthome.model.script.Test.rules] - handle timer A org.eclipse.smarthome.model.script.internal.actions.TimerImpl@182d1db
2019-07-26 12:15:14.874 [INFO ] [se.smarthome.model.script.Test.rules] - handle timer B org.eclipse.smarthome.model.script.internal.actions.TimerImpl@145399b
2019-07-26 12:16:00.014 [INFO ] [se.smarthome.model.script.Test.rules] - Execute timer B

So, not duplicate Timer handles.
I’ve never run into this before … but am now wondering how many curious happenings people may have encountered.

EDIT - created an issue. Seems this used to make an error report in OH1 which would at least be an improvement.

I think I found the code segment for the timer.
I activate the debug logger for this class.
The makeTimer method is deleting the timer.

2019-07-27 00:00:00.708 [INFO ] [se.smarthome.model.script.Test.rules] - Add timers for RolladenTerrasse_EG_Wohnzimmer

2019-07-27 00:00:00.709 [DEBUG] [model.script.actions.ScriptExecution] - Deleted existing Job DEFAULT.2019-07-27T10:00:00.000+02:00: Proxy for org.eclipse.xtext.xbase.lib.Procedures$Procedure0: [ | {

  logInfo(<XStringLiteralImpl>,<XBinaryOperationImplCustom>)

  <XFeatureCallImplCustom>.sendCommand(<XStringLiteralImpl>)

  <XFeatureCallImplCustom>.remove(<XMemberFeatureCallImplCustom>)

} ]

The jobKey is not unique enough.

        JobKey jobKey = new JobKey(instant.toString() + ": " + closure.toString());
        Trigger trigger = newTrigger().startAt(instant.toDate()).build();
        Timer timer = new TimerImpl(jobKey, trigger.getKey(), dataMap, instant);
        try {
            JobDetail job = newJob(TimerExecutionJob.class).withIdentity(jobKey).usingJobData(dataMap).build();
            if (TimerImpl.scheduler.checkExists(job.getKey())) {
                TimerImpl.scheduler.deleteJob(job.getKey());
                logger.debug("Deleted existing Job {}", job.getKey().toString());
            }

File: