Vacation mode and occupancy tracking design pattern

Posted on
Tue Apr 12, 2016 4:44 am
jmdraper offline
Posts: 103
Joined: Sep 11, 2014
Location: Surrey, UK

Vacation mode and occupancy tracking design pattern

This is a design pattern which I've found works well for a really easy-to-use vacation mode that you can set easily before you go and cancels itself (e.g. to heat your house and hot water ready for you) on the expected return date.

Like many, I have a mode variable in my system which tracks whether the house is occupied or not. In my case the variable is called occupancy and has three possible values: home, out, away (where home means at least one person is home, out means everyone is out but expected back later today and away means everyone as out and expected back some days from now). My other automations such as morning wake-up routine, heating, hot water, door bell, door window and motion sensor notifications all behave differently depending on the value of this variable.

The home/out states are automatically updated based on the statuses of 3 other variables that track occupancy of me, my wife and any guests. When they are all out, the out mode is set and when any one of them is in the home mode is set. The individual occupancy variables could be set by clever presence detection stuff but I actually prefer a simple switch by the door which I have trained and incentivised everyone to use. This works for me because I don't have an alarm system per se, so this allows me to trigger things like checking all the doors and windows are closed when you say you intend to go out (by pressing your button by the door) and notifying if there are any issues.

For the 'away' mode, though, I have in the past just manually created a schedule before I go away to turn it on on the day I expect to leave and turn it off again on the day I expect to return. But that's just one more thing to forget to do before we go away. So I came up with a simple solution using control pages.

Under the hood: I created a variable called awayReturnDate and another called todaysDate. Each contains a number between 1 and 31. The todaysDate variable gets today's date inserted into it by a schedule running at 1 minute past midnight each day. Also if the occupancy mode is NOT equal to away, the awayReturnDate gets set to todaysDate each day at 2 minutes past midnight. Every day at 0900 a schedule runs with the conditions that occupancy = away and awayReturnDate = todaysDate. The actions on this schedule change occupancy to out and pre-heat the house and hot water for me.

Human interface: the control page displays the value of the awayReturnDate variable (I found a set of nice calendar icons with numbers on which I use to show the variable value to make it look pretty) and a couple of buttons to increment and decrement that variable. I set some triggers to roll the variable value round to 31 if it becomes < 1 and to 1 if it becomes > 31. All you do when you are going away is you use the increment button to increment the awayReturnDate to the date you intend to return. Then you leave as normal and click your occupancy button as usual to say you're leaving. A trigger fires when the occupancy changes to out mode while awayReturnDate is NOT equal to todaysDate and it sets occupancy mode to away.

This obviously assumes that you never go away for more than a month, but it would be fairly easy to adapt with a return month too. We just never go away for more than a couple of weeks at a time so that was an unnecessary complication for us.

This seems to have met with a good Spouse Approval Factor since it's something my wife can now really easily to do herself before we go rather than have to nag me to do it! Both she and I prefer this arrangement :)

Posted on
Tue Apr 12, 2016 6:49 am
jalves offline
Posts: 744
Joined: Jun 16, 2013

Re: Vacation mode and occupancy tracking design pattern

Very interesting approach. I've incorporated some of these same ideas in my system, but you've given me more to consider. Thanks for posting this!

Running Indigo 2023.2 on a 24" iMac M1), OS X 14.4
Jeff

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests