Time as a user controlled variable

Just fishing for ideas on this.

I have a morning alarm sequence set in RM that is triggered at a specific time. If I need to alter the alarm time I just go into RM and adjust it and save the rule again. But ideally I would like the alarm time to somehow be adjustable through a dashboard control so that SHMBO can adjust it too. I was thinking about maybe somehow using a virtual dimmer level or a Global Variable, but before I put too much thought into it I wondered if anyone has already done something similar?

I looked for a way to do something like this and ended up using a virtual switch (which turns off after 500ms) and turning it on at specific times using automation in HomeKit (though you could do this in Alexa or Google as well).

1 Like

I'm on the same search... if you find a solution first please advise..I'll do the same for you :wink:

How about a Number Global Variable with a connector, so that it can be used on a Dashboard. Then in your rule, it is triggered earlier than you need it, and it's first action is a delay, with the variable giving the time to delay. Variable delays are expressed in seconds, so a second variable could be used to do a multiply-by-60 on a variable value from the connector expressed in minutes.

For example. the trigger could be for 5:00 AM. The variable-connector could be set for 60 minutes. So the rule would actually do its thing at 6:00. Then, you want to change it to 6:30, so you change the connector value to 90. Etc.

1 Like

"with a connector" sorry for maybe this stupid question but what is that?
But according my understanding you will need to calculate anyway the number of this connector to get the action at the desire time right? and to do this in a dahsboard I don't know but it sound complicated don't you think :thinking: ?

Is not less complicated to make a new Tile with this feature? I mean a clock to trigger an action like to click a virtual switch or similar....

The features I'm describing above already exist, while clock tiles and clock variables do not.

See this post:

Here is the rule I described above:

And here is the Dashboard tile where I can set the number of minutes after 5:00 AM for my Morning Routine to run:

I probably should have used a better Global Variable name than "Time", such as "Minutes after 5AM to start".

1 Like

Thanks bravenel... I will study this...

There is another way to do this that would use the actual time to start in a GV connector, such as 6:15.

This could be done with the new Token string variable tool. Here is the rule:

And here is the Dashboard Tile where I can put the start time in, using the format HH:MM (in 24 hour format if afternoon).

1 Like

There may now be better ways of doing this as Bruce described above but my solution to this was as follows:

I have 2 virtual dimmers for Alarm time hour and Alarm time minute. I have them displayed on a dashboard as attributes showing level. I have a virtual button device with buttons set up to increase and decrease the hour by 1, and the minute by 5. I also have one that resets both hour and minute to our standard alarm time of 8:30 with a single button press (Don't judge us - we are both retired!) These buttons are arranged as shown on the dashboard. I have also added rules to stop the minutes going over 59 or the hour over 23

Dashboard display:


To get the time comparison I have created 2 Global Variables, GVcurrentMinute and GVcurrentHour. These are updated by a simple rule that runs every minute:

To actually trigger the alarm I compare the minutes and within the rule check if it is he correct hour as follows:

It may not be elegant, but it has worked flawlessly for months now.

I have recently added a physical Remotec 8 button remote to the alarm system with each button programmed to set the alarm to various times from 7.00 am onwards in 15 minute intervals so that we can quickly set it without even accessing the dashboard. It gives a TTS to announce the new alarm time so we know it has been adjusted.

Ahh you just made my pool pump rule much simpler...I can nix a bunch of these conditions. Thanks!

I attempting to use the above rule to start the morning...

I keep getting an error, and the rule does not work.
What have I done wrong? Must be something.


It changes the variables to what has been set on the dashboard.
It just doesnot seem to Delay, then run the actions after the delay. I have removed all but the core element (example) and it still throws the error.
Help!, this seems such a huge leap forward and I wish to use it.

What is the Start Morning set to in the Dashboard? It looks like it's set to 0:1

Show the Global Variables, and the Local Variables. Hard to tell what you're doing.

IMG_20191005_192733_022 IMG_20191005_192643_402

I wrote it last night, added "turn coffee pot on".(Start Morning=04:15)
It did not. I have been chasing my tail, and loving it, on and off durning the day.
Start Morning has been set from 00:02 to 04:15 and many in between.
After a while of setting the trigger to "a coule of min in the future" I have just been hitting "run actions".

And you cought me in between with the time descrepancy. Different runs on the rule and different settings on the dashboard. I would mention that the rule keeps reverting (when accessed from the apps menu) back to an older version, update rule restores the visual UI to the current version. Sorry it this is confusing. The local variables always follow the dashboard entry. Without fail.

Taking the variable out of the delay, just using 30 seconds elimenated the error.
and allowed the rule to complete.
Adding a system variable "STS" and equating it to "Start Time Seconds" then using %STS% in the delay has stepped thru (Run Actions) many times now and worked.
%Start Time Seconds% is to long for the input field????
Best guess I can offer.

This requires that a rule run every minute to check if the time has been reached. Bruce's rule above doesn't add that unnecessary overhead to the hub. This is a lot of unnecessary work.

Would this scheduled event be saved if the hub rebooted between midnight and the time that is set or would it be lost?

That's true, but I haven't seen any slowing of my hub and it's been running like that for months. My hub is as snappy as it's ever been.

I'm very happy with how my solution works and it has the benefit that within a minute of a hub reboot/crash/update it's back on track. Also mine can adjust the target time at any point before it has fired and it will take effect.