IF condition in presence PLEG?

First I want to start with saying I am a beginner and still trying to learn. Be gentle. :wink:

I am trying to set up a voice notification from our wall mounted tablet when a family member come home or leave, using our iPhones. I also want to use this presence detection to put the house in away state (e.g. lock doors and switch off lights).

I am trying to use iViris geofence feature in combination with the ping sensor. The reason I want to use BOTH iViri and ping is because sometimes the iViri feature isn?t reliable. Sometimesd I get a voice notification from Vera Alerts to the wall mounted tablets speakers 10-15 min. AFTER we arrive (driving the wife insane).

I have made four different triggers in PLEG for my iPhone (my name is Aron):

Aron_iViri_present
Aron_iViri_away
Aron_ping_present
Aron_ping_away

I have made two different conditions:

Aron_present = Aron_iViri_present OR Aron_ping_present
Aron_away = Aron_iViri_away AND Aron_ping_away

The conditions each have an action using the VeraAlerts device (ā€œSendAlertā€).

The problem is that I only want the ping sensor to be used to detect presence is if the iViri status shows that the iPhone is away.

Otherwise each and every time the iPhone connect to our wifi I receive a Aron_present message (driving my wife even more insane).

In summary, I want the condition to be something like ā€œif Aron_iViri_present go ahead and trigger the action Aron_present, and if Aron_ping_present also go ahead and trigger the action Aron_present BUT ONLY IF Aron_iViri_away is activeā€.

I solved my false positives another way.

I use PLEG sequence expressions to decide if I am away or gone. Although I am on Android and Use Vera Proximity instead of iViri.

Since I always enter/leave from the Garage ā€¦ I was able to do the following:

HOME GeoFenceEnter; GarageOpen < 5:00
AWAY GarageOpen; GeoFenceExit < 10:00

Sometimes it takes me a few minutes to leave ā€¦
As a result I am only sensitive to false hits within a few minutes of operating my Garage door.

Iā€™m still learning all of this, so forgive me if Iā€™m incorrect.

Couldnā€™t you just do something similar to this?

Aron_present = Aron_iViri_present OR Aron_ping_present
Aron_away = !Aron_iViri_present and (!Aron_iViri_present and !Aron_ping_present)

You might have to much going on and could be simplified. Iā€™m assuming your using a multiswitch for this?
Do you have a master virtual switch that says your home or away?
I personally donā€™t have 4 triggers, but I use 3 virtual switches in this case.
One master home and One for the ivir to flip and one is the ping sensor.

Then I use PLEG to flip the master home/away switch on and off. On Iā€™m home off Iā€™m away.

From there I think prim8 has got what you need. Either Iviri or Ping which ever hits first will flip your switch to home.
Aron_present = Aron_iViri_present OR Aron_ping_present)

You can use this for away
Aron_away = !Aron_iViri_present and !Aron_ping_present

You might have to much going on and could be simplified. Iā€™m assuming your using a multiswitch for this?
Do you have a master virtual switch that says your home or away?
I personally donā€™t have 4 triggers, but I use 3 virtual switches in this case.
One master home and One for the ivir to flip and one is the ping sensor.

Then I use PLEG to flip the master home/away switch on and off. On Iā€™m home off Iā€™m away.

From there I think prim8 has got what you need. Either Iviri or Ping which ever hits first will flip your switch to home.
Aron_present = Aron_iViri_present OR Aron_ping_present)

You can use this for away
Aron_away = !Aron_iViri_present and !Aron_ping_present[/quote]

Yes, you were absolutely right on the simplify thingā€¦ :stuck_out_tongue:

I added another master virtual switch, named Aron home.

Then it was easy:

Aron_present = Aron_iViri_present OR Aron_ping_present

Aron_away = Aron_iViri_away AND Aron_ping_away

Aron_present switches the master virtual switch (ā€œAron homeā€) on as an action.

Aron_away switches the master virtual switch (ā€œAron homeā€) off as an action.