Smart Vacation Mode + Randomize?


I searched on the community for a comprehensive app that helps manage Vacation mode, but it seems like there is not much done on this.

This is what I would like to do,

Detect when mode changes to Away
When home is in Away mode for “x” no.of hours change mode to Vacation Mode
When in Vacation Mode simulate randomly lights being turned on/off in selected rooms
Only randomize lights to come on during a certain time period (Ex: Evening)

Has anyone made an app similar to this?

Any other ideas?




Excellent - This is perfect . I just need to write an app to automatically change to vacation mode when in away mode for certain duration of time.

Thank you very much. I would have never guessed it by the name…

Ashutosh did you end writing the app that activates after being away for “x” number of hours ?

Yes, I did and it works great. here is the code,


  • Auto change to Vacation Mode
  • Copyright 2015 Ashutosh Jaiswal
  • Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at:
  • Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
  • on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
  • for the specific language governing permissions and limitations under the License.

name: “Auto change to Vacation Mode”,
namespace: “”,
author: “Ashutosh Jaiswal”,
description: “This app automatically changes mode from Away to Vacation Mode after it stays in Away mode for a period of time”,
category: “Safety & Security”,
iconUrl: “”,
iconX2Url: “”,
iconX3Url: “”)

preferences {
section(“Choose Mode for Away…”) {
input “AwayMode”,“mode”, title: “Away Mode”
section(“Choose Mode for Vacation…”) {
input “VacationMode”,“mode”, title: “Vacation Mode”
section(“Change mode to Vacation mode after how much time in Away Mode?”){
input “Time”, “number”, title: “Hours?”


def installed() {
log.debug “Installed with settings: ${settings}”



def updated() {
log.debug “Updated with settings: ${settings}”



def initialize() {
subscribe(location, modeChangeHandler)

def modeChangeHandler(evt) {
log.debug “Mode change to: ${evt.value}”

 if (AwayMode == evt.value) {
	def delay = Time*60*60  
	runIn(delay, changemode)
else {
	log.debug("Mode did not change to - Away mode")


def changemode(){
if (AwayMode == location.mode) {
sendPush “Mode has changed to ‘${VacationMode}’ since you were in Away mode for more than ‘${Time}’ hours”
else {
log.debug “Cannot change to Vacation mode since mode was changed in between”