Restriction based on time confusion

I have a basic rule that turns on porch light based on motion, between sunset-30m and sunrise+30m.

So tonight, sunset was 7:35pm according to my hub. So the rule should have gone unrestricted at 7:05pm.

I’m here at 7:55pm and it still shows restricted.

Am I misunderstanding + and - here?

Thanks!

Update: edited and saved rule, no longer shows as restricted.

I’ve seen this behavior before in 2.3.0 and it reappears after a few days.

Anyone else seen?

Basic Rules is 1.0.3 (1/20/2022). And just updated to 2.3.1.130

These are not dynamic pages, they don't update themselves automatically. Turn on logging for the rule, and see if it performs as you expect or not.

Understood. But if I load up the page (apps) for the first time after the rule should be active, shouldn’t it not say “Restricted”?

Is there any way to tell, short of triggering motion when the rule leaves and enters restricted? I have had logging enabled for months on the rule. It did not trigger at all yesterday, so there are no logs.

Show the rule, and the logs.

Is this Simple Automation Rule 1.2? Or is it an older rule?? Known bug in older versions, fixed in 1.2.

Basic Rule, 1.0.3.

Okay, just tested since it’s within the 30min before sunset window. Looked in apps, saw red “restricted”.

Triggering motion, light came on and logs showed it worked. Red “restricted” gone.

So it only removes that red label when it goes to fire and sees it’s unrestricted?

When the page is refreshed, it shows the current state of the restriction. This is true for the Apps list page, and for the rule setup page. The underlying restriction is refreshed whenever its underlying state changes, however, when the rule is triggered the state of the restriction is examined then and used to decide whether or not to actually run the rule's actions. There's two things going on: primary is the test of the restriction when the rule is triggered, and secondary is keeping the red Restricted text present or not as applicable.

Look at the Event Subscriptions and Scheduled Jobs for the rule on its App Status page (gear icon). Yours should look like this:

And this:

The handler called refresh will update the red text display, which is actually part of the app's name. This scheduled job above is 30 minutes before tomorrow's sunset. The event subscription above for sunrise is going to run a method called 'afterSunriseHandlerend'. That method is going to schedule another refresh at 30 minutes after sunrise tomorrow morning. The sunsetTime event will happen at tomorrow's sunset, and will schedule the refresh for the next evening at 30 minutes prior to sunset.

However, in the meantime, if the rule is triggered, it will check that the current time is between those two times, and if it is run the rule, and if not exit without running the rule.