Dry the Wetspot modification needed ASAP :-(


(Brian Smith) #1

I have temporarily loaded the Dry the Wetspot smart since my sump pump is just constantly running (the water sensor must have crapped out) and we are having very heavy rains today. Before I ran out the door this morning, I quickly hooked up an outlet module to the pump and placed a water sensor in the sump…one with a probe, which is much easier in this case.

However, I noticed that the smartapp immediately turns off the switch when the sensor is dry. This is causing the pump to turn on and off at least once or twice a minute.

Is it possible for someone to help me out and modify the smart app to allow the outlet to stay on for X seconds after the sensor says it is dry? I placed the probe higher in the sump, so it will take a few seconds for the pump to empty it.

Unfortunately, I’m on the road today and can’t learn Groovy in time to fix this issue since we are getting very heavy rains today. I was actually thinking this would be an easy modification and a goo first step into Groovy, but my circumstances today are not helping me out! :frowning:


(Brice; SmartRulesApp.com) #2

Hey Brian. You should be able to just change the line pump.off() to pump.off([delay: 2000]) where 2000 is the number of milliseconds to delay the command.


(Brian Smith) #3

Thanks, @obycode

Ugh…I just looked in the IDE and it is not in the list of apps “from template.” So, I can’t even try to do this.

I noticed it was written by @scottinpollock. Tagging him to see if he has it somewhere.


(Tim Slagle) #4

this should get you started Just figure out the millisecond value you want at the bottom of the code.

/**
 *  Dry the Wetspot
 *
 *  Copyright 2014 Scottin Pollock
 *
 *  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:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  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.
 *
 */
definition(
    name: "Dry the Wetspot",
    namespace: "smartthings",
    author: "Scottin Pollock",
    description: "Turns switch on and off based on moisture sensor input.",
    category: "Safety & Security",
    iconUrl: "https://s3.amazonaws.com/smartapp-icons/Developers/dry-the-wet-spot.png",
    iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Developers/dry-the-wet-spot@2x.png"
)


preferences {
	section("When water is sensed...") {
		input "sensor", "capability.waterSensor", title: "Where?", required: true
	}
	section("Turn on a pump...") {
		input "pump", "capability.switch", title: "Which?", required: true
	}
}

def installed() {
	subscribe(sensor, "water.dry", waterHandler)
	subscribe(sensor, "water.wet", waterHandler)
}

def updated() {
	unsubscribe()
	subscribe(sensor, "water.dry", waterHandler)
	subscribe(sensor, "water.wet", waterHandler)
}

def waterHandler(evt) {
	log.debug "Sensor says ${evt.value}"
	if (evt.value == "wet") {
		pump.on()
	} else if (evt.value == "dry") {
		pump.off([delay: 2000])
	}
}

(Brian Smith) #5

Gracias… @tslagle13!!!


(Brian Smith) #6

Yep that worked. Mischief Managed until I can get the new pump installed tonight!

The power of the community!!!

I think I’ll email ST to note they should add some user configurable delay options in the smartapp.


(Keith Croshaw) #7

I’ve been looking into something like this:
https://www.plumbingsupply.com/sumpwatcher.html

My pump is fine but the float switch always gets stuck down and sometimes up causing it to suck air and possibly damaging the pump.


(Brian Smith) #8

@scottinpollock - you should take a look at the link that @keithcroshaw posted. I think the logic used by this device could easily be incorporated into your smartapp when a ST module is used (or any module that monitors draw). You could set a user configured threshold for “when power drops below X watts, turn switch off,” indicating that the pump is no longer pumping water. I’ve already adjusted the time delay that @tslagle13 added based on this data!

I took a look at my outlet module and I can see when the pump is no longer pumping water based on the draw.

I think that would really put the “smart” in “smartapp.” :smile:


(Keith Croshaw) #9

Nice observation. All very possible with ST. Maybe I’ll buy another power sensing outlet for that, although powerMeter I think is historically slow to update unless ST fixed that. At least for my Aeon device, it might be device specific.


(Andrew Mager) #10

@scottinpollock Can you submit “Dry The Wetspot”? I’ll prioritize it :slight_smile:


(Brian Smith) #11

The ST outlet module updates VERY quickly when there are changes in wattage.

Of note - a few minutes ago I looked and the outlet was on, but there was no draw of power. I was worried that the pump finally failed, since the water sensor was still wet. I was about ready to run out the door when the outlet module finally showed draw again and then the sensor went dry. So, the pump is working, but there may be an issue with the switch on it.

Since I can keep an eye on things at work via the activity log, I don’t think I need to run home this minute. Pump just came on again as I was typing this, so it is working now.

Thanks for all the help to everyone on this and thanks to @scottinpollock for creating the initial app!!!


(Brian Smith) #12

@mager, @scottinpollock - I’m thinking the app might need a few options based on the scenario people are using it for and the types of sensors and modules they are using. Just thinking off the cuff here from my current experience. Would love to see what others think as well.

  • user defined off delay after the water sensor registers dry
  • user defined wattage threshold to indicate a pump is no longer pumping water (so you don’t burn out the pump) when using a module that registers power draw.
  • Add an option for an alternate power meter. You might also be able to see this via something like the AEON whole house power meter since my pump, for example, pulls over 700 watts when it is wet and drop to below 600 watts (usually in the 580s) when it is dry.

And, most importantly

  • Notification when the outlet is on after a user defined threshold and the water sensor is not registering dry.

This could be two notifications

  • One notification for when the smartapp notices that there is no draw of power when the outlet is turned on
  • Another notification for the pump is running for X time but the sensor is not registering dry

Yes, you could get the notifications that the sensor is wet or the switch is on, but those are notifications of the start or stop of an event. What we need is the system to tell us “when something is wrong.” In the case of this notification, the outlet or pump is on but the location is not getting dry.


(Convinced ST will never be unbroken…) #13

According to my Publication Requests page, this was submitted and published last June.


(Brian Smith) #14

@mager - yes, I pulled this from the published smartapps. I thought you meant you would publish revisions.

I did think of one other option - For example, I have a new pump now. I may leave the ST Appliance Module there so I can monitor power. In that case, I would not want the app to control the outlet, but to let me know all the other modifications, such as when the pump is not running when it should.


(Andrew Urman) #15

Pretty sure this we do the opposite

/**
 *  Wet the Dryspot
 *
 *  Copyright 2014 Scottin Pollock & urman
 *
 *  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:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  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.
 *
 */
definition(
    name: "Wet the Dryspot",
    namespace: "smartthings",
    author: "urman",
    description: "Turns switch on and off based on moisture sensor input.",
    category: "Safety & Security",
    iconUrl: "https://s3.amazonaws.com/smartapp-icons/Developers/dry-the-wet-spot.png",
    iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Developers/dry-the-wet-spot@2x.png"
)


preferences {
	section("When water is sensed...") {
		input "sensor", "capability.waterSensor", title: "Where?", required: true
	}
	section("Turn on a pump...") {
		input "pump", "capability.switch", title: "Which?", required: true
	}
}

def installed() {
	subscribe(sensor, "water.dry", waterHandler)
	subscribe(sensor, "water.wet", waterHandler)
}

def updated() {
	unsubscribe()
	subscribe(sensor, "water.dry", waterHandler)
	subscribe(sensor, "water.wet", waterHandler)
}

def waterHandler(evt) {
	log.debug "Sensor says ${evt.value}"
	if (evt.value == "dry") {
		pump.on()
	} else if (evt.value == "wet") {
		pump.off([delay: 2000])
	}
}