Set Thermostat to 77 - Run once rule in a specified time range - RM

Hello All,

Did I set up this rule correctly? I only want the rule to run once in the time frame 3:50pm to 10pm. I may want to set to a different temperature after the rule has run. I don't want it to set it back to 77 after I changed it.

Your first action is just a wait for your trigger event, so that doesn't make sense. This is one idea off the top of my head (I'm sure there are other ways too)...

Reqd Expression = stat is cool

Trigger = time is 3:50 pm

Cancel timed actions (this rule) -> delayed 6:10:00
Wait for expression - temp motion ≤ 72
If stat Not 77, then
    stat -> cool 77
End-If
1 Like

Thanks for the response. I am trying to understand your rule. I always assumed the Trigger time in Triggers is when the rule starts at a specified time only. Does trigger actually mean the start of the whole rule and keeps on waiting until it the temp is 72 or lower?

My goal is for this rule to run only once at a specified time range I specified. I do not want it to run outside that time range. The temp might not drop to 72 until 6pm or later.

Our electric peak rates is from 4pm to 9pm. I don't want the A/C to kick in once the outside temp hits 72 or lower and temp inside will likely not hit 77 if outside temp is 72.

I have solar, I will set another rule once my lux sensor hits a certain lumens, it will set the thermostat back to 72. This rule will only run if the Thermostat is in the cool setting.

Unfortunately, there's not a "run once a day" element that you can simply add in a rule, so it requires some creativity to get there... And that gets a bit thornier when you want that run to just be in a certain time window.

In my example, the 3:50 trigger is what wakes the rule every day... The main action is then for it to wait for the sensor to report the desired value - when it does, the stat then sets to 77 (if not already set there).

The "Cancel timed actions" part of my example is what defines the window... Starting at 3:50, if the sensor never hits that designated value, then the rule effectively shuts itself down 6'10" later (i.e. 10pm).

There are other way you could set this up where the time window is built using conditionals within the rule, and you use the sensor value as the trigger.

Although that approach should work fine overall too, I just always try to build my rules to minimize trigger events as much as I can -- even if they end up exiting quickly due to a conditional, I don't like my rules "firing" unecessarily.

Thank you for your response and explanation on how your rules works. I recreated my rule using Booleans. Do you see anything wrong with it. If that doesn't work then I will try your rule with Booleans included to run once. I've never used "cancel timed actions" because I never understood it until your explanation. I understand now how to use of it instead of using a time frame in required expressions. I like having the required expressions on the time frame because the rule can only run in that time frame.

Here are 2 examples of "once per day" rules I use... This first one requires no time window, since "Mudroom" is activated by a motion sensor that we trigger dozens of times throughout the day, so this rule fires with 100% reliability whenever we happen to get up every morning.

This next one is what I based my suggestion off of... This one turns on an exhaust fan in our detached garage when unusually high afternoon temps cause it to get overly toasty out there. The 7-hour delayed cancel otherwise sidelines the rule at 7pm (since the daily threat of rising temps is effectively over by then).

1 Like

For the rule you posted above my latest post...

Using 3:50 in both the Reqd Expression and Trigger is likely to be problematic - there's a good chance one will step on the other.

Your motion temp is evaluated at 3:50 and then never again - I'm fairly certain that's not your intent?

I think you are right. I'll make a change and see how it goes. I'll post my results tomorrow.

1 Like

Thanks for your help @hydro311. I was able to apply the Cancel timed actions to a couple of my other rules. I was able to make it work with this rule. I'm sure there's much shorter version to do this. I just don't know enough.

I wanted the ability to turn down the Thermostat below 77 without retriggering the rule until the next day.

Did you mean to say "wasn't able to make [cancel timed actions] work..." here?

If so, what is the issue/concern you encountered?

I didn't try the Cancel rule. I think I could of used it instead of the Boolean. How about this.

For all this to work, the rule's (only) trigger must be the start time of the desired window (3:50).

That way, at 3:50 every day (assuming RE is met), the rule will effectively wake up, and then it just waits for Motion sensor to say "Hi, I'm finally at/below 75 here".

If that happens w/in 6'10" (by 7pm), great - the tsat gets as desired. If the sensor doesn't ever hit that value w/in 6'10", then that 6'10" Wait is cancelled (along with the action after it), and the rule effectively goes back to sleep until the next day at 3:50.

Do not include the time window as a Reqd Expression (RE) - it is not helpful, and it will in fact be a hindrance in this case. I'd just leave the RE as Tstat is cool

Having the final action as Tstat -> 77 is likely totally fine, but for extra insurance for the possibility of the stat already (manuallly) having been set at/below 77, I'd wrap that in an If-Then like below...

This all is restricted to once-per-day since the Wait event is kind of like a second trigger within the rule... If that's triggered, that can only happen one single time after the "main" rule trigger (time is 3:50pm). Any subsequent occurences will be ignored since the rule is well past its main trigger (3:50), so it's already run-&-done.

RE: Mode tstat = cool

Trigger: Time is 3:50pm

Cancel time actions (This Rule) --> delayed 6:10:00
Wait for expression: Temp of Motion Sensor ≤ 75
If tstat not ≤ 77
     tstat -> cool 77
End-If
1 Like

This one also worked. I had it send me a message for testing.

I'll add the start time of 3:50pm instead of the time range. I'll also add the If then for the extra insurance to set the Tstat as a second trigger.

Here's the one I just set.

For Cancel Timed Actions, you literally want to select the "This Rule" option -- there's no need to get any more more creative than that.. When that option is selected, it'll look like my own real-world rule (second image) that I posted in post #6

In the If-Then, I think you want to use Tstat not ≤ 77 instead of Motion temp -- there's no need to involve the motion temp there, as your goal is to prevent the rule from setting the tstat to 77 if you happened to (manually) already have it turned down to 74 (for example).

The last one I posted with the If then statement trigger at 2:29pm. I like the extra insurance that will run. I've made the changes to run at 3:50pm. Much Thanks for your help on this.

Btw, I also changed the if-then to ≤77.

1 Like