Making sure I'm not missing something on REPEAT

Set up this rule:

In the log it looks like it only ran once but I'd think I'd see it every 30 min am I wrong?

Dunno, I wouldn't do it that way for this particular rule.

I would have done a Periodic trigger set at 30 minutes, and then in the actions checked Eco Mode status.

For things I want to be periodic I like the periodic trigger as then there is zero chance of concurrency issues (what happens if Eco Mode turns on/off multiple times? Does the repeat loop spawn multiple times? Does each event cancel the one before? Other?) or the rule running multiple/weird times.

And then you can do what you have listed with just 2 simple conditions, too. Or 1 complex conditional, of course, ANDing the two items - but I prefer simple actions in my rules when I can do so. I think it makes it easier to troubleshoot/follow long term. :man_shrugging:

Something remotely like this:

Something like this maybe.

TRIGGER
Eco Mode changed

ACTIONS
IF Eco Mode is off
THEN 
Stop Repeating Actions
Exit Rule
ELSE-IF
Thermostat mode is cool AND Temp is >78.0
THEN
Repeat every 0:30:00
Notify Pushover: 'xxxxxxxxxxxxx'
END-REP
END-IF

Think you’ve got an extraneous END-REP there

Oops. Your right. That should read STOP REPEATING.

I've amended the text above.

The Eco Mode virtual switch isn't on all that often so I didn't want to have it doing a test every 30 min. The Eco Mode is set via another rule that sees the doors open for 2 min and then sets that switch to on and adjusts the thermostat. Then I just wanted to check and if the temp in the house increased during the day to over 78 degrees I wanted notification so that I'd close the doors. Then the other rule would turn off the Eco Mode switch and this alert would stop.

I didn't have a number of times to repeat before as I thought that might be optional since it didn't complain but I added a value so will see how that works next time it gets triggered.

1 Like

Ok. Your choice. It takes about 15ms for the rule to run and then exit out. Not sure it really matters if it runs 1x every 30 min or not from a loading perspective.

You can be technically correct, and still be practically wrong. If the complex rule uses more resources to run in order to avoid the loading from a very simple rule running periodically unnecessarily, then did you really accomplish anything with the complexity?

Not the end of the world either way... Just pontificating, really.

2 Likes

Don’t forget to make the REPEAT (stopable)

I just was working on a new repeat yesterday and was scratching my head on why it wasn’t stopping.

How quickly we forget !!

Thanks for mentioning this. That's what you get for doing it off the top of your head. :wink:

You're right there. I've a fairly stable setup now and occasionally have to look at existing rules to jog the brain cell that I have left.:slight_smile: :grinning:

1 Like

Download the Hubitat app