Skip next occurrence aproach

For my kid's room, I have setup a Rule, where at 7:30 AM, there is an announcement to help her wake up. Then, in a minute the light slightly brightens up. After 5 mins, there is another announcement and the light brightens up further.

Some days when there is no school on a weekday, I pause the rule to help the kid sleep-in...but then I forget to turn the rule back up. I am thinking of creating a switch, which when I turn on, skips my rule...but then after around 24 hours, that switch automatically turns off, allowing my rule to run again.

I know there must be a lot of ways to do it. Any suggestions on how to approach this requirement, before I over engineer this simple need?

1 Like

Perhaps with a Boolean Hub Variable and a second rule. The second rule is triggered by changing the variable, and changes it back after some time (the don't forget portion). Then just make the first rule, the one you have now, have a Required Expression that the variable must be true. So, to not wake her up, you set the variable to false, and then the rule won't run, but it will run the next day because the second rule will reset the variable to true.

1 Like

Thank you and that sounds prefect and exactly how I was thinking of implementing it, except with a virtual switch instead of variable. Do you know if using a variable will be cheaper/more efficient for the Hub than using a hub variable?

Sure, variable is cheaper and more efficient than a virtual device, although neither are that are expensive. No driver to load for a variable, no device in your device list. You can put either in a Dashboard. But, if you want Alexa to do this for you, use a virtual switch.

2 Likes

Oh, so I can add a variable to the dashboard to flip the boolean? Nice! I did not know that.

1 Like

hehe, this makes me wish, if Rule Engine had "wait until next day" :smiley: :smiley: ...just kidding :slight_smile:

Question - what happens on a hub reboot - Do variables get reset to a default value? Do virtual switches get reset to default value? or they both preserve their state?

This. Mine do. However, if you want something to happen on startup/reboot, put any desired actions in a rule triggered by the location event systemStart

It does.

The below did not trigger today (Monday, 7:30 AM)....any thoughts on what I missed from the condition?

image

Depends on how you manage that variable, right? When did it become true? That's a Hub Variable, right? Look at Location Logs to see when it became true. Look at the Event Subscriptions on the App Status page, and its Scheduled Jobs also.

For the moment, "skip next occurrence" is a virtual switch. I just extracted the hopefully relevant logs. If you notice below, in 11/27 7:50 am i turned on the switch. The rule time worked fine I think, and on 11/28 at 3:50 PM the switch got turned back off. Yet, today on 11/29 7:30 AM the rule did not trigger to turn on my scene lights.

image

image

You're showing the logs of a Basic Rule, not an RM rule. What is app 286? Do you have logging for the RM rule on?

Oh,286 is just a basic rule to turn the switch back off as shown below:

And yes, at 7:30 AM today, I do not see anything in the log for the RM... as if it never trigerred.

What I'm interested is did the Required Expression change state whenever the switch turned off. Look at the App Status page, Application State, and tell me what it says for 'stPrimed'.

Here is the stPrimed, for my RM:
image

Show the scheduled jobs for this rule. Also, what build are you on?

Scheduled Jobs:

Build: 2.3.0.113

Your setup is too complex for me to diagnose from afar.