Time Based required expression stopped functioning

I am having an odd issue that popped up sometime more than a week ago but less than 2 weeks ago. I can only assume it occurred after an update but I don't know the exact timing in relation to an update to the hub. We have an enclosed mud room and it has a light and a motion sensor. The physical Lutron Caseta switch is located in the house so I use a Xiaomi motion sensor to trigger the light for anyone entering from outside while it is dark out. It has functioned without any issue since last December but now it is triggering ANY time motion is detected. I have not made any changes to this rule. I use a required expression of “time is between sunset and sunrise”. When looking at the rule to edit it you can see it says the required expression is false. However if I look on the apps tab where it lists all my rules it never says the required expression is false whereas other rules clearly state in red that the expression is false. I have already deleted and made the rule all over again and the same issue is occurring. This rule is as basic as can be so I can not figure out what the issue is. What should I do?

Recently I was told to turn on logging so I did. I completed this change during the day time (so the required expression was false). After I updated the rule it properly reflected this on the app list again as it should. I did not have time to look at it again until this morning when I again noticed the light turn on AFTER sunrise. I returned to the app list and it did NOT indicate the required expression was false. I chose to edit the rule, made no changes, and hit update. Immediately the red notice appeared on the app list. In the following log list the event at 2022-10-15 08:25:42.059 AM saying "Required expression now false" is NOT when it actually should have gone false but is when I edited the rule myself. The actual time of sunrise according to the rule itself when I am in edit mode was 7:32am. It seems as though one this required expression goes true it will stay that way forever until I hit edit again and it corrects itself. Again this is NOT how the rule previously behaved and I made no changes. Any ideas how I can fix this?


