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

Just curious what is the best practice for using a between comparison. I’m using rule machine to monitor lux levels to adjust my living room lights accordingly. I know there is the dim with me app but that only works if your lights are already on. I want RM to auto turn them on and adjust as I tell RM to adjust them. Thanks.

Anyone know the syntax to send a text message to two numbers on a rule? I’ve tried the “,” & “;” but neither worked.

@bravenel, I would be nice to have a global area for the phone number to use on the rules :smile: if at all possible.

1 Like

Just wanted to update I figured it out with the rule definer section using the and operator. Thank you for this awesome app I have great things in store for it here.

just starting to mess around with this. Is there a way to make my hue bulb flash?

Need some help thinking through this… My user community is about to throw some of my “things” in the trash.

what am I doing wrong?? My doors open/unlock when I leave and do not open when arrive. I have confirmed that my phone and fob show up as away (when I was at the doughnut shop this morning) and they show up as present when I am sitting in the driveway waiting for the garage door to open.

I got the text indicating the true actions when i was a couple blocks from my house. I also got the “away” true action text message at roughly the same time. I was driving so i didn’t notice how far apart they were but the "“arrival” one came before the “away” one, but bother were timestamped with the same time (hh:mm). I did not get any texts when I arrived home for real.

I deleted the an old version and recreated this new one this morning before leaving the house. That didn’t seem to change the behavior.

Also probably related to my arrival presence issue, but here is my rule for away. I am looking for all to be not present, however my wife and her phone were still at home and the rule triggered anyways.

(This simulated presence in this rule was something I was trying based on an app from @bridaus which ties two presence sensors into one. )

Hi all,

Having a bit of a logical crisis I think, I want to trigger an event based on a presence sensors changing state to arrive (that’s easy), but I want to wait for another action to trigger (door open) before the action is taken.

This seems to be impossible to do as you can’t loop until a second trigger activates can you?

My problem is I want something to happen but only when:

Presence sensor changes state to present and door state changes to open.

It should not trigger if they are separately activated - rather they will always be triggered one after the other.

Is this possible?
I always seem to end up in the position that conditions won’t work given they aren’t based on state changes, just static is true/false values.

@bravenel is there any facility for this kind of logic and workflow in Rules Engine?

Thanks!
Myles

1 Like

I have my own issues, so maybe I shouldn’t be talking…

There is a trigger of “rule truth” so could you set up two rules, one based on your presence and the second based on the truth of the first rule.

Alternatively you have the option to “Evaluate Rule” as one of your actions.

Seems to be simple…on first blush…

Trigger = Presence Sensor: Present
Condition= Contact Sensor: Open

But, given you want this to only work if they happen in that specific order, and I assume in quick succession…

Then I would create a simulated switch / virtual switch. When the presence sensor becomes present and door is closed, have rule machine turn on the simulated switch and automatically (delay off) it after 2 minutes or some acceptable variable.

Second rule would be:
Trigger: Contact Sensor = Open
Condition: Simulated Switch = On
ACTION

EDIT: I am sure there is a more eloquent way to do this, this is just what struck me at first.

I had this exact same problem and came up with the same solution. We have discussed this in the past and Bruce said one of the newer versions of RM (which was already released) would be able to address this without the use of a virtual switch. @bravenel Since I already had mine working I never looked into whether this was addressed.

My conditions are presence and a door unlocking.

My guess would be using a secondary rule evaluation as part of the logic which is now supported. I haven’t done that yet, so I am not intimately familiar with the ins/outs of it.

It looks like you are using an older version of Rule. Would you please update to the latest from Github, V1.6.7a: https://github.com/bravenel/Rule-Trigger/blob/master/smartapps/bravenel/rule.src/rule.groovy

I don’t know where you got this idea! Rule evaluation is totally driven by events that change states. Why can’t you just use a rule with 2 conditions, and AND. Both conditions would have to be true for the true action to happen. Like this:

You guys are missing some key fundamental concepts:

A rule (has conditions, but no triggers) is evaluated whenever any of its conditions change state. If rule truth changes as a result, it takes action.

A triggered rule (has both triggers and conditions) is evaluated ONLY when one of its trigger events happen, and then the action is taken based on the outcome of that evaluation (the conditions are evaluated); prior rule-truth is irrelevant.

A trigger causes actions whenever one of the trigger events occur.

The relative timing of events isn’t relevant if you have multiple conditions in a regular rule. Each event is going to cause a rule evaluation. In the case of the person arriving and the door opening, both conditions would have to be true for the rule to be true, and it’s the second one of those becoming true that would cause the rule truth to change from false to true.

The displays of [TRUE] and [FALSE] on the main page of a rule are simply aids to show you the current state of the conditions and rule, as of that moment. They are not static values, they change whenever the conditions change.

@dc1515, @Myles_Gray, @JH1, @jnschemm

3 Likes

That may not always be the case. Lets say I want to unlock my house door but only when I arrive and I unlock my garage door. I don’t want to unlock my house door if I am already home and my tenant unlocks the garage door.

From your example wouldn’t the house door always happen when I am home no matter who unlocks the door? What am I missing? I got this to work with a virtual switch.

I agree. I was addressing the simple case @Myles_Gray had, concerned about arriving and opening the door.

Yes, there can be much more complex conditions to make some of these things work, as you discovered and evidently have working.

Sorry, I didn’t mean to hijack the conversation. :frowning:

I read @Myles_Gray 's querie to have that extra layer of complication:

Hence the use of a virtual switch to keep track of order of operation.

Maybe I read his “Need” wrong, but that’s how I understand it.

This is what any 2 condition rule does. As he stated it, he simply wants both to occur before taking action. Either happening by itself will not cause such a rule to act.

Bruce - Okay, the issue I see with that is if he is present already then presence sensor = present. But then someone else comes home and opens the door. Then the rule becomes TRUE and it take the action, when myles may not want it to.

So, if myles ONLY wants it to take that action when his presence sensor FIRST becomes present then shortly thereafter the door opens… then he needs more logic.

That’s my read of it. Hence my post:

Seems to be simple…on first blush…

Trigger = Presence Sensor: Present
Condition= Contact Sensor: Open

But, given you want this to only work if they happen in that specific order, and I assume in quick succession…

Then I would create a simulated switch / virtual switch. When the presence sensor becomes present and door is closed, have rule machine turn on the simulated switch and automatically (delay off) it after 2 minutes or some acceptable variable.

Second rule would be:
Trigger: Contact Sensor = Open
Condition: Simulated Switch = On
ACTION