CRON Rule Did Not Fire This Evening

I have a rule that turns off my holidays lights every night at midnight. This rule has worked without exception until this evening.

I’d like to find out why it did not fire.

I did make some changes to OH today, so I’m curious to find out if this caused this rule not to fire. (the change was the installation of the Unify binding and the configuration of that binding and two things for that binding. I did not reboot the server or stop and start OH during the installation process.)

What’s strange is that my CRON rule for my outside holiday lights did fire on time as it has done for the past 45+ days.

Here’s the rule that DID NOT fire…

rule "Holiday Mode Off"
when
    Time cron "0 0 0 1/1 * ? *"
then
logInfo("sunriseholiday.rules", "The SunRISE CRON rule has triggered OFF")
if (VIR_IN_HolidaySwitch.state==ON)
{
    HolidayRemote1.sendCommand(OFF)
    HolidayRemote2.sendCommand(OFF)
    HolidayRemote3.sendCommand(OFF)
    HolidayRemote4.sendCommand(OFF)
    HolidayRemote5.sendCommand(OFF)
    HolidayRemote6.sendCommand(OFF)
      }
end

Here’s the rule that DID fire

rule "Holiday Mode Off"
when
    Time cron "0 1 0 * * ? *"
then
logInfo("sunsetholidays.rules", "The SunSet CRON rule has triggered OFF")
if (VIR_OUT_HolidaySwitch.state==ON)
{
    FntPatioPlug.sendCommand(OFF)
    WalkGatePlug.sendCommand(OFF)
    GarageHolidaySwitch.sendCommand(OFF)
    FntDrivewayPlug.sendCommand(OFF)
}
end

If you look into my logs for tonight, you’ll see

2018-01-03 00:00:30.005 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:home
2018-01-03 00:00:30.011 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:home
2018-01-03 00:01:00.162 [INFO ] [me.model.script.sunsetholidays.rules] - The SunSet CRON rule has triggered OFF

On previous nights you see this in the log…

2018-01-02 00:00:00.001 [INFO ] [me.model.script.sunriseholiday.rules] - The SunRISE CRON rule has triggered OFF
2018-01-02 00:00:30.006 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:home
2018-01-02 00:00:30.013 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:home
2018-01-02 00:01:00.002 [INFO ] [me.model.script.sunsetholidays.rules] - The SunSet CRON rule has triggered OFF

Any idea on what could have prevent this rule from running?

I checked with some crontab generators and testers and think
0 0 0 ? * * *
or
0 0 0 * * ?
sould be the correct value for every midnight.

The CRON statement for midnight has been working and is valid. I don;t think changing to one of the other midnight expressions would be the reason for a skip of running.

  1. cron “0 0 0 1/1 * ? *” => At 00:00:00am, every day starting on the 1st, every month

  2. cron “0 1 0 * * ? *” => At 00:01:00am every day

Two cron is different.

  • Cron 1 works only once time every month on 1st, at 00:00:00am
  • Cron 2 works every day, at 00:01:00am

That is what I have in place. I don’t think the cron time is the issue. For some reason the rule stopped running.

Is there somewhere in the logs I could look for additional information?

As a matter of fact I noticed this as well. I have a few simple Cron based rules that worked, but then after 1 or 2 days, or after I made some changes to any openhab stop working. If I then restart openhab, they work again for 1 or 2 days and then stop working.

It is about rules as simple as:

rule "Staircase light on"
when
Time cron "0 0 23 1/1 * ? *" //every day at 23 hours
then
    logInfo("Staircase light", "light on")
    TrapLight.sendCommand(ON)
end

if I don’t use a cron expressionbut e.g. a sunset channel it works fine.
I have no idea why

Both of your rules have the same name. You should rename one of your rules… I think even if they are in different rule files…

Andreas