Variable Timer / sensor control for a Aeon Z-wave monitoring switch


(Kashif Ahmed) #1

Here’s what i want to achieve and need it for

  1. dish washer has multiple settings ranging in time from 10min to 1:45min
  2. I want the switch to turn off based on the settings on the dishwasher (somehow select timer for the switch)
    2a) or a way to monitor the energy usage of the switch and when it drops to a certain power consumption for more than say 10min then turn switch off
  3. i want to do this cause we usually run the machine before bed, once its done after about an hour or two the machine remains on using about 15W-25W of power to keep beeping, keep the lights and i don’t know what else for the remaining 6-8hrs before we turn it off.
  4. problem with current timer setup is if we have two loads to do it will shut off in the middle of the second load, so i have to go into options, uninstall the timed off function than turn it back on and then remember to set it again for the next time

Any suggestions?
thanks


(Bruce) #2

So you need to have setting the timer wipe out the old timer setting (unschedule()). How are you actually setting the timer for the switch?


(Kashif Ahmed) #3

Right now I was using the built in Smartthings function, turn off after on for a certain time. But idealy want I would like to setup is some kind of turn off if power idle for 10 min so I could apply the same logic to turn off the coffee machine, rice rooker, etc based in idle power usage and time for the device…


(Paul) #4

Look at the Laundry Monitor app that alerts you when the power drops below a threshold. You could easily modify that app to turn off a switch when the cycle is complete.

Hope that helps.


(Kashif Ahmed) #5

Hey NorCallLights! thanks so much! yeah i was able to edit the code from that to make it turn off the switch (or any switch actually) once the threshold was reached. Still hitting a glitch somewhat so still a work in progress but will try getting it up on githib so if anyone else needs to they can use it as well.

https://gist.githubusercontent.com/drkashifa/56a92c720818462d79d9/raw/b7864557e307dc51324f562f102c4e31f134b658/gistfile1.txt


(Kashif Ahmed) #6

Anyone have any suggestions on how to go about adding a time delay? i tried doing the

def switchOnHandler(evt) {
log.debug "Switch ${theSwitch} turned: ${evt.value}"
def delay = minutesLater * 60
log.debug "Turning off in ${minutesLater} minutes (${delay}seconds)"
runIn(delay, turnOffSwitch)
}

but that still just turns it off, trying figure out a way that it waits for 10min to check again if current draw is below the set point then turns it off if it is