Arrival/departure if/then or case statement?


#61

Yeah, test won’t break into the “on events from presence sensors” so none of the piston will execute. That’s why you don’t see any conditions being evaluated.

The easiest way to get around it for testing is to change your “On events from any presence senors 1 or 2” to “on events from light switch” and cycling that. Then the rest of the piston should execute.

Option 2 is to drag your two main IF statements outside of the “on events” block. Then they’ll be processed when you click ‘test’.

Trace is actually the red, green, and blue lines you see to the left of your piston as it executes. You’d have to grab snapshots (printscreen, not the green or red camera buttons) of it on initial execution, and then again when it wakes up ten seconds later to see what part(s) of the piston are running each time. That, combined with the log, will make it possible to fix whatever isn’t working.


#62

Ok, I noticed something when we both came home this evening… My presence sensor was picked up first and the first condition worked, light came on.

I was hoping the ASYNC IF would fire at the same time, which would be perfect, but it is waiting for the 5 minutes to lapse on the entryway light before it moved to the ASYNC IF. Once the 5 minutes lapsed, it did evaluate the section that sets the location status.

Do I need to move the location status IF or make both the light and location status ASYNC IFs?


#63

I tried to create a new piston based on your suggestion with light switches in the house. I thought I was getting the results I wanted by using the, “not followed by (negated)”, in the statements, but I am lost in the logic now.

I am starting to lose hope that I’ll ever get this working. It sucks that I can’t ignore these, “false,” location changes in the webCoRE app :unamused:


#64

Bangali, I’ve been using a modified version of your piston (using events from currentplace) for presence notifications/mode switches for my hubby and me. However, I can’t figure out how to send arrival/departure notifications if we BOTH leave at the same time.

Currently, I get “Hubby has left /arrived at X time” and within a minute a get “Lisa has left/arrived at X time.” Is there a way to use a wait time/variable combination that both of our currentplaces have changed within a minute of each other, so I can get the message “Hubby and Lisa have left/arrived at X time?”

Thanks!!


#65

the challenge as you have figured out is that for ST both of you are leaving and arriving separately. seconds apart but separately.

yes. but that will also delay these notifications by that many seconds.


#66

I don’t mind delaying the notification by by up to a minute. Here’s what I came up with. I have a 70 second wait at the top (async) to give this part of the piston time to complete before moving on to the home/away actions:


#67

so does it work? :slight_smile:


#68

Nope. I immediately got a push notification when the first sensor triggered without waiting the full 70 seconds to “see” if the second sensor triggered.

Where should I put in a “wait” to be sure the variable doesn’t “fire” on the first sensor trigger?


#69

give this a try … change all presence to currentplace … i dont use wC presence sensor so had to change it:


#70

Looks like it’s going to be a winner! I was testing with virtual presence, as well… don’t know yet how to create a virtual WebCore presence sensor that can be manually triggered for currentPlace. I have no doubt it’ll work with Ady’s WebCore sensor. Many thanks!!!


#71

sometimes things that should work dont … so give it a try first. :slight_smile:


#72

Did you get this to work?

I have tried so many iterations of this and could not get it to work.

When the second presence sensor changed away from a current location, the piston would stop entirely.

i.e. both presence sensors physically leave at 12:00. In reality, they sensors are updating their current locations about 30 seconds from each other. The poston would execute upon the first sensor change, wait for a period of time, then the second change would come in and the whole piston would cancel.


#73

I wasn’t able to get Bengali’s to work. But, I just created the one below this afternoon. I haven’t had time to fully test it for dual arrivals and departure, but it’s definitely working for single arrivals and departures. YMMV. It’s a behemoth that’s duct-taped together. Maybe this one will work.


#74

And… I’m still having issues… Still trying to work this one out.


#75

try this … please change all occurrences of presence to currentplace:


#76

Thanks, Bangali… Will test over the next few days when we both leave/arrive at the house. Thanks!


#77

you are welcome.


#78

How did it go?

I have a similar issue :slight_smile:


#79

@bangali - this HAS been working. Thank you!!


#80

So seeing the delays are working, how would I adapt to achieve the following status updates?

@bangali helped on this before, but the delays would not work. Maybe this can be the base since the delays are working now?

If we are both change currentPlace changes away from “House” --> Location Mode = Both Away
If I am home and GF is not Location Mode = I am home
If GF is home and I am not Location Mode = She is home

If we are both change currentPlace changes to “House” --> Location Mode = Both Home
If I am home and GF is not Location Mode = I am home
If GF is home and I am not Location Mode = She is home