Need Help with a Sequence PLEG for Occupancy

Working on an Occupancy PLEG, that relies on a sequence of events.

Door A Open then Close Door B Open then Close and then Phone out of WiFi range for 5 minutes.

This is what I have as an example: Condition:

(GarageAccessDoorOpen; GarageAccessDoorClosed; SingleGarageDoorOpen; SingleGarageDoorClosed) AND (PhoneNotHome; NOW > 5:00)

Thanks in advance haven’t worked on any new PLEGs for awhile, just need some guidance.

You should also add a check for the current phone-ping state otherwise it could use the time of the last event.

(GarageAccessDoorOpen; GarageAccessDoorClosed; SingleGarageDoorOpen; SingleGarageDoorClosed) AND (PhoneNotHome; NOW > 5:00) AND PhoneNotHome

I don’t know if your sequence logic is bullet-proof but only you can determine that.

You might just want to reduce this to:

(GarageAccessDoorClosed; SingleGarageDoorClosed) AND (PhoneNotHome; NOW > 5:00)

This will better handle cases where you change your schedule, i.e. open the garage door … then remember you need something else from the house.

The above will detect the order that things are closed to indicate you are leaving (House than Garage).
[hr]
I use the following strategy.
GeoFence has false alerts much like those that use Wifi Pings.

GeoFence   Zone 1:  .1 mile
                 Zone 2:  .5 mile

Each Zone Entry/Exit toggles a MultiSwitch.
I often get Zone1 with false readings caused by GPS problems in the house, and the house switching between cell towers.

But the following are quite reliable:

Leaving !Zone1; !Zone2
Arriving Zone2; Zone1

Home: Arriving and Zone2

Richard, and RexBeckett Thank you both for the excellent and quick responses.

This code seems to work great, but I’m still doing some testing.

(GarageAccessDoorClosed; SingleGarageDoorClosed) AND (PhoneNotHome; NOW > 5:00)

This is the script I’m using on my router to detect the MAC addresses of our phones connected or disconnected to the WiFi network. I like this idea better than ping because of false reporting with ping. So far it works great and also keeps the load off my Vera.

http://forum.micasaverde.com/index.php/topic,24084.msg208828.html#msg208828

I also prefer not to use GPS or Geofencing with apps on the phone because of battery life, etc running on the phones. I also have been thinking about adding a phone or old WiFi router into both cars so I can track if the cars are home or away based on the MAC address of the Car. Most WiFi routers run on 12v anyway, the only issue would be powering the device all the time off the 12v car battery.

[quote=“RichardTSchaefer, post:3, topic:185704”]I often get Zone1 with false readings caused by GPS problems in the house, and the house switching between cell towers.

But the following are quite reliable:

Leaving !Zone1; !Zone2
Arriving Zone2; Zone1

Home: Arriving and Zone2[/quote]

Hello Richard,

I copied this logic in a PLEG for detecting who is home, but I am a little confused.

Do the Leaving and Arriving conditions need to be repeating? They seem to remain true all the time. Or does that not matter because they will fire the action whenever they become true again?

Thanks again for PLEG, for me Vera would be nearly useless without it!

Tom Williams

I use Home and Gone

Home: Arriving and Zone2
Gone: Leaving and !Zone2