Multiple presence sensors - merge into one?


#1

1) Give a description of the problem
I’m using both a key fob and cellphone presence sensors. I’d like automations to kick off when either device goes to “away”. Sometimes I don’t take the car and leave my keys behind.

2) What is the expected behavior?
When either the key fob or cellphone device leave the area, trigger the away automation.

3) What is happening/not happening?
Hoping for an app or simple latching example code using a virtual device as the main presence sensor.


#2

Assuming you want to just use the virtual presence in your other pistons. Create a virtual presence sensor and add it to webcore. Create a blank piston.

If any of presence 1 (cell phone) or presence 2 (key fob) changes to away
Then
Using virtual presence
Departed()
End if
If any of presence 1 or presence 2 changes to present
Then
Using virtual presence
Arrived()
End if

Now in any other piston you reference your virtual piston changing to present/away accordingly.


#3

Here is my version of that exact same thing


#4

[I’m such a noob]
How do you enter the commands “arrived()” and “departed()”?
I can’t seem to find the way to get webCoRE to accept those.


#5

You’ll need to create a virtual (simulated) presence sensor in the IDE and then add it to webcore.

Are you familiar with creating virtual devices?


#6

That part is already done.
(I’ve created a whole suite of simulated devices. I’m trying to work out procedures for using one (possibly simulated) device to change the status of other (possibly simulated) devices.)
The “arrived()” and “departed()” is right where I’m stuck on getting a switch to set whether a simulated presence sensor is present/not present.


#7

If the device you’re performing the task on is a simulated presence sensor then the arrived() and departed() command should be available.


#8

I figured it out.
Here’s the original piston:


Somehow, casting it as a device variable obfuscated what kind of device it actually was and the options it gave were “options available to any device”.
Changing {annunciator} to {Simulated Presence} did the trick.
It’s unfortunate, from a standpoint of reusable code that I have to be specific, but OK.