Set a variable time in Dashboard

I am trying to use the dashboard to set a variable to a certain amount of minutes that my snowmelt will use if I trigger it. This is to adjust to amount of snow etc.

Pseudo code would be "if (snowmelt on) then (snowmelt off) in %variable% minutes"

with %variable% set in the dashboard


Is this what you are looking for?

Connect Global Variables to Dashboards - :triangular_ruler: Rule Machine® / All things Rule Machine - Hubitat

That post is old--for one, it's referring to global variables (the Rule 4.x feature) and not hub variables (a new hub-wide feature that also happens to be available in Rule 5.x). It also predates the ability of apps to directly use hub variables rather than relying on connector devices (which were the only way to get these out of RM when they were global variables but retained a similar use early on with hub variables before the hub variable API for user apps existed).

So, history lesson aside, probably not. :smiley:

What it sounds like the OP really needs is a plain number variable, which can be viewed and modified directly on a Dashboard tile using the variable rather than device tile type (no connector needed). Then, in the actual rule, you could use the variable as the time for the delay (that's an option when creating that action).

One thing that's missing from the original description is what would "trigger" this--the variable changing would be a poor choice (what if you want it the same number of minutes as before? no change, no trigger). Maybe a virtual button or virtual switch, which could also be set from the Dashboard? Or perhaps you already had something in mind. This would affect how you'd write the rule, but in general, your actions might look something like:

Cancel Delayed Actions
On: Snowmelt
Delay *Your Variable* minutes (cancelable)
Off: Snowmelt