I am back

I have used the Hubitat system for almost 3 years. When the Zwave problems started, I had several big projects starting around my house, my system was running well, I had no Zwave devices, so I decided to stop doing updates.
Things have settled down now - Boy do I have a lot of catching up to do.

I am very interested in the "new" Rule Machine API, but I am afraid that some of the setup is on the very outer limits of my programing experience. If someone (with nothing else better to do) could code the the example shown in Components of an Automation found in Rule Machine - Hubitat Documentation . Helpful comments on the code and where files can be found or stored will be greatly appreciated.

So much can be done out side of RM by using things like simple automations, motion and lighting app, etc..

1 Like

For the sake of clarification, are you trying to use Rule Machine, like writing a rule? If so, you want the docs for Rule 5.x: Rule-5.0 - Hubitat Documentation (this will soon be updated for Rule 5.1, but it's not that different from 5.0).

If you're writing a custom Groovy app and want to use the Rule Machine API, then you're in the right place. That example code snippet for getting the list of rules will work more or less verbatim, but you'd need each line in a different spot:

  • def rules = ... at some point before you display the options; you can use rules as the options: for an input() with type: enum (with or without multiple: true, though you probably want that) -- so the first two lines in this example will work verbatim in an app page()
  • the RMUtils.sendAction() call at some point when you actually want to run the rule actions from the above-selected rule, say, in a handler method for some event your app subscribes to

What you also need to know is that the above will only do Rule Machine Legacy by default (this hasn't made it into the docs you found above yet). You can specify "new"/5.x Rule Machine like this:

1 Like