Rules with presences differences

I'm trying to set it up so that if I arrive certain lights will turn on but if my Wife is already home one of them won't, in case she's taking a nap or in bed. I can tell it when I arrive turn the lights on, and just omit that one, but I can't figure out how to tell the rule to not turn the last one on if she's here. any advice?

Would something like this not work for you?

IF (Ashok's Life360 Presence not present(F) [FALSE]) THEN
	On: Nightstand

I would need to say something more like
IF (Lillian Life360 Presence not present(F) [FALSE]) AND
IF (James Life360 Presence present(F) [False])THEN
On: Nightstand
I'm also not sure how to correct the statement or write it on my own. I have about 1 semester of basic JAVA so I recognize the script but not well enough to write it.

I think I got it with this.
IF (James 360 present(T) AND
NOT Lillian 360 present(F) [TRUE]) THEN
On: His Light

I just hadn't thought about putting the last light as a separate step; newbie issue.

1 Like

Looks like you got this figured out, so that's good! If you're still having problems figuring out how to click around in the UI to get there, this video may help: Rule Machine 2: Advance Conditional Rules - YouTube

To be technically correct, I'd add an END-IF to what you have now. Any IF THEN must be "closed out" with one, but since you don't have any more actions in your rule, RM will infer one and it won't really cause any problems. Just a good habit to get into, and it could matter with more complex rules (e.g., with nested conditionals).

Won't be of much help, but that could be good news or bad news. :slight_smile: Rule Machine isn't code per se, though it does display the rule actions to you in a manner similar to such, and it does require you to think like a bit like a programmer (or at least know how conditionals are evaluated and what it means to execute specific actions in a certain order, for example). If you do get to this point, you can write custom "apps" in Groovy instead of using rules if a custom app doesn't meet you needs, but RM is there so you don't have to.


I just added this, I saw it in a video on YouTube earlier. Thanks so much for your help.