Problems with Rule Machine: I'm a newbie again, I guess


This past March 3rd, I had open heart surgery to receive an artificial valve and do a couple of bypasses. This is major surgery, to say the least, and entirely unexpected. I was discharged on March 24th, but had to be hospitalized twice subsequently when severe issues emerged. After that, I spent a month and a half in rehab. For obvious reasons, home automation wasn't my primary concern throughout. Happily, I'm finally healing well and have decided to tackle a couple of problems with the Rule Machine 4 for my C5.

The first problem was that the Dome motion sensor in my bathroom died and I had to replace it. Having done so, I found it impossible to get the existing rule to use the new sensor. I renamed the old sensor, renamed the new sensor to have the name of the old one but, of course, when I renamed the old sensor, Rule Machine 4 simply changed the name of the sensor wherever it occurred in the rule to the new name of the bad sensor. I tried all sorts of things to get around this, became frustrated, gave up and deleted the rule, confident that I could re-write it. Yes, I know, I have other alternatives to the Rule Machine, but I really would like to figure out what I (or Rule Machine 4) is doing wrong.

In the end, I deleted the rule and tried to write it anew from scratch. The trigger is the applicable sensor changing state. So far so good. But when I went to add a conditional action ("if the sensor is active then..."), but whenever I try, either the condition (sensor active) is ignored or, if it's not ignored, it shows-up as "if the sensor is active, false." I also find that, even if I accept this and just reverse the logic, I no longer have the possibility of an Else clause, End-if, etc.

I know that Rule Machine 4 can be tricky, but I thought I'd gotten well past this point and can't imagine that I've forgotten everything.

Jeff Broido

Welcome back! I'm glad you've pulled through surgery, and are on the path to recovery, which I hope continues to go well.

A screenshot (if possible) would be really helpful to diagnose the issue you've run into.


Glad you're on the mend. It's just not possible to do this with Z-Wave devices. One you remove a sensor, the database isn't linked to it any longer. You can sometimes trick Zigbee into replacing a different device (I've personally never been successful with doing that, but others say they have) and of course if it's the exact same device you can simply reset Zigbee and it will join back with the database links still intact. Not so with Z-Wave. This is why the upcoming transfer capability of Z-Wave devices from one hub to another, which will be part of the optional subscription service was such a difficult thing to accomplish.

In the future, if you need to replace a Z-Wave device, I would recommend putting a proxy device in your rules temporarily so they don't get screwed up. I do this by just creating a virtual device, then change the rule to use that temporarily. Once the new Z-Wave device is included, I go back and replace the temporary proxy with the actual device.

1 Like

Thanks! As for screenshots, I'll need several, naturally, or a video. If I can't get anywhere with this, I'll probably do the latter.


1 Like

That makes sense, but I never removed the old sensor but, rather, renamed it.

I thought from your first post that you replaced it? Names are not what ties the device to the database. You can change the name and the rule will change to follow, but the database won't be able to link to the old device if you remove it by exclusion or force remove. So if you first change the rule to a proxy virtual device, the database is updated instead of having the links broken by a device disappearing. Then once you change the proxy virtual device to the new physical device, the database is once again updated to reflect the change.

1 Like

I think what you are seeing is the actual state of the sensor at the time the rule is being viewed. (See below) You need something additional logic to evaluate things, and tomatch (tie) the sensor to the switch.

So in the case of this rule, starting from the beginning.

  • If bath sensor closed (F) means that the sensor currently is open.

  • And motion is active... (F) means this is currently not active.

  • Mode in Day........... (T) means that I am in one of those modes.

  • (FALSE) means that the three previous things (sensor closed, motion, and mode) are all NOT true.

  • Else-IF ...... (T)(TRUE) means that the door sensor IS currently open, all conditions are met, so the next part of the rule will run.

With that being said, if this is a motion sensor, any reason you aren't using Motion Lighting or Simple Automations which are MUCH easier to understand and use.

1 Like

Of course! Once I read your comment, it all came rushing back. Now, let me try again. I feel like an idiot.



Yep! Just being forced to remember this one fact seems to have unlocked what I'd learned of the Rule Machine and I dashed out the rule in just a couple of minutes!

Thanks, folks, for indulging me.



As an easier alternative to RM you should also consider Event allows you to create more complex automations than the Simple Automations Rules, Motion Lighting, etc., and supports flexible AND/OR options across multiple conditions (triggers in RM speak).

Worth a look as another tool to add to your HE toolbelt as you're coming back to HE. :slight_smile:

And congrats on your recovery, my sister in law had open heart/bypass surgery, and it is no small thing indeed to have your chest cracked open. Best wishes to you and your family.


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