I tried using 'Wait for expression' instead and still had the same failure. The app logs that it is waiting for the expression (door closed = true) or the timeout, then the door closes and nothing else happens. I switched it back to 'wait for event' and it's failed several times since then. I also edited another rule that was also waiting for the front door to close to see if that was somehow the issue, but even with this rule as the only one subscribed to 'front door contact closes' it still intermittently fails to proceed after the event occurs.
I'm going to try one last thing before giving up. Instead of using the timeout option, I'm going to use an expression of "time since event: door open > 5 minutes OR door closed = true" and see if that works.
Hey Bruce, sorry it's taken a while to get back to this. I thought about starting a new thread but there's too much already in this thread for me to copy over to keep coherency.
Just to review: the rule stalls after consistently after it's very first run after being initialized and the behavior is repeatable by going to the rule page and then hitting "done" to initialize it. The first run after "Initialized" always fails to complete. Any subsequent attempt to run the rule will complete successfully.
Both of you legends above for the screenshots say the same thing. Are these different, one after hitting Update or Done, and the other after successful run?
I really thought so, but it's entirely possible I messed up somehow... I'll initialize it again and post the results. Will probably be later tonight before I get a chance.
Sorry this is split across two threads, but I thought I'd follow up back here on the thread I originally started:
This happened again with my alternate syntax as I posted on the other thread:
So now that syntax has failed also. I just had back-to-back success and failure of the rule. Here are the logs. If there is anything else I can provide other than the logs, let me know.
The only thing I can suggest is that when it fails, to immediately get a screenshot of the Event Subscriptions from the App Status page of the rule (gear icon), and post that here. It's clear that the app didn't see the event, but not clear if it was even looking for it. If it wasn't looking, that would be a bug. If it was looking but didn't get the event, that's a deeper issue.
So I'm running into a similar, but opposite problem with "wait for event" - I have 4 virtual switches. I have a "wait for all" to be off. I can see in the logs that all devices are successfully turned off, but then the rule suddenly stops and doesn't proceed to the next item. No errors, just nothing. Reliably - 100% after 20 tests.
After reading this thread, I added a "timeout after 2 seconds" to the "wait" and it suddenly started working.
I then removed the timeout option and the "wait for 4 switches to be off' suddenly started working.
I spoke too soon. It's not working without the "timeout". Adding the timeout to the wait for event causes the rule to proceed. And since these are all virtual devices, it's not like it's waiting on a physical switch.
I seem to be having a similar issue with a rule of mine, or I am missing something.
The rule: This screenshot was captured after the rule was triggered, see log below. Private Boolean is still false. Could the cancel pending actions be an issue?
The log: At 07:22 the smartplug is < 50 but it just sits and never completes the rule. It's a little after 8:00 at the time of this post, and it is still waiting. Smart plug is sitting with nothing plugged in to it.
another rule machine app that changes these based on what is happening... (basically, like a logitech harmony - these switches represent "activities" trying to tell me what the current activity is so I can have a different light on for each
I had forget I had used that. I noticed it just after posting, while looking over post one last time. Didn't have time to test was about to go to bed. Thanks for checking it out.
So the slide should read cancel all pending actions while the required expression is false? This is the first time I have used that option, and thought it could cancel the wait for turning off the smart plug, if the rule were triggered again during the 1 minute delay after the rules completes. I guess I will just add a cancel pending actions.
That's the problem, there's nothing in the logs - if I put in the timeout, the rule and everything after the "wait for" happen as normal. If I take out the timeout, the "wait for" is the last thing that happens in that rule. There's no errors anywhere - even in debug. I'll do some before and after tests and gather
With the cancel pending actions, as soon as the required expression goes false, it will immediately cancel the rest of the rule. In your example, you are canceling the rule once the first action happens. Your Private Boolean goes from True to False and this triggers the cancel pending actions. The cancel then wipes out the rest of your rule, which is why it does not run.
The rule did run. See screenshot above. It ran to the wait for event and appeared to be waiting. The Private boolean is false but the event of the private Boolean going false occured at 7:07:24.128. The pending action did not occur until after, at 7:07:24.942. Not quite a second later but it was after. Also there was nothing to Cancel at the point the rule was triggered.
Edit: Is a pending action everything or an event subscription?