I had one of the 'wait for expression' rules on my non-radio C-7 hub fail last night after running successfully several times earlier in the day.
This rule had required expressions but no PB,. Every time it runs, its own actions cause the required expressions to go false, so that is functionally the same as how a PB generally is used. If the required expression going false was the issue, then I would expect it to fail every time unless there's some sort of race condition going on. Instead the failures have been intermittent and it runs correctly more often than not.
To describe the rule in general terms:
Its required expression is: device "A" custom attribute <> 100
Its first action is to set that attribute to 100.
The next action begins a 'wait for expression' that has 3 conditions:
(1) Device "B" custom attribute = false,
(2) Device "C" custom attribute <> a certain string, and
(3) Power meter "D" is below a certain value and stays that way for 1 minute.
After the 'wait for expression' is true, the rule sets the device "A" custom attribute to a value (less than 100) that comes from a hub variable.
In the failure yesterday, with all logging turned on, the rule never logged anything after the 'wait for expression' and the rule never set the custom attribute on device "A" back to the correct value. When it runs successfully, it will start logging alternating "Duration event..." and "Expression now false..." log entries until it logs "Expression now true..." and "Wait over: duration"
Using the advice given earlier in this thread, I've added a second rule and a hub variable to let me simplify the 'wait for expression' and hopefully work around this issue. My new helper rule has several required expressions and one trigger which taken together, replicate the 'wait for expression' of the main rule.
The new helper rule required expression is:
(1) device "B" custom attribute = false AND
(2) device "C" custom attribute <> a certain string
The trigger is: Power meter "D" is below a certain value and stays for 1 minute.
The only action of this rule is to set my new hub variable to 'false'.
To keep the rule from subscribing to the power meter all the time, I added an additional required expression element that the new hub variable must be 'true', so this rule will not run until the main rule sets that variable to true.
I modified the original rule to make it's first action 'set the new hub variable to true'. I modified the 'wait for expression' so it is waiting for only one thing... that hub variable to be false.
To explain the new rules as concisely as possible: The main rule sets the hub variable to true. This activates the helper rule which triggers once the conditions have been met. The helper rule sets the hub variable back to false. This satisfies the main rule's 'wait for expression' action. The main rule should then finish.
I'm hoping that with the main rule now only waiting for a single expression element, and with that expression element completely separated from its required expression, I'll see this run reliably.
If, however, the actual issue is with the required expression going false and that cancelling any 'wait for expression' actions, then I would expect this to fail just as often as before, It will probably take anywhere from a few days to a few weeks of running without failure for me to be comfortable that the changes made a difference.