Start by creating a global hub datetime variable called Now.
Then a create a rule called "setnow" with a periodic trigger of one minute. Inside setnow, you will update your global hub variable Now with the current date and time.
Once you have the global variable "Now" always set to the current datetime, you can use
it for comparisons in conditionals.
In a rule:
You can set a time variable (local or global) to "current date and time" -plus- an offset in the future.
This way you can create conditions which state: do not fire until timeVariable is less than Now.
So you set a variable to a time in the future, and when Now becomes greater, your condition is met.
Nifty.
Edit, you should call the variable mynow or something to avoid any interaction with the system variable %now%
3 Likes
Not to burst your bubble, but you don't need to "create" a %now% variable or the associated rules to set it as it is all native. The %now% variable is a native, built-in variable, just like %date% and %time% are.
If you need a similar variable for a different purpose than the built-in %now% variable, I would recommend naming your own variable something other than %now% to avoid possibly interfering with the built-in variable by using the exact same name.
I dont see a way to use that in a variable comparison in a rule. There is a dropdown provided with existing variables and no way to type an arbitrary one.
I did not try to create a local variable named %now%. I doubt that would work.
You might be right about the naming collision.. Something to watch for.
It would be very convenient to have the %variables% available for use in the dropdowns.
4 Likes