[Released] Rule Machine 3.0

'wait for condition'

Good hunting!
And, thanks again for the quick response.

Thanks. The subscriptions you had were for Wait for Event. That's a clue for me to dig further into. This has made me realize that it needs to be visually more explicit which sort of Wait it is, as for now they look identical in the logs. One possibility is that the subscription side of the Wait, that which happens when it begins, erroneously subscribed as if it were Wait for Event, and then later when it went to unsubscribe, it attempted to unsubscribe from the event that would have been subscribed properly for Wait for Condition. The result of that mistake would be consistent with what you've shown. Tomorrow I'll dig into that to find the problem.

I presume that means you guys are working on a fix for whites? Man, I’m getting som funky colours when I select different whites.

Last week I was able to put a 'Simple Conditional Action' as the then part of another 'Simple Conditional Action' but now I can't. Don't know if this is intentional or not. Here is what happens when I try:

Note that the only option I have at this point is to cancel the action.
Thanks.

That should never have worked.

This has been driving me nuts so I thought I'd let this drive you nuts for a while. :wink:
I have a trigger named Morning that turns some stuff on/off, runs an action that turns off the thermostat, waits for it to complete, sets two global variables and then runs the action 'Thermostat SetTemp'.
This action is never executed. Not only does it not show up in the log but I checked its event log.
Instead, the log repeats:

Wait over: variable HeatSetpoint set to 77 by Morning TRUE

and the two Sets 42.5 times and then nothing. It never executes any code after the Run.
And, I NEVER do a wait on a variable being set to 77 in Morning or ANY code in ANY rule.
Driving me crazy for many hours.
Here's the rule and log file:

Hope you can help.
Thanks again for all the hard work you've put into this and if there's anything else you need, please let me know.

So, the way I would debug this is to simplify and be sure that key parts work as expected, or not. For example, I just created a simple set of actions, like this:

The rule "thermo off" turns off the thermostat called "virt therm". My goal here is to verify that the Wait for Condition works as expected. Here are the logs from it running:

These show that everything happened pretty much as expected, although the thermostat state turned to off before the Wait for Condition even had a chance to wait. So next, I'll intentionally delay that happening in the rule called "thermo off" so there is a real check of the Wait for Condition working correctly.

Here are those logs, again with everything working as expected:

Then I'd move on to test the next part of your rule, but I can't tell what it does. Presumably CoolSetpoint and HeatSetpoint are global variables. What does "Thermostat SetTemp" do?

Why are you doing this in such a convoluted manner? Why are you using a separate rule to turn off the thermostat, instead of just turning it off? Same question wrt setting its setpoints? Why introduce all of the waiting for it to be set? Why the Stop Actions? There is nothing to stop.

What are you actually trying to accomplish? It appears that you want to turn some things on, turn some things off, and set the thermostat. Is that not just directly possible?

Bruce,

Should this rule work? Specifially, the double if statments. The last if statement (off and evening did not work today......every other IF statement has worked so far - away, day and night).

(This is a triggered rule, which sucessfully triggered, but did NOT change mode)

Your problem is the two ELSE-IFs in a row with the same condition. Of all of the ELSE-IFs after an IF, only one of them is going to run. The first one did run, although the simple conditional action after it was false so didn't do anything. The second one, the one you have highlighted, did not run because the first one did.

@bravenel this rule isn’t working 100%. The final on is not working and the switch stays off. This used to work in earlier versions of RM

Turn on action logging, and post those...

@bravenel I believe I found a bug in RM

In the rule in the screenshot I wanted to "edit" the ELSE in the rule and change it to ELSE IF, but when selecting Edit "Else" the following screenshot appears to where the only selection is Done with this Action.

So the Else, must be deleted and action must be readded. Not a big deal but thought I'd let you know.

Yes, you can't change what type of action something is with Edit Action. Edit Action allows you to change selections made within the action only. So, yes, to change ELSE to ELSE-IF, you would have to delete the ELSE and insert the ELSE-IF.

Yes, that was my question if you look at my post.

Will this work? Specifically the double nested if statements at the end.
Cant test as there are a whole stack of 13year old girls at my house - doing "homework"

Yes, that will work. You can have Simple Conditional actions inside an IF-THEN or ELSE-IF block.

2 Likes

@bravenel finally remembered to capture log. The on action is happening out of order and firing before the Off. Odd thing is this isn’t happening 100% of the time this rule is executing. Is this fixed in 4.0?


@bravenel curious if you have any thoughts on why my rule above isn't working. This was working in older versions but now the On action is firing immediately versus waiting for the delay.

You may have multiple instances of the rule running at the same time.

That's how you wrote the rule. The delays you have apply to the specific action they are attached to -- ONLY. So it's going to start a timer for an hour and an instant later start a timer for a minute. So obviously the one minute will expire first, and the hour later.

If the power level drops below 2.0, the rule goes false, cancels the hour timer. But, the minute timer is still running and will still turn on the heater when it's done. Meanwhile, If the level goes above 2.0, the rule will fire true and start another one minute timer, even if the first one hasn't finished.

@bravenel This rule used to work and now it doesn't but I rewrote it and tests have been successful.

But this said, my mailbox notification is no longer working where the boolean true action isn't running and it remains false:

I get a log entry that the Wait at Certain Time happened but it never sets the rule Boolean to True:
image

I even recreated this rule on my dev hub and made the Wait for event to a more recent time and here are the logs:
image

As you can see there isn't an entry that "this rule" boolean was set to true.

I happen to have my very old test logs on my dev hub and you can see there is an entry for setting the boolean to true from that time:
image

Have you tried this with Rule 4.0? Is this a 3.0 rule?