Use of "END IF"

I ran the rule in the attached for the first time last night, and it didn't run as I expected. I wanted a device to run for 2 hours. Instead, the device turned on as expected, but ran well past the 2 hour mark. I'm curious if the inclusion of "END IF" could be the reason. Would that have prematurely terminated the delayed off?

Screenshot 2024-06-12 143207

1 Like

It would be helpful to post a screenshot of the rule's entire setup - there may be a clue elsewhere in how it's structured beyond just that one part.

ETA -- additional food-for-thought to consider (may be totally unrelated or not applicable here, but still good info be be aware of in general)... See the blue "Tip" field when you open link below.

2 Likes

That is interesting regarding the use of wait vs delay.

Here's the entire rule:

Nearly all of your IF blocks are open.
You need to close each IF block with an END-IF, if they are all supposed to be nested (as shown) then the end of your rule should have a few END-IFs until you cannot add more.

To troubleshoot the rule itself, turn on all the logging and then let it run. You can always adjust some of the delays to be shorter for testing then once its working set them back to how you want it.

Show screenshots of the logs.

1 Like

I would move the VS - Pool Automation Off to a Required Expression.

2 Likes

Yep, adding end-if's until the option disappeared solved the issue. Thanks! (again :grinning:)

I've seen that before but didn't really know what it did. After reading about it I can totally see how that would help. Thanks for the advice.