Run my rule between 9pm and 11pm every 15 minutes

Is this possible with Rule Machine?

I see periodic schedule to setup the "every 15 minutes". But I don't see where to set a restriction between a certain set of hours.

Just thinking off the top of my head. Make it a condition based off a virtual switch being on. Have another rule to turn that switch on between your times.

1 Like

Trigger would be periodic every 15 minutes and then add a conditional action to check the time. Though this seems like a lot of overhead and I like @mik3’s idea better of controlling a switch that will be used as your trigger and then actions to repeat every 15 minutes.

1 Like

The simplest way to achieve this is simply have 9 triggers at the desired specific times (21:00, 21:15, 21:30, 21:45, 22:00, 22:15, 22:30, 22;45, 23:00).

Alternatively, use the periodic trigger (every 15 minutes) and set the conditional to be "Time of Day". When you pick that condition, you get the choice of "Between two times" (turn that slider on) (as shown below)


Finally, you can also do it using @mik3's suggestion (periodic trigger with a timed virtual switch).

RM: startSchedule
Trigger: When time is 9am
Repeat every 15 minutes (stopable)
. your actions

RM: stopSchedule
Trigger: When time is 11 pm
Cancel Timed Actions: startSchedule

Can you show a copy of your rule?

  When time is 9:00 pm

  Repeat every 15 minutes (stoppable)
    If time > 10:59 pm
      stop repeat
    ... do stuff ...

Thanks all for the suggestions.

@jabecker, I couldn't find the greater than option for time.

I ended up using @aaiyar's suggestion as the time of day gives me an option to use between.

Here's my rule in RM. I ended up using 30 minutes instead of 15.

Okay, this is why I asked....This rule does not run every 30 minutes between those times, this run every 30 minutes all day long. Every day.

Why not simply trigger based on the either of the sonos going to play, have the conditional action be the time and then pause them as the final action. This would mean that you wouldn't have a rule running dozens of times a day doing absolutely nothing. It would also mean that the speaker would not stay on for 1/2 an hour but would turn off immediately. If you want a delayed off, use a delay, that would be more consistent. Now, if you turn the speaker on at 10:29, you will only get 1 minute of music. It would be much better to do this:

Trigger:  The sonos is playing

IF time between x and y  then
     Delay actions by 30 minutes
     Pause Sonos

This will reduce the overhead on your hub considerably.


@Ryan780, good point with the 10:29 use case. I switched up the rule to your version. Thank you.


I've been reading this thread and I'm afraid I don't understand what you want. I see mention of Sonus. So you want to play something on the Sonus every 30 minutes from 9 am to 11 pm? Is there something else you wish to accomplish besides this?

@bbholthome, I was attempting to make a sleep timer for Sonos speakers. But I sometimes use a button to start the music and I don't want to open the app to set the timer. So I wanted a rule that would auto set a sleep timer during certain hours. I originally thought the only way to do that was to check for playing every X minutes during a period of time. But @Ryan780 had a better solution.