UI for RM

It's painfully slow to build rules with the current UI. Creating a rule with only a few lines takes like 30+ clicks. I'd prefer something where I could type and it would do autocomplete, but I get that many wouldn't like that.

As an alternative, could we get something like this? I think it's fairly easy to predefine your code for the blocks in the scratch backend, so it probably wouldn't be terrible to implement:

image

2 Likes

This style may work for simple events, conditions, and actions, but when start getting complexity that type of system breaks down quickly. Yes there are some limits to the UI in Hubitat because of what a browsers can do without complex frameworks and server side interactions.

Just filling a drop down can take many turns with a web server to handle the event, Believe me I have see responsive web sites and PWA's swamp a web server due to massive UI implementations. The web server in the Hubitat with it's limited CPU/Memory would be overloaded quickly.

You mean something like webcore? :rofl: :grin:

webcore samples

1 Like

I doubt that. I have NodeRed running on a Pi Zero W doing a ton of stuff, and the web UI builder which is heavily graphics based works flawlessly. I don't know the specs of the HE, but I'm guessing that it has to be more powerful than a $5 Pi Zero. And I'm pretty sure scratch and other graphical builders do most of their work in browser-side javascript.

Funny. That is one of the core reasons I've been doing as much non-time-sensitive logic as I can in Node-Red (and push/pull data via MakerAPI) versus Hubitat. Well, that, and it is more portable if I swap back to HA or OpenHAB.

I still do core/simple logic in RM though, and it is working well. If it isn't very simple, and not a candidate for Node-Red, I write a groovy app as it is much faster than RM by the time you include troubleshooting and changes.

But the OP is right, a rule with just a couple of IF/THEN is death by clicks. I would give $50 to just have a supported text editor for RM rules... But I admit that I loved webcore, too. :smile:

I love what RM does, and it is a great built in rule machine!!! It has been very reliable for me. I just wish it were faster to enter the rules/make changes.

3 Likes

I know others were joking and despite the improvements I'm still not sure I'd run it on my "main" hub with it being not just unofficial code but quite a lot of it at that, but...webCoRE sounds almost like what you are looking for. :slight_smile: (Staff have specifically warned against this app in the past, though a new developer has taken over the go-to fork and people seem to like it.)

However, if you'd be willing to settle for "something where I could type and it would do autocomplete" minus the "autocomplete" part, you might just consider writing a custom Groovy app. There's a bit of overhead to this since you also have to define the UI, but it's as powerful as you want it to be and definitely less clicking (I won't make claims about less typing...).

That being said, I do think the Hubitat UI is a bit constrained--not entirely their fault, since they didn't really implement this app model. They have mentioned that they are open to redesigning how this works in the future, though their initial targets would be making the more common "regular" apps better rather than Rule Machine (anyone who gets that far should already know what they're doing, I suppose). But there's hope... :slight_smile:

If using a groovy app as a webcore equivalent, I typically make basically no UI for it. So I have a template with the common things you always have to have in a groovy app, then add devices and go straight to the code.

So the UI doesn't HAVE to be much of a barrier, depending on how flexible/reusable you want that app to be.

In Domoticz you have the choice of Lua, Blocky (similar to Pictoblox) or DZvents . For me these are easier to use than RM, especially Lua.
I have used WebCore quite a bit (a lot actually) on ST and know my way around it.
But since HE advised against it I have only used RM since I got the hub. I have around 35, some simple, some quite complex.
Although I find it quite cumbersome to use I managed to do all the things I want or need. Since theyā€™re running I havenā€™t touched many of them, so in my case theyā€™re just a one time deal.

I havenā€™t looked at groovy much, (other than changing drivers in ST for my own need in WebCore) but am planning to.

I agree, building rules takes way too much time for the few items involved. As for autocomplete, in some cases that would be fine, but in other cases, you sometimes don't know what you are looking for so a menu is more appropriate. I don't know what would be best here.

