[Fixed in FW Update] Rule to set boolean false after 'wait for event shade open' fails to complete

2.3.3.118

I can't figure why this rule didn't work this morning. An identical rule for an adjacent room worked as expected. It flips a boolean to true when the lux falls below 200 or the blind closes, waits for the lux to go above 200 and flips it false, unless the blind is still closed, in which case it waits for the blind to open before flipping it false:

It triggered correctly and set the boolean true last night. This morning when lux reached 200, it triggered the rule:

The log shows that the blind was closed and the rule was waiting for it to open. Later, the log shows the blind open:

However, the rule does not complete. The wait is over, the blind has reported open, it should proceed to set the boolean false but nothing happens.

I think the wait it says was over refers to the first wait, the illuminance. Seems like the Else didn't run when it was in the if statement before - maybe cos the rule was killed at that point by being triggered again by a change in illuminance? Thats the one shortcoming in logs, you get the app ID but not the instance ID so it can look like all part of the same run of the rule

If it turns out that is part of the problem, I had a similar one. To solve that I created a boolean hub variable that would be set to true every time a sensor reported more than a certain humidity and false when below that. So although the boolean was being addressed many times an hour by the sensor, it only triggered my rule when true turned to false and vice versa

There are two waits. Once the boolean goes true, it waits for the lux to reach 200. IF the blind is open the action sets it false, ELSE it waits until the blind is open then sets it false.

It did, it's shown here - Else, Wait

The event then occurs - the blind opened and reported open at 08:00:52, so that wait for event was over, yet it failed to complete the actions.

Well that's exactly what this rule already is. This rule flips kitchenDark true when the curtain closes or the lux falls below 200 externally and false when the lux rises above 200 externally so long as the blind is also open. I'm then using that boolean as a required expression in my Kitchen motion lighting rule.

If I am reading that right your first problem is the required expression. It requires the illuminance to be greater than 200 to trigger. So the trigger of <= 200 can never trigger the rule.

So when the illuminance is > 200 and the blind closes is the only available trigger for the rule.

1 Like

It works. It allows the rule to trigger when a threshold is crossed but prevents the rule from re-triggering whith subsequent events below the threshold. Here's an example that shows the Required Expression is evaluated after the Triggering event happens.


image

Yeah I guess it would.

I wonder if it is something to do with the required expression showing it's true twice in the log. When the illuminance reached 201 it says the required expression is now true. It then starts the wait, but right after that the illuminance goes to 212 and it again says the required expression is true. It should already have been true and should not have been set to true again. What kind of effect that has I don't know. Perhaps that stopped the wait? I don't think it should have.

So just to confirm. The required expression being over 200, the rule triggers and is prevented from re triggering as @pseudonym says. Once triggered all actions should run - wait until >200 again and then (if closed) wait for the blind to open.

@terminal3 - I hadn't noticed that second "required expression now true". As you say it was already true so shouldn't have reported it again

1 Like

Agreed but I just replicated with this simple rule.
@bravenel The rule triggers and if the Required Expression stays false, the Wait executes properly.


If the Required Expression goes back to true during the Wait, the Wait fails to execute.

Edit - I'm on 2.3.3.119. This probably belongs in the beta section.

1 Like

So it looks like you've managed to replicate what I've seen.

Me too. I've not updated to the release version yet. My original post was in the beta forum for this issue a few days ago. It's still there but I appended the title with '[Resolved-User Error]'. I wasn't convinced it was user error but I couldn't get the logs at that time to prove anything, so made the assumption that it could be something I did.

Yep, and I just updated to 2.3.3.122 and verified it's still not working so I guess it doesn't need to go to the beta section.

1 Like

Please consider this log, from a rule with the same Required Expression and Trigger as yours:

At the moment the temperature sensor first reports 72, the Required Expression is true from the previous events. Consequently, the rule is triggered, and then the Required Expression becomes false. This is exactly how it is supposed to work.

@bravenel Yes, I understand that. The issue is different. If the Required Expression re-evaluates as true during the Wait, the Wait fails to execute.

Yep, I see that. Will fix it.

4 Likes

I love it when I report a bug and it turns out to be a bug.....rather than something I've completely misunderstood or cocked up :smile:

1 Like

Fixed, but for a spurious log entry "Event: "

Fix in next release:

1 Like

Great, thanks Bruce :+1:

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