Rule machine - as per the app developer, this app is no longer available for new installs, distribution, or support

Based on the limited testing I have done tonight in 3 rooms, this is working fine. Thank you.

1 Like

I updated, but the girlfriend is home now so I won’t be able to test for a day or two probably. Unless there’s any way to trick the presence of a device?

There is a way, sort of. In the IDE you can create a Simulated Presence (a virtual presence device). Make one of those, and replace your girlfriend’s presence in the rule with one of those. Then you can test it both ways.

DO NOT, under any circumstances, mention to your girlfriend that you are replacing her with a virtual presence! :grinning:


Seems to be working! I won’t be able to test the actual setup until Tuesday probably, but it did work with the virtual presence sensor.

Thanks for the fast fix! I should have posted here sooner, I spent about 2 hours messing with it before posting because I was sure I was doing something wrong.

Since you don’t accept donations, all I can do is promise to do my best helping others with this SmartApp. Hopefully I’ll even find the time to familiarize myself with the code and fix issues like this myself. I’m still getting used to the IDE and all of its abilities and nuances.

1 Like

You do everyone a service when you report a bug. That particular bug has been around since day 1, if you can believe that. It was the infamous “off by one” type of mistake; took a rule like yours to surface it.


Today has been an interesting day for me with Rule Machine!

There was a bug shown yesterday about sub-rule definition, a missing right paren, that I got to today. That bug was in the core recursive code that builds the rule.

There was a bug shown today about sub-rule evaluation, an evaluation error. This bug was in the core recursive code that evaluates the rule.

And, of course, that’s the hardest code to work with, hard to think through. The second bug was simple once I found it, but that took considerable mental and debugging effort.

Wow! This shows two things:

  1. Even seemingly solid code can have unrevealed or unnoticed bugs.
  2. People are pushing RM further as they uncover the power of a logical expression in this context.

I wish we had a cool way for people to show off their rules, their automations that they come up with, for other people to see and copy / modify. To that end, I just started a topic where you can show off your automations using Rule Machine. Show us your cool ideas!!


Here here.

Amazing solution for sure.

I am also interested in how folks are ORGANIZING their rule machine automations. I have so many built now, that organization is starting to be a challenge. I am using names of course as there is not the ability to have groups in the UI, etc… but interested in how others might be tackling this - what naming systems work.

1 Like

So far I’ve been using a lot of simpler rules and triggers, so I use naming conventions with prefixes that correlate to the primary action/outcome. For instance, I use the following prefixes:

  • Set Mode To
  • Set Thermostat
  • Turn On
  • Turn Off
  • Warning For

As I (hopefully) get time to create more complex rules and outcomes I may have to refine my naming conventions, but so far this works well for me.

1 Like

I have a few similar rules that I “group” by how I named them. In other words, if I wanted all the things dealing with kitchen lights together, they all start with Kitchen, etc.

1 Like

I’m not sure if you want this discussion here or in the thread for Rule Examples, but…

I do a similar thing, but in order to put them in the order I want, I use an alphanumeric code (two letters for the room and two numbers for the particular rule) and abbreviations for the room name and rule name in order to keep the character length manageable.

e.g. my rule for turning on the night light in my guest room on the north side of the house (there is another on the south side) is named like this…

LL06_GstN_NitLit-On (i.e. this is the sixth rule for this room)

Then, since ‘Actions for FALSE’ doesn’t work in this context (because turning it off only requires one condition as opposed to all conditions for turning it on), I also had to build a rule to turn it back off…

LL07_GstN_NitLit-Off (i.e. this is the seventh rule for this room)

This way, I have a piece of code that lets me know which room this pertains to (GstN), as well as a way of organizing them in a particular order within the Rule Machine SmartApp.

p.s. If I need more than 26 room names, I can start using a combination of UPPERCASE and lowercase, and I’m sort of assuming I will not likely ever need more than 99 rules for any given room)

1 Like

Interesting, I like the logic. I this is what I was getting at, I need a method.

The room logic grouping may not be very meaningful for my setup specifically.

