Presence sensor & ST mode control


#1

1) Give a description of the problem
In the process of moving things from Core to WebCore, and nothing about this routine is working.

2) What is the expected behavior?
The intent is for the ST mode to switch to Away when both my wife and my phone are out of range, or when both of our presence sensors are out of range, and send a push message to the registered smartthings phones.

3) What is happening/not happening?
Mode is not changing. Push message is not sending.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs
I don’t understand how to do this.


#2

use is instead of changes to


#3

Thanks so much. This was the fix. Unfortunately, now I am getting the push message sent twice. I assume this is because both or conditions are being satisfied? Is there a way around so that if both are true I only get one push message?


#4

The way this is worded, I think you’re setup something like this:

Presence1 = You
Presence2 = Wife
Presence3 = You
Presence4 = Wife


If this is correct, why not do this:

IF
   ANY of Presence1 or Presence3 is not present  (your devices)
   AND
   ANY of Presence2 or Presence4 is not present  (her devices)
then
   Do Stuff
END IF

This piston will trigger when:

  • Both phones have left, or
  • Both Presence sensors have left, or
  • Your phone and her Presence have left, or
  • Her phone and your Presence have left

(Your latest piston will only fire for the first two reasons)


#5

As far as getting rid of duplicates alerts, I use a Simulated Switch. (let’s call it ‘BothGone’)

Piston 1

IF
   ANY of Presence1 or Presence3 is not present  (your devices)
   AND
   ANY of Presence2 or Presence4 is not present  (her devices)
then
   Turn on BothGone
END IF

IF
   ALL of Presence1 or Presence3 is present  (your devices)
   OR
   ALL of Presence2 or Presence4 is present  (her devices)
then
   Turn off BothGone
END IF

Piston 2

IF 
   BothGone changes to on
Then 
   Set location to away
   Send PUSH notification
END IF

IF 
   BothGone changes to off
Then 
   Set location to home
   Do other stuff
END IF