Slow Rule Execution

I have a rule that sets my mode to Home when either of my wife's or my phones come home. The rule works just fine, but it is slow to execute. Here is the rule:

Here is the events on the rule which you can see presence is detected at 8:57:50.810.

And here is the system events showing the mode set to Home at 8:58:46.933, which is almost a minute later than the rule running.

Why is there a minute delay. This ends up having us wait for the alarm to get shut off. It's not a big deal, just kinda annoying and wondering why.

EDIT: Something just came to mind. If one of the presence is presence and then the other one some seconds later does that cause a cancel on truth change and the rule to then re-execute with the 10 sec delay?

Ok, it appears that when the second person becomes present it sees that as a change in truth. Sounds weird as the truth didn't really change it just got reinforced. I had all the logging enabled and could see what was happening.

It shouldn't see that as a change in truth, it will just post that it is still true. Not necessarily a change. It is probably the fact that your presence isn't reporting back as quickly as you think. Are you sure that the device is actually showing in HE as "present"?

The rule events as shown above show it saw the presence. The second presence was about 20 secs later which accounts for a lot of the delay if the rule restarts on the second presence. I don't know for sure what is happening, but looking at the event times something has to be happening.

Maybe see if using a trigger has a different response maybe?

I have redone the rule as a trigger. Then in the actions I use an IF to see if the trigger is still true. Gonna see if that works better.

I have had some issues with some rapid presence changes right around the border line which prompted me to do this in the first place. Basically just putting in some time delays to make sure the presence was still what it was. Leaving is not as big a deal as it can take longer with no problems. And the only issue with coming home is sometimes we have to wait before the mode actually changes before opening the garage door.

Again it's not a big deal, but just something for me to puzzle over.

There is only 1 way in/out of our subdivision and the way the road loops back I can't make the presence circle much bigger or it really goes bonkers.

I appreciate all the responses. I will continue to test and see what happens.

Another tip I saw from someone else is to move the centre of your location so that it triggers earlier. Especially if there is only one route in. Might be worth a try too.

I've thought of that, but the road arrangement makes it a little tricky. I'll look at it a little more.

Still puzzling over slow rule execution. Forget about the presence situation I mentioned above.

I have a rule that looks for a mode change. The first thing in the actions is to send a push notification to PushOver. The second action is to set a virtual contact to open.

According to the events log the rule was triggered at 1:18.01. The Pushover device (HE device) got the message to sent at 1:18.27, 26 seconds later. The contact change took place at 1:18.08, 7 seconds after the trigger.

So what is going on in that 7 seconds or the 26 seconds? I would have thought the contact would be almost instantaneous.

1 Like