Away/Home/Night, Outside/Inside, are potentially more meaningful groupings for my setup. I need to think that through. If I could group, what would my groups be then build logic like you have here.

What does your LL06 / LL07 designate? That would obviously keep strict ordering but makes reordering difficult if you leave no spaces, potentially.

LL is the ordering designation (in Rule Machine only at this point, but will be used elsewhere if such a code becomes necessary anywhere else) for the guest room on the north side of the house (which is named GstN wherever else it ever gets used; it’s my universal naming convention throughout my home automation world…SmartThings/SmartTiles/Tasker/IFTTT/ETC).

The letter code really has nothing to do with the room. It is just there to enable me to order the rooms. If I ever need to add a room in somewhere, I can just rename the rooms a little bit by changing the letter codes of the rules.

06 and 07 are the designations for particular rules in that room.

I know that I don’t necessarily need everything to be in any particular order, but I decided to do it this way to make the order of rules in Rule Machine consistent with the way I ordered my rooms on the ‘Rooms’ tab in the ST app.

I even created ‘Rooms’ for different places outside of the house (e.g. a ‘room’ for the north side of the house by the garage where there would normally be vehicle traffic at certain times of the day, one for the south side by the veggie garden where there should normally not be any movement at night, and so on…).

You know, Rule Machine does not require you to actually enter anything except the rule name. And, the parent app alphabetizes the list of child apps – your rules.

So you can use a blank rule as a separator in the list, like this (L1 ---------------):


Always with the brilliant insight, this guy.

So, for those of us that do want to control the ordering of our rules, we can use a blank one as separator AND put the room name in the name of that blank rule in order to shorten the length of the names of all of the rules. Like this…


Holy wow! I thought I was reading hieroglyphics! ! Lol!

I just name my rules by the room name first…

Such as…

Guest Room - lights on/off with motion and time
Guest Room - bedside lamps
Kids room - lights off during school goes
Master bedroom - lights on at dark

This puts then in order based on what we call each room.

And for misc things like my rules specifically for sounds…

Speech - Front Door open
Speech - Garage Door Open
Speech - Garage Door closed

I do it like this because my wife uses the app and likes to look at the different things and I try to keep the WAF high… Too much techno garble and she is done! Lol

Funny too, she’s a trained aviation electrician and she can’t stand the technical stuff.

1 Like

If every page in the ST app allowed us to order the items that are listed, then my naming convention (and those of others doing the same thing as I am doing) would not be necessary.

On the ‘Rooms’ page, we can put the rooms in any order we like (natively; without adding any kind of naming convention code tot he beginning of the names of the rooms).

In my case, I order them in a way that seems most logical TO ME; whereas alphabetical is not the logic I’m looking for (for me, ‘Outside’ is at the bottom of my list, and ‘Basement’ is just above it; whereas they would be in completely different places in the list if I just let them fall randomly or even if they were organized alphabetically).

Of course, if it weren’t possible to order them however I want natively, I would name them like I’m naming my rules in Rule Machine.

The letter codes I’m using in Rule Machine only pertain to their order in the list (not any sort of abbreviation for the room name or anything like that).

So, since it can, my brain simply filters out the first so many characters, and doesn’t even pay attention to them unless I’m actually working on creating a rule or reorganizing their order in the list.

1 Like

My brain just exploded when I realized I can do this with the names of the things in Smart Things as well. Create Virtual Devices with Names that only serve to separate the devices into categories.

Any downside anyone sees?

1 Like

Freaking brilliant! !!!

1 Like

Bonus points to anyone who comes up with the most useful patterns to use for such organization.

I am experimenting in rule machine now. Using

- Doorbell ---------
- Doorbell Away
- Doorbell Stay
- Doorbell Stay Knock
- Doorbell Away Knock

The Dash before is so I can use multiple dashes to possibly re order on something other than alphanumeric. Not sure how this will all play out. Need some organization expert to craft a schema.

I am thinking something like

2A----------Outside Motion

Then you can force other catagories in a desired order by adding 2B, 4B, 4C, etc later as desired.