New To Hubitat & Rule Machine 4.0


#1

Hello All,

I am very glad to be part of this community and have been home automator for 10 years with over 200 devices on Smartthings. I am transitioning everything over to Hubitat now and had a few general question regarding my initial Rule Machine 4.0 scripts.

  1. When is an "END-IF" necessary?
  2. Can common conditions be referenced once instead of during each "ELSE-IF"?
  3. When turning-on a dimmer to a specific level, is there a single Action to achieve this?
  4. How can I insert a delay (ex. Motion sensor inactive for 5 minutes)?

Thank You
Matt


#2

You should always close out your IF THEN statements with the END IF.

You can get away with it in RM, but it's sloppy and can lead to problems later.

The END IF tells RM that it's no longer executing the IF THEN statement, allowing you to add additional steps after the IF THEN. You can also nest IF THEN's inside one another, but in that case you must close with an END IF or they will run together and break your rule.


#3

Thank you, so the triggers will re-start the script if any are detected correct?


#4

Yes. You have to think through the possibility of two instances running at the same time, as this won't generally work if there are nested IF-THENs, and would only arise when there are Delays or Waits.