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?
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.
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.
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
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.
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'.