Outlet timer


(Korban Hadley) #1

Is there way to create an auto shutoff after a certain time for an outlet when it is turn on. For example I set up a dial timer to work with an outlet for her feminine preparation products. if she forgets to turn them off the timer kills the switch and the devices turn off. I want to do the same with a Z-wave outlet and remove the dial.

thanks,
Korban


(Convinced ST will never be unbroken…) #2
preferences {
	section("When the following is turned on...") {
		input name: "switch1", title: "Which Switch?", type: "capability.switch", required: true
	}
	section("Turn it off after..."){
        input "minutes", "number", title: "Minutes", required: true
	}
}

def installed() {
	subscribeToEvents()
}

def updated() {
	unsubscribe()
	subscribeToEvents()
}

def subscribeToEvents() {
	subscribe(switch1, "switch.on", onHandler)
}

def onHandler(evt) {
	def delay = minutes * 60
	runIn(delay, "scheduledTurnOff")
}

def scheduledTurnOff() {
	switch1.off()
}

(Korban Hadley) #3

I will have to give this a try. thank you.


(Nicholas Wilde) #4

When adding a Smart App, try searching for the published Power Allowance app. I think this might do the trick for you.


(Korban Hadley) #5

Thank you NickW but I think, you can correct me if im wrong, but this limits the usage to a day. So if i set it to 30 min and it turns off then she cant turn it back on. Im about to order the outlet so Ill try both suggestions and see how it works.


(tduffy) #6

Nope, Power Allowance app just limits how long something can be on each time it’s turned on. So that you can’t just leave it on indefinitely. But you can turn it on again after it turns off. It’s a very handy app, I use it to make sure that my garden waterers actually turn off even if my scheduling of them goes awry.