I am back

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