Execute rule from a rule?

Can you execute a rule from a rule? The only thing I’ve figured out is to create a virtual switch that triggers a rule which is triggered from the first rule. Feels like it should be easier but I don’t see an option to to execute a rule from a rule action.

Hi @Jason_Dossett, executing a rule from a rule is in my list, and not currently supported. Thanks for your feedback as the user interests received is a great key determining our task priories. :blush:

2 Likes

In the meantime, you could create a virtual momentary switch and use that as an action in one rule and a trigger in another.

Out of curiosity, what’s your desired use-case for a rule running another rule?

1 Like

Great, thanks. After doing it using a virtual switch, I kind of like it because it gives me a persistent device state that represents something having happened in my system.

My use case is basically creating reusable rule ‘functions’. I have a set of things I always do to start up our theater (turn on projector, turn on receiver, etc.), and have several user tiles that always do that plus one other thing. Watch Netflix does all the the theater startup plus tunes the Tivo to Netflix, Watch TV does all the theater startup plus tunes the Tivo to Tivo Central. This way I don’t have to copy the theater startup in every rule and if it changes, I don’t have to change a bunch of other rules.

The system variables you’ve talked about adding would also address this use case if a tile will be able to pass variables as part of a call to a rule.

4 Likes

Hey @Jason_Dossett just an update that I moved this topic into our new Feature Requests category. If you’re still interested in this request, can you please scroll up to the first post and ‘vote’ for the feature?

Bump!

I have a set of conditionals I use to make sure all of the locks in my house trigger. It would be nice if I didn’t have to recreate it each time I would like to implement it.

I built a rule that checks all the doors in the house, if they are locked it sends a message out to a speaker that says “All doors locked.” if one of them isn’t it says “Something is wrong check doors.” it would be very cool to be able to say that if the “Something is wrong” is triggered then keep running the rule until the all clear is sounded.

1 Like

I’m by far a genius with this, but since I’m here… :smiley:

I’m guessing you’re using a rule tile to trigger the rule. Instead you can use a virtual momentary switch.

You could then make a variable for when all locks are locked.

Your rule would then be triggered by the virtual switch, if the variable is true “all locks are locked”, else “Something is wrong check doors”, delay X amount of time, activate virtual switch.

I have something like this to refresh my garage doors, since they don’t update by themself. Instead of the text, it refreshes the doors every 5 minutes, except at night it takes longer.

PS: you don’t even really need the variable. You can also make it part of the if part…

2 Likes

Hi @Andrew_Smith, I moved your “trigger rule from rule” post to this existing feature request, and please cast your at top of the thread.

image

Meanwhile, there are a couple ways to trigger another rule within a rule. As @Sgt.Flippy_PJ, mentioned, you can use the variables. And the other way is to use the HTTP Trigger and HTTP Action directly

Add a HTTP Trigger to the rule you wished to be triggered by another rule.

Then you can trigger it by using the HTTP action in other rule(s).

1 Like

Thankyou very much for the help, I will try that today.

1 Like