Rule Machine: Is there a variable that stores the Rule Name?

I want to include the rule name in my notifications without needing to type the rule name again. Is there a way to do this?

I’m looking for something like %rulename% to put in my notification text.

Doesn't exist.

Adding this feature would penalize every rule that sends messages a little bit to avoid something that is static. That doesn't make sense to do. Those %something% things are there to put in something that varies, not something static. Copy/paste?

1 Like

Even shell scripts can access the name by accessing $0. How would this penalize every rule?
It seems like the name is already tracked somewhere so why can’t we access that information to be used where we want it?

I also believe you can see the rule name in logging if you enable debug, correct? So why is it so hard to make that same data available to a notification?

So let’s say I want to have a rule that sends a notification when another rule runs that tells me the name of the rule that executed and the time. That would be a perfect place to have the rule name in a variable because you won’t have to write each message out.

There is absolutely no way to do that? Seems like it may be a small thing to code.

It's trivial to code. That's not the issue. Do you understand the difference between 'compile time' and 'run time'? As a general principal, you don't do things at run time that can / should be done at compile time. In this case you're suggesting to incur a cost at run time to save a cost at rule creation time. How many times do you create a rule? How many times does it run? And, that run-time cost, while you'd be happy to pay it and is admittedly small, would tax every rule that uses strings in messages, custom commands, setting variables with strings, etc. of every user of RM.

We can agree to disagree about this. To me, it's not a reasonable request.

2 Likes

But you seem to think this is possible here:

Not only is it possible, it's already implemented. This is entirely different. The cost is born only by those rules that subscribe to another rule being paused/resumed. As another general principal of RM, triggers should leave breadcrumbs in %device% and %value% as possible for these types of uses. That was missing from this particular trigger. If I run across any other odd triggers that don't have these set, those will get updated also.

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