Still using OH4.1. I have a number of rules that trigger using cron and the astro plugin (for example, wake, bedtime, nighttime rule and dawn, daylight, dusk rules). On boot, the system doesn’t trigger, for example, the daylight rule isn’t triggered on boot because that event hasn’t been triggered by the astro plugin. Same with the cron rules. I’m creating a rule for startup using “when System reached start level 100 “. It looks like the only way to set the system to the current astro/cron timing events at startup is to add all of the variables in the startup script which seems kind of redundant. Here are some examples:
rule "Weekday Bedtime"
when
Time cron "0 0 21 ? * MON,TUE,WED,THU,FRI *"
then
Bedtime_Switch.sendCommand(ON)
LROutlet_Switch.sendCommand(OFF)
end
rule "Weekday Wakeup"
when
Time cron "0 30 5 ? * MON,TUE,WED,THU,FRI *"
then
Bedtime_Switch.sendCommand(OFF)
LROutlet_Switch.sendCommand(ON)
end
rule "Sunset Actions"
when
Channel 'astro:sun:local:civilDusk#event' triggered START
then
logWarn("rules", "Sunset Actions")
Daylight_Switch.sendCommand(OFF)
FrontDoorLight_Switch.sendCommand(ON)
end
Any suggestions on how to approach this, that is, on startup the system is set based rules that trigger on astro and cron events?