[app:801](http://192.168.1.11/logs#)2022-10-15 08:25:42.136 AM[info](http://192.168.1.11/logs#)Initialized

[app:801](http://192.168.1.11/logs#)2022-10-15 08:25:42.059 AM[info](http://192.168.1.11/logs#)init: Required Expression now false

[app:801](http://192.168.1.11/logs#)2022-10-15 07:15:35.430 AM[info](http://192.168.1.11/logs#)Action: On: Mud Room Light

[app:801](http://192.168.1.11/logs#)2022-10-15 07:15:35.374 AM[info](http://192.168.1.11/logs#)Triggered

[app:801](http://192.168.1.11/logs#)2022-10-15 07:15:35.364 AM[info](http://192.168.1.11/logs#)Event: Mud Room Motion Sensor motion active

[app:801](http://192.168.1.11/logs#)2022-10-15 07:14:17.904 AM[info](http://192.168.1.11/logs#)Action: On: Mud Room Light

[app:801](http://192.168.1.11/logs#)2022-10-15 07:14:17.853 AM[info](http://192.168.1.11/logs#)Triggered

[app:801](http://192.168.1.11/logs#)2022-10-15 07:14:17.844 AM[info](http://192.168.1.11/logs#)Event: Mud Room Motion Sensor motion active

[app:801](http://192.168.1.11/logs#)2022-10-15 12:53:56.489 AM[info](http://192.168.1.11/logs#)Action: On: Mud Room Light

[app:801](http://192.168.1.11/logs#)2022-10-15 12:53:56.425 AM[info](http://192.168.1.11/logs#)Triggered

[app:801](http://192.168.1.11/logs#)2022-10-15 12:53:56.410 AM[info](http://192.168.1.11/logs#)Event: Mud Room Motion Sensor motion active

[app:801](http://192.168.1.11/logs#)2022-10-14 10:35:17.110 PM[info](http://192.168.1.11/logs#)Action: On: Mud Room Light

[app:801](http://192.168.1.11/logs#)2022-10-14 10:35:17.066 PM[info](http://192.168.1.11/logs#)Triggered

[app:801](http://192.168.1.11/logs#)2022-10-14 10:35:17.056 PM[info](http://192.168.1.11/logs#)Event: Mud Room Motion Sensor motion active

[app:801](http://192.168.1.11/logs#)2022-10-14 10:32:05.380 PM[info](http://192.168.1.11/logs#)Action: On: Mud Room Light

[app:801](http://192.168.1.11/logs#)2022-10-14 10:32:05.338 PM[info](http://192.168.1.11/logs#)Triggered

[app:801](http://192.168.1.11/logs#)2022-10-14 10:32:05.326 PM[info](http://192.168.1.11/logs#)Event: Mud Room Motion Sensor motion active

[app:801](http://192.168.1.11/logs#)2022-10-14 06:38:07.177 PM[info](http://192.168.1.11/logs#)Required Expression now true

[app:801](http://192.168.1.11/logs#)2022-10-14 06:38:07.173 PM[info](http://192.168.1.11/logs#)Event: scheduled event

EDIT: I see there was another update yesterday to the hub that mine did not take. I had an update I did yesterday but it seems it was not the latest, it was still 133 so I have updated now and will see what happens.

I'm not seeing this in your logs. I see the light turn on at 7:15 AM but you stated sunrise was 7:32. On the device page for this light, does it list in use by anything else?

Just FYI, most ppl, in fact one of the Mods here won't help you, unless you post a screenshot of your logs, not a cut and paste.

I agree, screenshots are much easier to review.

1 Like

I can't reproduce this using specific times.


If you go to the Location Events tab from the logs page...is there an event for sunrise?

Sorry it is not visible in that log. You are correct there was no improper event today but for some reason when I click the link to show the rest of the log it doesn’t actually do anything so I can’t get any earlier logs at the moment. Yesterday it was definitely activating when it should not have though.

As per the latest release notes (which I just updated to today AFTER sunrise had already happened) I’m hoping the fifth fix is what I need .

Release 2.3.3.134 Available

Changes from 2.3.3.133

Bug Fixes

  • Rule 5.1:
    • Adjusted Action table for screen reader.
    • Fixed Thermostat Scheduler action not including setting Thermostat Mode.
    • Fixed importing Basic Rule with open value.
    • Fixed Replace String not honoring %variable& in replacement string.
    • Fixed trigger at end of Stays if Required Expression is false.
  • Room Lights: Fixed null pointer error on instances with incomplete changes.
1 Like

Good to know for future. Thanks for the advice. I’ve been fortunate that in the 10 months I’ve been on Hubitat I really have not needed much assistance, unlike my previous 3 years on ST.

Yes I have that event in my logs.

As mentioned above I am hoping the latest update resolved my problem. I’ll find out tomorrow and hopefully I can come back tomorrow to update that it has been fixed.

I don't believe so. That fix was a problem where the trigger is something like "motion goes active and stays for 5 minutes." The rule was only checking the required expression when the motion event happened, but not at the end of the 5 minutes.

Why wait until tomorrow? Clone the rule, change the Required Expression to a certain time (only needs to be for a few minutes), and check to see if it logs as true or false correctly. OK, this isn't 100% but it should give you an idea if the Req Exp is being honored.

Don't even need to do that. Go to "Scheduled Jobs" from the log page. You should have scheduled jobs at sunrise/sunset for the rule.

I have been away all day and unable to do any further testing unfortunately. However by coming home later than usual I have discovered yet another rule of mine has stopped functioning. Tonight is the first time I have realized it wasn’t working but perhaps it has been longer, I’d be willing to bet it’s been broken as long as my original posted rule.

I have a pot lights outside in our soffits. They come on 10 minutes after sunset. I just arrived home at 8:15pm to discover the lights never came on. Again it is a super basic rule based solely on sunset + 10. I am seeing a pattern that sunset/sunrise as part of a required expression seems to be a problem. As of yet I have no logs for this second issue as I just discovered it now and turned logging on right away.

I am very stumped as both of these rules have been in use for me since day 1 of owning Hubitat last December without me modifying them at all. They’ve just suddenly stopped working out of nowhere.

1 Like

Same thing from my last post.

I haven’t had time to troubleshoot or do anything at all with this. However today everything has worked exactly as it should. I made absolutely no changes from when I first started this thread so I don’t know what caused this problem or what fixed it. I am glad it is resolved though.

Thanks to anyone that tried to help.

2 Likes

Well I am officially stumped. As I posted 10 days ago everything returned to normal on it's own accord. I made absolutely no changes whatsoever as I had no time yet it just started working again.

Today however it has stopped working yet again. It is now triggering before the required time again. I returned home over 2 hours before sunset and the light turned on. It appears multiple "sunset" based triggers are not working as 2 separate ones triggered before sunset.

The first rule is the same one I have discussed in the entirety of this thread.

The second is a rule that is based on presence and time. If a member of the house returns home after sunset we have a light that turns on inside our primary door and a light outside that same door that turns on. They came on when I returned home well before sunset today.

Again I have done absolutely nothing to change or tinker any of my rules. I have no idea where to look for this issue and how to fix it.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.