This is one of my issues with RM, all the clicking in/out of menus. You can't see what you have done, or where you are while editing. Maybe it is my unfamiliarity with RM, but I purposely go back and start the "main menu" after adding or editing every action because I don't know where I am at with things. That adds even more clicks on top of the (in my opinion) already excessive clicks.

Webcore is pretty ugly in my opinion. I like that the rule (apparently) is exposed while writing it, but that is where the goodness ends. I never used it, so maybe I am wrong here?

I miss Stringify, it was a very good way to build and see rules. It had some issues with editing (you couldn't just swap one thing for another for example) and you couldn't run it on a desktop, but it was a logical and visual way to build rules. You could see the relationship between things, and build some very complex rules.

1 Like

Is my experience unique or is is supposed to take 5-8 seconds (literally - timed seconds, not a quick count) between clicks when making a rule? Like I hit the slider/button to indicate that I want to enter a delay and 6 seconds later I am able to enter the number of minutes.
Making the rule starts out quicker, but after a maybe 10 or 12 lines is bogs down like I'm describing. Is this normal or is there another problem I should be looking for?

1 Like

I see the same thing.

Creating a simple action to do very simple variable math (delaysecs = delays 60) took almost as many clicks as it would have to type the same characters in an editor, but many times longer.

1 Like

This is the reason I moved my security lighting from RM to a custom app. It is currently about 300 lines of code. Not huge but unwieldy in RM.

Yeah, not sure I'd want to do 300 lines even if it moved fast!

Now that you mention it @5fe94872fdbd2dbd06a8, I do tend to use a lot of variables. Perhaps that is what is bogging things down. Rule Machine seems to want to check every little thing as it goes. Maybe with variables it has to go further outside of the app to make its confirmations and that's what's taking so long?

I did a quick test and built up a fairly lengthy rule (~50 lines) by randomly picking mundane things like switches and sensors plus a fair dose of conditional statements. It definitely slowed as it got longer but not nearly to the degree of when I was making a rule with global variables. Then I inadvertently tossed in a if-statement that looked to see if another rule was paused. That slowed it down more that 20 plain-Jane lines. The distance-reference thing feels like it has something to do with the response time.

Why does it need to check everything every time? In the variable-heavy rule I recently built it literally took 38 seconds to add an END-IF line. Does it really need to check the existence or whatever of every variable in the rule just to add an END-IF?

Iā€™m doing conditionals including switch statements with global variables and override switches. I wouldnā€™t want to try something like that in RM.

1 Like

No, this is not normal. The UI is ordinarily fairly snappy for creating rules. Send me a PM and perhaps we can figure out a way to investigate this,.

Are you seeing delays, or just addressing the number of clicks it takes? Show an example in context so I can reproduce it.

I am seeing delays of 3-8 seconds per click. It is extremely frustrating to use the only available interface.

I will try to create a video, unless you have some other diagnostic tool that would demonstrate the problem.

I'm sure he believes you, so I don't think a video adds much to the discussion.

I believe he is more interested in exact steps you took on a given RM rule so he can try to reproduce it on his side. If he can't reproduce it and make his system slow like yours, it will be awfully difficult to fix the issue.

1 Like

That's fine. As I said above, this is not the behavior that I expect or see myself with the UI. So it would be worthwhile to try to find out why you are experiencing this. Is anything pounding on your hub? If you open a tab for Logs, and leave it on All, is it getting hammered?

This is not new behavior on my hub or unique to this rule; it is almost constant, to the point where I'm reluctant to create or edit rules.

What metric do you use to measure "hammered"?

I deal with HPC clusters at $WORK, where an aggregate of several million log entries/day wouldn't be any surprise, so I need a frame of reference before I can give you a meaningful answer.

[RANT ON]
Of course, if it was easy to download the raw log files from the Hub, or have them sent to a syslog server, etc, then I could report data such as log entries/minute and change-over-time.
[/RANT ON]

Make a video of you logs on All.