Home and Away Mode Management?

I created the following PLEG device. It works to set the vera to home or away based on whether our phones can be pinged and a virtual switch that gets set to true if we’re inside/outside our phone’s fence.

The problem i’m having is that it if I manually set the vera to Home from work, and nobody is actually home, it puts it back to Away. As expected I guess since that’s what my PLEG device does.

How would I make it not put it to Away if I manually set it to Home? Is that even possible? Or is there an alternative to doing what i want to do big picture?

ultimately, I want a manual setting to home or away to stick and stay that way… so that i always have that option to manually set the vera’s mode.

You should check in each condition, that the “triggering” even happened AFTER the change in the Home mode.

So, for example, the AwayMode condition should be changed to something similar to:

mHome and (!PingGeraldYes and !PingLizYes and !VSGeraldHomeYes and !VSLizHomeYes) and (mHome;!PingGeraldYes)  and (mHome;!PingLizYes)  and (mHome;!VSGeraldHomeYes)  and (mHome;!VSLizHomeYes)

By the way, I think you have a wrong logic at the beginning of the HomeMode condition.
You wrote:

(!mHome or !mVacation) and (…)

In case the switch is NOT in Vacation mode (i.e. !mVacation = True) and it IS on Home mode (i.e. !mHome = False) , the whole expression will be true.

Is this really what you wanted to achieve? Didn’t you simply want to check that the switch is not in Home mode (i.e. !mHome)? Or maybe you simply wanted to check the switch is in Away mode (i.e. mAway)?

ah thank-you! i was wondering what a field like (mHome; !PingGeraldYes) did exactly… I didn’t understand the point of a “;”. Nothing like seeing an example in your own condition to see how something works. :slight_smile:

good catch on the (!mHome or !mVacation)! I didn’t notice that flaw…

I originally had only !mHome but got worried that if i had it in vacation mode that this condition could still trigger. en example would be if one of us left our phones at home accidentally when we went on vacation. One of the ping conditions would likely be true if not the VS condition as well, and the home would go back to home mode since the entire expression would be true. I suppose that the way to solve this is to to change (!mHome or !mVacation) to (!mHome and !mVacation), meaning it will only evaluate to true and go to home mode if i’m currently in Night or Away mode.

Here is my device which seems to be working fine in case it’s helpful for anyone else.

In my case there are two of us. I have an android device while my fiance has an iphone. I use a VeraProximity fence to turn on a virtual switch anytime i enter the fence and turn off the VS when i exit the fence. I also have a ping device that pings my phone as a backup to see if i’m home (or my fiance).

Ultimately the PLEG device puts my home in Home mode if it’s currently in Away or Vacation mode and if either of the two virtual switches are on (i.e. we’re entering the geofence) or if either of our phones can be pinged.

It puts the home in Away mode if i’m currently in Home mode and the system finds that both virtual switches and both ping devices are all false (i.e. nobody is home but only after it initially went into home mode).