Help building piston(s) - determine multiple presence scenarios


#1

1) Give a description of the problem
I’m working on my first piston(s) and need a little help with the logic of this presence scenario.

Presence Sensors

  • Dad’s phone
  • Mom’s phone
  • Daughter’s phone

Basic scenarios

  • If everyone leaves and daughter is home alone, execute routine Home Alone (which sets a specific mode and alarm level).
  • If no one is home and daughter arrives home alone, execute I’m Back routine (which unlocks doors, turns on lites, etc) then execute Home Alone after she get’s into the house (perhaps just via a timeout). I do have two door sensors and multiple motion sensors available as well to determine when someone walks in the door.
  • Ensure that when multiple people arrive home at the same time as Daughter, Home Alone routine is not executed. I already have the I’m Back routine setup for all presence sensors without any pistons - standard setup.

2) What is the expected behavior?
To correctly execute the Home Alone routine when our daughter is truly home alone.

3) What is happening/not happening?
Nothing yet, piston not created. Still working out logic and if this should be multiple pistons or one larger one


#2

Is the first bulleted scenario (everyone leaves and daughter home alone) really this simple? PS4 is our daughter’s phone. I feel like I have to be missing something since it seems to simple. I guess I could have moved the last grouping checking to see if mom or dad is home to a restriction instead?


#3

If all of PS1 and PS3 are not present and PS4 is present is probably how I’d put it together.

In the absence of a trigger, the conditions will be the trigger. If the device does not subscribe to the event automatically, you can force it to by clicking the cog icon.


#4

You should change the OR on line 28 to an AND. Otherwise, when PS1 leaves (and is not present) the routine will run because PS1 is not present anymore. You only want the routine when 1 and 3 are both not present when one has changed to not present, correct?


#5

Yeah, I changed that one to an And. That was a stupid one and I was sleepy when I did this! Thanks.


#6

I’m thinking that these two might be the same piston:

I guess I need to understand how to create a piston that looks for a change (mom or dad phone changes to present when daughter’s changed to present and executed the piston) while it has already started.

Is that possible? Am I on the right path? I already have her added to the I’m Back routine, so that will execute when she arrives. But, I need to capture that she arrives alone. Would the login be:

  1. when I’m back routine executes
  2. delay x time
  3. if daughter’s phone state is present and parent’s phones are not

#7

You should be able to just send the code down a different route depending on who has arrived (if I’m able I will post my piston which does something similar, it doesn’t always work well on my phone.)

So if someone arrives do arrive.
But if the person is this wait for 10 mins then do this.
With WC you can create multiple branches from the original IF so you can create the main IF which is when someone arrives but from that trigger also go off in another direction and do something else depending on these other conditions.