Interval Timer Quick Fix?

Hi everyone. Long time reader, first time poster - and I think I’m in for a doozy.

The switch on my sump pump gave out this morning leaving it forever in the on position. I felt pretty smart grabbing a smart plug and plugging the pump into it so I could toggle on/off manually. I ordered the new part, but it won’t come until tomorrow.

I’m looking for an easy fix (not using WebCore if possible - I don’t quite have the time to overcome the learning curve there) to set my switch to turn on for 20 seconds every 20 minutes to drain my pit (we live in a wet area and have had snow and rain for a week to boot).

Does anyone have any simple solutions that’ll set me up to at least sleep through the night and wait for the part to arrive?

Thanks!

This could work! I tried to figure it out, but didn’t see power allowance settings or know how to create a simulated switch.

The following How To in the community – created wiki will walk you through how to create the simulated switch and use power allowance as a timer. So that’s the one you would set to run for one minute

http://thingsthataresmart.wiki/index.php?title=How_to_create_a_virtual_timer_for_a_light

Then you need to create a second one which turns itself off after 20 minutes.

Then daisychain them so when the 20 minute one turns off the one minute one turns on and vice versa.

Now start the 20 minute one manually.

The 20 minute switch will run for 20 minutes, then turn itself off.

When the 20 minute one turns off, that triggers the one minute switch to turn on. It runs for one minute, then turns itself off.

When the one minute switch turns itself off, the 20 minute Switch will then turn on.

What you need for the daisychain

2 switches, each using The power allowance feature, but for different periods of time.

Four smart lighting rules:

Power allowance rule for switch A

Power allowance rule for switch B

Turn switch A on when switch B turns off.

Turn switch B on when switch A turns off

Note that once you start this, the daisychain will run forever, you will have to actually change one of the rules to get it to stop.

Otherwise, I’m sure @anon36505037 could design a webcore piston for you that would do all of the above plus provide for some kind of emergency override option. :sunglasses:

While the daisychain method is easier to set up, long-term the webcore merhod is probably easier to maintain because you’ll be able to see all of the logic in one place. But it’s up to you.

1 Like

This is GREAT! I just set up the rules and am going to test it out. Fingers are crossed.

Thanks for the quick assist. This should help us get through the night so I can fix the real problem. :slight_smile: :slight_smile:

1 Like

So true. For what it’s worth, this problem has certainly sparked an interest in ST programming. It’s great to use these tools to my advantage when I can get creative like this - at least buys me enough time to avoid hiring a plumber.

You were both a huge help. I really appreciate it.

2 Likes

I’ll probably remove the chain once I fix the issue - I previously had the switch on a sun up / sundown timer.

1 Like

You can use this to turn it off in seconds instead of minutes.

/**

Turn me off quick
Author: seateabee@gmail.com
Heavily based on Power Allowance by SmartThings
Date: 2013-06-28
*/
preferences {
section(“When a switch turns on…”) {
input “theSwitch”, “capability.switch”
}
section(“Turn it off how many SECONDS later?”) {
input “secondsLater”, “number”, title: “When?”
}
}
def installed() {
log.debug "Installed with settings: ${settings}"
subscribe(theSwitch, “switch.on”, switchOnHandler, [filterEvents: false])
}

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

unsubscribe()
subscribe(theSwitch, “switch.on”, switchOnHandler, [filterEvents: false])
}

def switchOnHandler(evt) {
log.debug "Switch ${theSwitch} turned: ${evt.value}"
def delay = secondsLater * 1000 /*Because delay is counted in mill-seconds, multiple seconds by 1000 to get the proper delay. */
log.debug "Turning off in ${secondsLater} minutes (${delay}ms)"
theSwitch.off(delay: delay)
}

1 Like