Trigger with a delay based on House Status - Home/Away

Posted on
Tue Jun 27, 2017 3:19 pm
Colly offline
Posts: 535
Joined: Jan 16, 2016
Location: Ireland

Trigger with a delay based on House Status - Home/Away

Looking for some help on a trigger I'm setting up. Can't seem to think of a straightforward way to do it and guessing others have been here long before me..
I have a beam sensor on my driveway (no gates or cameras yet!) and I want to get a text alert once it's triggered and both my wife and I are away. That bit is easy however I don't want to get a message when either of us are arriving home - I'm using the Unifi plugin to determine if we're home or not. What's the easiest way to trigger on beam sensor going "on" and that neither iPhones status becomes up within "x" minutes? So basically if neither phone becomes "up" after someone has come in the driveway I want to know. I plan to experiment with iBeacons at some stage but for now I'm sticking to the Unifi plugin which is working great - thanks Karl.

Posted on
Tue Jun 27, 2017 4:26 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Trigger with a delay based on House Status - Home/Away

No idea what the Unifi devices look like in terms of states, but the general idea would be to write a script that tests to see if both devices are not at home and send the notification. Delay the script execution by however minutes it takes for the Unifi devices to get updated with the state (if it was you that drove up) and you'd be good to go. Here's the shell of the script but you'll need help filling in the blanks:

Code: Select all
yourPhone = indigo.devices[IDOFYOURPHONEDEVICE]
wifesPhone = indigo.devices[IDOFYOURWIFESPHONEDEVICE]

if yourPhone.states["STATENAMEHERE"] != "whatever value means home" and wifesPhone.states["STATENAMEHERE"] != "whatever value means home":
    indigo.actionGroup.execute(IDOFACTIONGROUPWITHNOTIFICATION)


So, if your phone is not home and your wife's phone is not home, execute the action group specified. You'll need to put your notification actions into an action group first.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Jun 27, 2017 4:45 pm
Colly offline
Posts: 535
Joined: Jan 16, 2016
Location: Ireland

Re: Trigger with a delay based on House Status - Home/Away

Thanks Jay, will give that a go and see how I get on.


Sent from my iPhone using Tapatalk

Posted on
Wed Jun 28, 2017 5:52 am
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: Trigger with a delay based on House Status - Home/Away

I have a similar setup; since I live at the end of a long private drive, I have a magnetic driveway sensor 100 yards out at the cattle guard turning into my property that our vehicles trip about a minute after we walk out of the door and a minute before we get out of the car. What I do with the piBeacons that I'm using for presence detection is have a trigger which sets the "HouseState" variable to Away when the beacon count goes to 0 with a 90 second delay to give us time to get over the driveway sensor and a trigger to send a pushover alert when driveway sensor trips with the house State is away with a 90 second delay on it. And a third trigger which fires when the beacon count becomes greater than 0 that sets the house mode to "Home" and deletes delayed actions on the driveway alert trigger. If you are scared of scripting, you could accomplish the same effect with 2 triggers on each of your phones; a pair of triggers to set the Home variable to "away" if your phone becomes "not home" with the condition that your wife's phone is also "not Home" and vice versa, and another pair of triggers to set the Home state to "home" if either phone state becomes home. And that home/away state also can be used as a condition to do other stuff as well; turn lights on and off and the like to give a lived in appearance tot he home while you're gone...

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests