A few question about RM?

Hi All,
I new to RM

  1. I try to understand global vs local
    if I have a variable called CurrentTime can I set it with?

  2. is there a better to keep a variable like CurrentTime up to date other than run a rule every minute?

  3. is there a list of all system variables?

Thanks Beau

You just did. The better question is “why?” What are you trying to accomplish?

Again, the answer depends on what you are trying to do with it.

See, for example, my rule to call another rule if a contact sensor detects that the Litter Drawer has been open for 30 seconds on the Litter Robot, which needs to measure elapsed time in seconds.

If you are trying to get the current time to display a clock on a Dashboard, remember that the Dashboard only refreshes every so often. There are examples of clock displays in the forum. Just search.

RM will show you the available choices in a drop down.

  1. Depends on the scope of where you want to use it.
  2. Since a system variable is available, you may not need to put it into a variable at all. However, as the example just above this illustrates, an exception is when you need to do time math with it. There is probably nothing wrong with making it a global variable and have the rule as you show, but why not just set a local variable "just in time" (pun intended). That is, set a local variable to current time then do the math.
  1. Good question. Following.
1 Like

@672southmain here is a rule I been working on to see how the sump pump runs and the time between runs

1 Like

Looks good. Do you have a problem with retriggering if the pump switch bounces on and off?

Hi, @672southmain
in some tests, I have seen a problem of if the pump switch bounces on and off
I am not sure how to fix it?