I woud like to receive an alarm if my Sump pump running for more then X minutes. I would like to use ST Outlet to determine if the Sump pump running or not base on the power that it consume.
If the “Energy Alerts” SmartApps can have a timer It would be wonderfull.
I tried to modify the “Energy Alerts” program to add a timer inside but I don’t know too much about this language. I think I miss a thing.
Can some one help me ?
I put the lines for the timer below, In bold here the start and the end my adds.
Thank You
def aboveThresholdValue = aboveThreshold as int
if (meterValue > aboveThresholdValue) then HighPower.value == true else HighPower.value == false
if ( HighPower.value == true ) {
def elapsed = now() - HighPower.rawDateCreated.time
def threshold = ((timeThreshold != null && timeThreshold != “”) ? timeThreshold * 60000 : 60000) - 1000 if (elapsed >= threshold) {
if (lastValue < aboveThresholdValue) { // only send notifications when crossing the threshold
def msg = "${meter} reported ${evt.value} ${dUnit} which is above your threshold of ${aboveThreshold}."
sendMessage(msg)
} else {
// log.debug “not sending notification for ${evt.description} because the threshold (${aboveThreshold}) has already been crossed”
}
}
}
}
I recommend not using an outlet that can turn off for a simp pump… just imagine what would happen if Smartthings accidentally turns off the sump pump when it should be running.
Maybe consider an aeon power monitor instead.
I almost know nothing about groovy but Webcore may be an easier alternative.
Or if you have other things to monitor use ST_Anything with a ESP8266 and the current sensor to do the same thing plus add a water sensor if it starts to get full as a alert.
Pizzinini : Thank you for your reply. I didn’t saw that the Aeon Labs HEM was supported by ST.
I just buyed two of those to do my tests.
If I’m able to resolve my program error , I will be perfect with this solution !
Vseven : The idea is good but I prefer to be able to read the electrical power instead of just read if It’s On or not for almost the same price. But I will have to work on the program to do what I want !
Instead of modifying a potentially complicated program would it make more sense to have a secondary program just do what you want? Or maybe WebCore? I would think there is something in there that can read the power reading and say “If above xxxx for yyy minutes then do zzzz”.