How to make a set of actions reusable?

tnx, but if i may ask, why dont u use Rule Machine anymore?

I started using it because its visual and makes more sense to me. I have kept using it for multiple reasons:

  • I have multiple hubs with Zigbee devices on one, Zwave devices on another, and all Wifi/community integrations on a third. Node Red allows me to use devices in automations from all without relying on HubConnect or the new Hub Mesh.
  • There are ways to control devices not natively supported on HE
  • Easy to duplicate or share rules. This was especially helpful when creating flows for my Pico remotes. After making the 1st, it was easy to copy and tweak for the rest of my Picos.
  • Not reliant on any one system or hub if I decide to move to another in the future.
  • Removes some load from hubs

There is a great thread going but it is over 4k posts and is a lot of information to take in:

1 Like

I would add..

So i created Rule in RM w/o trigger .. but now on my button how can i trigger this Rule? I dont see an option for it in the Button Actions....

@tj1 To tie Node Red into what you are doing, you could create a sub flow with those 4 actions. Then create other trigger flows and that sub-flow is a single node and can be used all over. When your make change to sub-flow, it applies to all cases throughout Node Red.

tnx for introducing me to node red. I will definitely try this for my home build.

But for professional deployments such as this one (i install Smart Home stuffs for customers) i cannot use node red as it complicates things further. More moving parts = more things that could break or need maintenance and support (in a production environment) so i'm always looking for the simplest route more stable and less experimental route ... I dont mind spending hours tinkering and troubleshooting on my automation at home but i'd hate to have to do that to over 30 clients lol

So for this one, I wanna execute most my client's need with just Hubitat + 99% z-wave devices ...just to share. (unless i got Node Red wrong and it's being used in production/mission critical environments already.

1 Like

Is your hub running the most recent version of the hub firmware?

The options you have in that screenshot don’t quite match up with what I see when I open rule machine. The rule machine UI gets tweaked periodically as new versions of the platform are released.

However, “run rule actions” isn’t new, and so I think it should be in there somewhere. Can you check if it’s hiding in the “run custom actions, polling” sub-menu?

I agree; I definitely wouldn't use Node Red if I was installing professionally for clients.

Here is one more thread to help you get started for your home experimentation:

I have to respectfully disagree @tj1 and @stephen_nutt! :smiley:

I am installing HE, Node-RED (and Homebridge) for my residential clients and it has been a fantastic experience. My oldest install is almost a year old. I have 3 in the wild currently and a 4th due to go online sometime soon. I also "sell" support services - remote maintenance is very easy. I cannot recommend it enough if doing residential home automation installation/consulting.

The trick is to have a robust baseline installation - proper equipment selection (server, power backup, switch, standard set of smart device choices etc), installation plan, software selection, standard set of nodes/custom subflows/sequences etc.

Now Home Assistant on the other hand - wouldn't let that near a client if I could help it. Still too complex for my tastes - although I guess I could see how someone could do it with a very locked down minimal configuration. I just don't have that kind of time. It is fun to tinker with though so maybe some future iteration will revisit.

3 Likes

hi mark
i've actually just updated earlier today. i've got this, the latest i believe
image

and about my earlier screenshot that's actually from other actions menu
Apps -> Button Controllers
Apps -> Basic Rules

I'm trying to link button action to trigger/run my Rule Machine profile.

Ah, that’s probably it.

Rule machine has a button device trigger, much like the separate button controller and basic rule apps.

It has more options for actions though, basically everything that’s otherwise available in rule machine.

But I think you’d need to use a rule to call other rule actions.

Button controller and basic rules probably can’t.

oh bummer .. i wonder why a button trigger can't just trigger a rule to run, doesn't make sense not to have it in there.. perhaps the devs missed this and we'll get it in future updates.

For now, how do you propose I, ultimately, run my RM Rules from a button action? Global variable stuff?

You are looking in the action section - you will find the button controller as an option in the trigger section of the rule.

You can add multiple triggers to the same rule (Button press, motion, etc...)

1 Like

Ah yes, tnx but that's pretty much the standard way really.

Once again I'm trying to create a set of actions that can be triggered by buttons and different events (triggers external of the rule)

Thus I created an RM Rule (no triggers) that does the actions i need.
Now i just need to trigger / run it from buttons and whatever ......

Basically, I need to run the RM rule from the one or more of my buttons and other triggers that are not part of the RM rule's configurations.

....I looked inside Button Controllers and BASIC Rules section and they both don't seem to have any option to RUN an RM RULE

I simply want to RUN an RM RULE (my set of actions) from button actions without encoding that as a trigger inside the same RM RULE

The only way i seem to be able to do this is creating yet another RM RULE just for the button push, to run another RM RULE.. which feels weird.. but if that's how it should be then im cool with it
:smiley:

It is possible to setup a rule to trigger another one. Is this what you are looking to do?

That First rule (Test Rule 1 in the example above) can be triggered by whatever you want (button press, motion, etc.)

1 Like

Nope i pretty much got that already at first go. :slight_smile:

What lead me to this rabbit hole is I was setting up my Buttons via the
App-> Button Controller

and in there the actions did not have options to trigger/run a RM Rule

I think that HUBITAT devs forgot this option in the button controller configuration :stuck_out_tongue:

Ah! I get it now...

An alternative is to use RM to control your buttons. You get the same look & feel of the Button Controller App with all the RM functionality when you pick “Button Device” when creating a new rule.

The Button controller app has almost all the same functionality. Tagging @bravenel in case this is something that could be added to the button controller app.

I don’t think they forgot.

There’s a history to button controller/rule machine existing as separate apps, then one app, now as separate apps again, etc.

The bottom line is, button controller is intended to have a somewhat leaner interface so that beginners are less likely to find it to be overwhelming to use (which rule machine certainly can be).

For anything you can’t do in button controller, you can still do in rule machine.

That’s not to say they never consider adding features to the simpler apps like button controller and basic rules though.

What I tend to do for this is create a virtual switch, then the rule is triggered when the switch turns on (or off).

Then you'd just set the button action to turn that switch on (works nicely with motion, contact sensors, dashboard buttons and voice activation as well)

1 Like

Button Controller does not integrate directly with Rule Machine, as explained above by @marktheknife. We are not going to add that feature to it for the reasons he states. The same UI lives inside of Rule also, using 'Button device' as the trigger. So this is how you get button controller functionality that does integrate with Rule Machine completely.

This is all a bit of a mess, I'll admit. The stand-alone version will remain as it is without RM integration, while the one within RM will have more advanced features.

3 Likes