Scheduled triggers not working (wait until, sunrise/sunset, etc.)

@bobbyD

I have a handful of apps (5-6) using some element of time as a trigger. None of these are currently working. All work fine up to the point of a 'wait', for example, and then just sit there. Sunrise/Sunset also did not work this morning.

I was on 2.3.9.162 when this issue started. Troubleshooting thus far has been rebuilding database on .162 using advanced options reboot and rolling back to 2.3.9.158 when that didn't work, then rebuilding the .158 database. No change.

Example: I have a simple app that turns on a light switch when motion is detected and turns off the light switch 3 minutes after motion goes inactive (Changed to 10 secs for testing). Light never turns off. For testing I removed the wait and just had light turn on with motion and turn off when motion goes inactive. This works.

Basic Rule

App Status




Logs

Thoughts or suggestions anyone? Every app I have that contains any element of time checking is not working and shows Scheduled Status of 'pending' when the app runs.

@bobbyD

So I ran a test on a spare C7 that I added a contact sensor to and set up a basic rule for when the contact sensor opens wait 30 seconds and send a pushover message saying the door is open. That rule runs fine on the C7.

Screenshot 2024-07-23 at 7.05.36 AM


Created and ran that same rule on the C8 and the 30 second 'wait' is pending in Scheduled Jobs. FYI - The contact sensor is meshed from the C7 to the C8. This behavior is consistent on the C8 for all rules with any element of time related actions.

Screenshot 2024-07-23 at 7.13.57 AM


@bobbyD @neonturbo @Evilborg @aaiyar @csteele @rlithgow1

I apologize up front for taking this approach, but I'm desperately seeking help resolving this problem and I consistently see you very knowledgeable folks (and others) assisting in troubleshooting and resolving difficult issues.

I have a C8 as my primary hub and a rarely used C7 for testing and troubleshooting. My problem is the scheduler on the C8 does not seem to be functioning. All of my rules are primarily Basic Rules with a handful of Rule Machine rules. Current situation is as described in my initial post; any/all rules with a time element (wait, delay/sunrise/sunset) stop working at the point of the wait/delay. I ran a simple test on the C7 this morning and it completed fine on the C7 and hung on the C8 (details in previous post). I'm at a loss for what to do next to resolve. I don't think this issue is self inflicted, but it is not beyond the realm of possibility. Any and all help or guidance is appreciated as my wife told me this morning she's about had it with this 'smart' home.

Hmmm... Strange one. Open up an affected rule then click done and see if that fixes it.

2 Likes

Sounds a lot like the scheduler issue mentioned in this topic, with the identification steps in other posts:

3 Likes

worked for me...

dev:609 2024-07-23 12:38:47.279 PM info pseudoSwitch was turned off
dev:608 2024-07-23 12:38:37.160 PM info pseudoMotion is inactive
dev:609 2024-07-23 12:38:22.202 PM info pseudoSwitch was turned on
dev:608 2024-07-23 12:38:22.137 PM info pseudoMotion is active

C-8 (v2.3.9.162) and created the virtual (pseudo) devices just for this test.

The motion was made active, the switch turned on. The motion went inactive 15 seconds later, and then the switch turned off 10 seconds after.

Ran it again, throwing in some "confusion" to see if I could break it...worked fine.

dev:609 2024-07-23 12:46:03.126 PM info pseudoSwitch was turned off
dev:608 2024-07-23 12:45:53.010 PM info pseudoMotion is inactive
dev:608 2024-07-23 12:45:32.614 PM info pseudoMotion is active
dev:608 2024-07-23 12:45:20.371 PM info pseudoMotion is 72°F
dev:609 2024-07-23 12:44:44.734 PM info pseudoSwitch was turned on
dev:608 2024-07-23 12:44:44.695 PM info pseudoMotion is active

Tried making it active a 2nd time, and threw in a temp change to verify it isn't getting confused. But 10 seconds after I made the motion inactive, the switch went off.

1 Like

Thanks. I did see that post yesterday and checked my hub details. All seems to be correct.


I also see Bruce's comment he would check to see how to fix the scheduler but nothing after that.

@bravenel

Thanks Rick. Did that and no change.

:thinking:

That's good to check, but it's not the steps outlined in the topic linked to above, which involve searching logs for scheduling errors related to a particular app or driver and finding the offending ID. (I do actually see it mentioned in a later post in that topic, but it's not likely to fix this particular problem.)

Thought I might be onto something with this one. Where I first noticed this problem was Saturday afternoon after I loaded the Matter Advanced Bridge Driver and was discovering devices on my Aqara M3 hub. I would re-run discovery after adding a few new devices and it worked at first, then eventually stopped finding devices on subsequent additions. It was Sunday when I noticed other rules not working correctly and ultimately discovered the scheduler problem. Any way. I just uninstalled the Matter Advanced Bridge Driver and rebooted the hub. Unfortunately, same results

This still isn't part of the instructions. :slight_smile: You'd need the app or driver ID and then use the steps in the post linked to above (or really, see the release notes they link to with the information) to delete the "stuck" job.

That being said, I don't know if uninstalling the offending device would do that on its own; given that it's somewhat of an unexpected state to begin with, I wouldn't be surprised if it didn't. And it would also take Logs in the first place to verify where the actual problem is, good of a guess as this may be without that.

Went through all past logs and didn’t find any errors as described in the post. Unfortunately my past logs only go back to 7/22 around 8:45 AM.

@bobbyD - can the engineers resolve this problem if I PM my hub ID?

Please send me your hub id, will see what we can do to help.

1 Like

This problem has been resolved by restoring a backup that was generated prior to the database being corrupted.

The auto backups that were generated when the hub was shut down multiple times during troubleshooting, saved a corrupted database, so restoring one of those backups kept restoring the problem. The reboot with database rebuild feature I was using was restoring the most recent backup, which in this case was bad. gopher.ny pointed me to a good prior backup to restore and all is back to normal.

Thanks to all of you for your suggestions, guidance, and support in getting this resolved!

4 Likes