Rule Machine(s) versus Custom App

I have made most of my automations using custom apps. This kinda stemmed from days of yore when RM, etc. wern't quite robust enough.

I'm moving to a new house and most of my stuff will have to be changed as nothing seems to match the old house.

Performance wise is it still better to use custom apps or has the RM kinda on par now with all the updates?

Just kinda wondering.

It depends what you mean by robust and performance.

In general, rule machine can probably be used to create almost any automation a dedicated groovy app can do. Thatā€™s always been true.

But a dedicated app will run more efficiently for performing its specific automation task than rule machine could. That will also presumably never change, because rule machine is a more complex app.

Can that difference have implications for hub performance when many apps and devices are in use? Itā€™s probably something that can be measured, yes.

But will it result in a difference that humans in the house will notice while automations are running?

Thatā€™s a harder question to answer because itā€™s likely to be very specific to a number of other, individual factors that are hard to generalize when discussing here.

Rule machine does exactly what I need it to, if other built-in apps arenā€™t up to a specific task. And I have no issues with how my hub performs. But writing my own groovy apps is not an option. I donā€™t know how to code anything.

6 Likes

A lot of the reason I wrote my own apps way back when was RM didn't have all the options it has now and I just couldn't make it work for some of the things I wanted to do. And it was a good learning experience for me to learn Groovy, and boy was it an experience. But it was enjoyable. But not sure it is that enjoyable anymore.

System here is going down first of next week and it will probably be 2 to 3 weeks before I have time to start working on the new house. My wife seems to think there are more important tasks, such as unpacking. Go figure.

So I'll probably play it by ear and see what comes out.

3 Likes

Itā€™s always had a lot of options :wink:.

What specifically did you need in a custom app that it couldnā€™t do at the time?

Maybe that can help clarify if the effort of re-writing your apps is even necessary.

Yes it has, but very early on there were some things that was very hard to do in RM. Keep in mind this was the very early versions of RM. Trying to think of specifics now is hard, but when I first put together my bed time routine it took 4 different rules to make it work. It wouldn't now due to all the options it didn't have back then. And having multiple rules to create just made it confusing and thus my writing my own app.

1 Like

Most common performance penalty when using Rule Machine comes from the complexity of the logic used to create the rule. Obviously, a more complex rule, has a higher impact on its performance. Streamlining the logic gives you better performing rule.

The advantage of using Rule Machine over custom code is that Rule Machine continuously improves based on feedback received from thousands of users.

6 Likes

If you think you can accomplish what you need in a rule machine rule now rather than re-writing all your own apps, I think youā€™re on the right track with your plan to try things out with RM first.

1 Like

For whatever one more thought is worth . . .

While "custom" may have a theoretical advantage in performance if you can code more efficiently, in most cases, unless you have something extremely complex, you may be talking tens of milliseconds. I say this based on review of my own Hubitat logs which make it quite apparent that a very small percentage of processing power is ever used, and even for complex drivers, their logs show that response times are generally in tens of milliseconds. I.e., despite its small size Hubitat has so much excess processing power for the tasks at hand that, in 99.999% of cases [yeah, 99 % of statistics here are just made up], the theoretical efficiency that you may gain is more than offset by added complexity. Also, the Hubitat staff has access to routines and functions that the "community" developed apps don't - so even if you code efficiently, you might not match what they can do both in terms of function and performance.

So, as a suggestion, go the "easy" route of using built-in apps, then check the performance logs and revisit if you need to consider custom.

2 Likes

Mostly I have stopped using my own apps as RM has got better, but there is one app I still don't think I could do happily in RM. It runs daily to let us know if there is likely to be a window condensation problem coming up (old house, metal windows in front). It takes in information from local weather reports, and our own external temperature sensors and indoor humidity sensors, does some complicated formulae, and tells us which rooms will need their dehumidifiers running overnight.

5 Likes

I can't write custom apps from scratch but I can usually modify existing ones if it is close to what I want. Sometimes, I modify the functionality but often I just comment out unused or confusing parts of the UI so that it is a streamlined just-fill-in-the-blanks. Makes it easy to maintain or modify parameters.

1 Like

I my case I am always have to balance between rule complexity and maintainability.
Yes, in many cases set of simpler rules is easier to create. But when it comes to maintainability it is better to have just one rule. What is missing - is an ability to
organize the related rules in some sort of folders or so. Currently I am using relatively
complex prefixing. But this way names are getting to...o long.

3 Likes

Over the years I built a naming convention that helps me tremendously to quickly locate and identify a rule and what app it belongs, especially in the logs.

E.G: App Initial - Room, Type of sensor, action, cancel time, mode

So for a Rule Machine Rule, I might have something like:

RM - Living, motion, dim, 5 min, night.

1 Like

I am EE and for the naming signals I am using very informative naming
convention. Just by looking on the name usually I can tell everything what
this signal does. Of course, I am using the same approach for naming rules.
Yes, this works very well but as I already mentioned names are getting to...o
long. Unfortunately this is unavoidable.

1 Like

I prefer custom apps over RM for all but the most trivial stuff. It's not so much the performance issues, but custom apps are just so much quicker and easier to edit than the labyrinth of menus required to add things to RM.

I salute your approach -- a person after my own heart! RM came about because you're like 1 in 100, or even 1 in 1000.

3 Likes

There should be an article/blog/post for recommendations on how to efficiently write rules.. that is - don't write this, write that.

3 Likes

I can't speak to performance difference of custom apps vs rule machine but I like to have dedicated apps for similar rules/automations in order to keep everything organized. For example, Advanced Button Controller for my buttons and Motion and Mode Lighting for my motion activated lights. It makes it a lot easier to find and edit specific automations rather than going through an exhaustive list in RM.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.