Variables?

That is the key question. There has to be a problem to solve before the tool matters. Here are a few examples from my own system. Sometimes they are absolutely needed (i.e. storing the value of a calculation), but often they just make the logic easier.

Hub Variable
I created a variable to store my next alarm time. The information is sent from my phone and stored within Hubitat. I can then access that information to make rules or to display on a dashboard.

When the alarm time changes, the variable updates. Each rule that uses the alarm time will now have access to this updated information.

Local Variables
I happen to use webCoRE for automations, but I am sure that other tools work similarly.

One of my most common automations is turning on a light when motion is sensed, dimming after a period of no motion, and then finally turning off. It was tedious to keep creating similar rules over and over. By defining variables, I could just duplicate a rule (piston in webCoRE) and only tweak a few variables.

I also created a boolean variable that tracks whether the light was turned on due to motion. It stores that information until the light turns off and resets the variable. I want the light to behave differently based on how it was turned on. If motion is sensed at 3am, then a dim light is preferred. If I turn the light on manually, then it is probably something urgent (pet yacking) and I want full brightness. Again, it all comes down to what problem is being solved.

image