Sunset-to-sunrise predicate delayed in RM5.0

I've got a rule set up to notify my phone when triggered by Sunrise, and another for Sunset, and I only sometimes get the message, most often I don't get any message. (my mistake, this is working)

Also, I have sunset-to-sunrise predicates in some of my rules and they work, but are severely delayed, often by 12 hours or more. I have noticed that for rules that aren't triggering when they should, I can see red text in the Apps page which says the predicate is false. If I go into the rule, it will say the predicate is true, but will still not trigger, and will still say "predicate false" on the Apps page. If I go into the rule and press Done a few times then the red text on the Apps page disappears and the rule will trigger correctly.

I'm on version 2.2.8.156, which is the latest at the time of this post.
My timezone is +10.
I've checked System Events->Location Events and the events and times look good.
Also had this problem in previous version of RM.

Any suggestions?

Can you share screenshots of the rules and the logs?

Please also include the scheduled jobs table that can be seen at the bottom of the screen after clicking the cog icon.

1 Like

EDIT: - I just checked my phone and I have been receiving the sunrise/sunset notifications, but they weren't going to my notification area. That's a problem with my phone so please disregard. The sunset-to-sunrise predicate is still a problem though.

Here's the logs around sunrise, which was at 6:26AM:


Sunrise did trigger a notification to my phone.

I highlighted the step light in the logs, which should only be turned on before sunrise.

Here's the rule for turning on the step light:



1 Like

Turn on all logging for the rule. It will show the Predicate changing, or it won't...

1 Like

Thanks, I've turned on all logging. I slept in and missed sunrise, will post the logs for sunset this evening.

1 Like

Usually it happens every day, but I had to wait 2 days for the problem to occur this time.

Here's the rule:

The predicate switched to false at the expected time:

And here in the log you can see the motion sensor going active at 9:31 AM, and then the porch light being turned on at 9:37 AM. This is about 2 hours after the predicate went false. It's also interesting that it took 7 minutes for the porch light to come on. Other rules with this problem have been executing instantaneously.

As soon as this happened I jumped onto the hub to get the logs, and at that time the predicate was showing false as expected. This happens a lot - when I'm investigating the predicates seem to be triggered to update somehow. Perhaps the "Display current values" setting is causing the predicate result to refresh.

There is no indication in those logs that the rule had anything to do with it! There are no log entries from the rule. What is app 118? That appears to be then proximate cause of what is going on.

Oh! App 118 is the Maker API which only has access to 3 virtual motion sensors, which my security cameras use to set motion active/inactive.

All 4 logging types are enabled for that rule, not sure why nothing is shown. I just clicked on "Update Rule" in case that's required. I previously only clicked "Done" after enabling logging.

Simple answer: the rule didn't run.

This has me stumped. I found logs of the rule being triggered when it should be, so logging of the rule is definitely enabled.

Aside from the rules, only dashboards are using the light:


I've now removed access for the dashboards and will wait to see if it continues to happen.

You can easily test the rule by hitting Run Rule Actions. That will show you what to expect in the logs, and confirm that Action logs are working.