[Initial Release] Rule Machine Manager (New Rule Machine Interface)

Yep.. I've landed on that page hundreds of times in my research.
Unfortunately, those are all actions.
Yes, I can manually pause/resume a rule... but there is no way for me to GET its state.

I keep coming back to MakerAPI.
I just really don't like the idea of a dependency and its associated overhead.

Perhaps I can setup the framework; create a beta branch; and let you guys test.
I'm curious, @rgr, are you already using MakerAPI?

Thanks to the awesome suggestion by @hubitrep to use the @thebearmay 's code example; I was able to implement a working solution.

While it's not my favorite idea; it does only make one call to an http endpoint. I'm able to scrape the data I need; and build an array used for comparisons.

I have tested with both new and existing implementations; and it seems ready for user testing. Let me know how it works for you.

Btw, it's version 1.1.6.

4 Likes

Great! I just tested this app and it works just as expected.

I just have a suggestion;

To know if an app is paused or not is actually very important, so I suggest to use maybe a Bold style on that “paused” word, to make it very visible.

To avoid issues with hub security, calls like this

            httpGet([ uri: "http://${location.hub.localIP}:8080/hub2/appsList" ]) { resp ->

need to be changed to this

            httpGet([ uri: "http://127.0.0.1:8080/hub2/appsList" ]) { resp ->

My understanding is that calls received on the loopback interface (on port 8080) don't require authentication (for fairly obvious reasons I think).

I started seeing paused and disabled rules after making this change.

1 Like

That is correct, any endpoints called from apps should use 127.0.0.1:8080

FWIW @joshlobe I was going to share the same requests.

Some other random ramblings for your consideration:

  • "Copy rule" for a moment I thought I could create backups of my rules but then realized it only creates an alias so I can have the same rule in multiple containers. So maybe "create rule alias" ?
  • Similarly, "Delete rule" appears for aliases, which was kind of scary, so... "Delete rule alias" ?
1 Like

One last thing and then I'll stop spamming you, promise:

  • Consider adding a filter for each container (a global filter would also be handy) - would have been very useful for sifting through and categorizing my 120+ rules

Not at all. I appreciate the feedback!
I'll start working on those changes :slight_smile:

3 Likes

Version 2.0 of Rule Machine Manager has just been released!

In this version; we are completely using the http get request, instead of the integrated rule manager function; to populate the initial rules and use for comparisons.

Version 2.0 Features

  • New API for listing rules and their paused/disabled states.
  • New color theme for the settings page.
  • Multi-select has been added, allowing selection of more than one rule before moving.
  • New confirmation dialogs added to aide in understanding intended functionality.
  • The "Move" and "Collapse/Expand" buttons have been moved to the container header area, and outside from the container dropdown list.
  • Added container filters and a global filter, allowing rules to be filtered based on text matches. There is a global option to hide these filters, if desired.
  • Added a welcome/help message.

I am currently exploring the oauth feature; and how to use oauth to make requests to the individual rules using the rule maching api. This would allow me to create additional buttons for each rule; such as "Pause Rule", "Resume Rule", and "Run Rule Actions",

Before I commit too much time to the oauth stuff; I'm curious if anyone would find this additional functionality useful??

5 Likes

Great update! Huge usability bump.

  • I couldn't get multi-select (ctrl-click) to work on macos Sequoia 15.2 (Chrome 132.0.6834.110)
  • the filter boxes should probably be shaded to indicate they are active
  • the rule count could reflect the active filter (so one doesn't have to go and expand every container to find globally-filtered rules)

Sounds good although I don't honestly know how much I would personally use these. I think a link to the rule's live logs and app status would be good.

Ahh... I didn't think about macs. That should be a quick fix.

Do you mean when you have input something in a filter box; that box should be highlighted?

Of course the rule counts should update; how did I miss that one?!

Love it!

When I edit a rule in RM, on the top right of the page, there are 4 icons. The cog wheel is the rule status page. The document icon is to the rule logs page. But when I click this icon; it takes me to the logs page with no logs. Where exactly are the logs for a rule?

There aren’t any unless you’ve enabled them in the rule. Another thing I’d like to enable from outside the rule if I could…

Yeah it’s easy to miss otherwise.. lots of support topics on this forum regarding the device and app filters before they got shaded when in use…

Thank you very much.
I understand now. (I didn't know about logging rules, thanks for that)
I'll incorporate these best I can into the next release.
I appreciate your feedback.

1 Like

Terrific update, thank you!

One minor request: An "Accept" or "Update" button that does the same thing as "Done" but does not close the page.

2 Likes

Version 2.1 (2025-01-30)

  • New mobile friendly layout.
  • Mobile design complete rework. App is much cleaner on mobile devices now.
  • Added multiple select support for Mac systems.
  • Container color now completely covers container and rules.
  • Title Color has been replaced with Font Color. This is the font color used throughout the container.
  • Edit Container is new, and will open an overlay where the container options can be selected (colors, bold, container title).
  • Added Hide Counts and Hide Filters buttons to the top of the page.
  • Added two new rule actions; View Rule Logs and View Rule Status. These are quicklinks to the corresponding rule pages.
  • Added a new Quick Save feature. This features requires oAuth on the app. Clicking the Quick Save button will open a walkthrough on how to enable oAuth.
  • New overlay for Create Container button.
  • Added filter highlights. When typing in a filter, it will change color to indicate it is active.
  • When moving rules between containers; the rules will "inherit" the styles of the container where they are placed.
4 Likes

I just installed and am having the problem another user referenced about nothing working. The buttons are not clickable to create container or anything else. I am running on Edge.


image

Hello there. I apologize for the inconvenience.
So, your image looks correct. Those are the two files; and the sizes are correct.
The second image also looks correct.

Let's try from a different browser first; just to check.
Next, let's turn on the debug log; load the rule machine manager page again; and let's see what the logs look like.

Hey Josh, thanks for the quick reply. I always use Edge so I had to download Chrome. As I was bringing it up in Chrome I realized the problem. I bring up my Hubitat interface by typing in the public hostname hubitat.mydomain.com which is a tunnel hosted in Cloudflare. I have just gotten used to doing this so I don't have to remember the IP address. This did not work on Chrome either so I tried 192.168.xxx.xxx and this worked on Chrome and on Edge. Now I see in known bugs you have "App does not load correctly when using remote admin." I assume this is the same type thing so please excuse me for raising this as an issue before catching this myself.

Thank you for the valuable feedback.
Yep.. it looks like I need to setup remote admin on my other hub and test.
I'll add this to my next dev cycle.

1 Like

Version 2.1.1 (2025-01-30)

  • Fixed app loading resources while using remote admin.
3 Likes