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

I was responding to the UI glitch. I’ve not seen the other issue reported.

That’s consistent with my re-testing as well.

Thank you!! That’s the key. I found the problem. Now I just have to figure out how to fix it. Each of these contexts involve adding an extra input, for delay time or level.


The smartthings arrival sensor pings the hub every 30 seconds. That’s not adjustable as far as I know. So you can never predict exactly how long it will take to register you as having arrived, but if you were right on the edge of the time interval, it would take about 35 seconds. If you were right before the very next ping it might only take six or seven. But you can’t forcibly adjust it to be less than 30 because it’s a fixed rate interval. That’s in large part to save battery life.

Also, like all zigbee devices, you cannot predict the path it will take through the mesh to get to the hub unless it just happens to be within one hop. Many people add a repeater in the garage or near window in order to extend the distance covered by the geolocation zone, but that can also lengthen the delay before the sensor is recognized as having arrived because it takes the first hop to the repeater, and it may then not go directly to the hub from there. It might go down to the basement first, or up to the second floor first. And it might take a different path each time.

So nothing to do with rule machine, it’s just the way this particular device works.

This is a pretty neat app! I like that it’s fully contained in SmartThings, unlike some of the other rule solutions.

I am hoping someone can tell me if I’m doing something wrong with this one rule I’m trying.

I want to duplicate the Sleepy Time with Presence functionality without sleep sensors. Reason being, while both my husband and I have Jawbone UP bands, I recently upgraded from a UP Move to an UP2, and the new UPs don’t allow you to manually go into sleep mode on the band itself. So while the automatic sleep tracking works pretty well for processing the data the following day, it doesn’t put the UP into an actual sleep state. The only way to do that is through the app, which is annoying, and unnecessary except for the matter of this ST integration. Unless I put it into sleep mode in the app, Sleepy Time will never be triggered.

So I thought that I might be able to recreate the functionality using virtual switches and the Rule Machine. I created two virtual switches, Zzz Tam and Zzz Ed. I use the Sleepy Time app to turn my husband’s switch on and off, and I’ll have to do mine manually. I bought a minimote recently for this purpose.

The rule I created to run the routine to put things into sleep mode works fine. But I can’t get the rule to run the wake up routine to work as desired.

The idea is that if either my husband or I are the only ones home when waking up, then that person’s sleep switch should trigger the wakeup. If both of us are home, then if either person’s sleep switch turns off, the wake up routine should run.

Here’s the rule in screenshots:

It seems to me that the last part of the rule should do what I want. If either switch turns off (off meaning awake) and both people are present, then the rule should be true. But it still requires both switches to turn off if both people are home. It’s acting as if that last OR is an AND.

I don’t know if I did something wrong, I’m not understanding the way it works, or it’s a bug of some sort.

FYI - there is another forum setup for discussions on rule logic within Rule Machine. I pasted the link at the bottom.

If I understand you correctly you want a routine to execute when either you, your husband or both of you are home and either one of your Zzz switches turns off. I think your rule logic can be a lot simpler and I don’t think you will have to use Advanced Rule Input.

Condition 1 select both switches. State=OFF
Condition 2 select both presence sensors. State=PRESENT

Rule: [Zzz Tam, Zzz Ed] any off AND [Tamara Presence, Ed Presence] any present
True Action: Routine Good Morning!

You also have this setup to run only when in Sleep mode. I assume your Good Morning routine is changing your mode or some other routine that would run after the Zzz switch has been turned off otherwise the entire rule will never be evaluated.

I’m not sure it’s that simple. For example, if I was home and my husband was traveling, then I wouldn’t want the morning routine to run if my switch was on and his turned off. But I would want it to run when my sleep switch went off. I don’t think your example would account for that.

Yes, the morning routine includes a mode change to Home mode. But the mode should still be Sleep when this rule is evaluated, since the mode changes after the rule runs, yes?

Thanks for pointing out the other thread. Should I move this post over there instead? I don’t want to clutter up the wrong thread.

Yes, move this over there. If the following doesn’t solve what you are trying to do.

The easiest thing to do would be to create two rules. You could probably do this in one rule with Advanced Rule Input but I personally don’t see the need.

Rule 1
Condition 1 ZZZ Tam. State=OFF
Condition 2 Tamara Presence. State=PRESENT

Rule: Zzz Tam off AND Tamara Presence present
True Action: Routine Good Morning!

Rule 2
Condition 1 ZZZ Ed. State=OFF
Condition 2 Ed Presence. State=PRESENT

Rule: Zzz Ed off AND Ed Presence present
True Action: Routine Good Morning!

I think this should accomplish what you are trying to do.

You could also write the rule this way
(Tamara present AND Zzz Tam off) OR (Ed Present AND Zzz Ed OFF)

I just wanted to see if this was possible at all?

“Within 5 minutes of routine “I’m Back!” being run, if motion is detected on Sensor X - Turn Switch X ON”


What’s the best practice to have motion turn on the lights but not have the action constantly fire when the lights are already on? Setting the switch to disable the rule works only if there’s only one light being controlled.

how about add the condition to the rule that the light must be off as well as motion

Please explain what you mean by “action constantly fire”?

How to do motion activated lights depends on whether you have more than one motion sensor involved. If only one, then you can use motion-active as the condition, true action turn on the lights, false action turn off after x minutes cancellable.

Please explain what you mean by “action constantly fire”?

How to do motion activated lights depends on whether you have more than one motion sensor involved. If only one, then you can use motion-active as the condition, true action turn on the lights, false action turn off after x minutes cancellable.

Whenever motion is detected, it will turn on the lights, even if they are already on.

What are you talking about? How can you turn something on that is already on? Please show a screen shot of your rule, and log entries to show what you think is going on.

Thanks, that helped! You’re right, I was making it a little too complicated. I think because the going to sleep rule requires everyone who is present to be asleep, I was trying too hard to reverse those conditions. Instead, as you pointed out, the wake up rule only requires that at least one person be both home and awake. It doesn’t matter if the other person is asleep or awake, home or away.

I did end up splitting it into two rules. I wanted to streamline things by keeping it in one rule, and that should work, but I was getting some funkiness in things firing off. I don’t know if that had anything to do with Rule Builder. It might be some other factor or maybe just because I was playing with the switches too often, but I figured breaking it up would eliminate as much complexity as possible.

Thanks again!

Sounds like this is not the right behavior then. I haven’t dug into my logs yet. So far I’ve just set up a text notification to let me know and I get a text message every time I move even if the light is already on.

@bravenel - looks like you’ve dropped new versions - are these ready to be tested, or still in process?

I’m not sure what you’re expecting, but it is normal for motion sensors to throw active and inactive events frequently.

Those are all just tidy-up bug fix type things.

Cool - are you done for the evening, or should we just grab that one? Also, is that the version that fixes the GUI display issue for off conditions bug?

Heh, who am I kidding - you’re awesome at putting new things in…

BTW - my rules with lux only fired correctly at mode change this morning - so I think we can safely say it isn’t your code… oy… seriously want to push @slagle and team to let advanced users like us specify 1-2 non ST-written apps to run locally… this has got to be Cloud lag-related…

1 Like