Water Sensor - Newbie questions

I am new to ST and getting a handle on it. I have succesfully conneced it to my Echo and Harmony and can turn things on and off with Echo.

I just installed and tested a water leak sensor. My question is 2 parts, Can I send notification to more than 1 phone (SMS) and can I make it make the lights blink instead of just turning on ?

Thanks

  1. There’s probably a custom smartapp available that allows multiple SMS notifications, but I’m not aware of it. Acually, I just looked and found that I could provide you a modified version of “Notify Me When” with the ability to text a second number. Let me know if you’re interested.

  2. If you’re using an Aeon micro controller for your smart switch, it can be done easily. The Aeon unit has a “strobe” mode which is recognized as a visual alarm. Just go into Smart Home Monitor and configure it. If you’re using a conventional smart switch, there is an app available from the IDE called The Flasher that will do what you want. However, it uses the ST cloud and short duration timed events, which are always “iffy.” I use it myself as part of our wash load done notification. It always works, but not necessarily with the number or timing of flashes programmed.

Thanks for the reply. I would like to see the modified version of the notify Me When. I am not using an Aon controller. What is the IDE ?

IDE = integrated development environment. It’s where the real power of SmartThings becomes obvious. Try the link and see if you have access. If not, request it. Once you’re in, goto My SmartApps and then click/tap the green button for + New SmartApp (this is best done on a computer BTW). Next, click/tap the tab for “From Code.” Past the code (below) into the window that appears, and then Save and Publish (for me). You’ll find the installed app on your mobile device in the Marketplace (far right icon on the bottom toolbar) under SmartApps > My Apps. At that point, just configure it like any other app.

I haven’t tested my modification, but it’s pretty straightforward , so I’d be surprised if it didn’t work for you.


[code]/**

  • Copyright 2015 SmartThings
  • 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.
  • Notify Me When
  • Author: SmartThings
  • Date: 2013-03-20
  • Change Log:
    1. Todd Wackford
  • 2014-10-03: Added capability.button device picker and button.pushed event subscription. For Doorbell.
    1. Mr_Lucky
  • 2015-11-20: Added ability to send SMS notification to second tel #.
    */
    definition(
    name: “Notify Me When”, namespace: “smartthings”, author: “SmartThings”,
    description: “Receive notifications when anything happens in your home.”,
    category: “Convenience”,
    iconUrl: “https://s3.amazonaws.com/smartapp-icons/Meta/window_contact.png”,
    iconX2Url: “https://s3.amazonaws.com/smartapp-icons/Meta/window_contact@2x.png
    )

preferences {
section("Choose one or more, when… "){
input “button”, “capability.button”, title: “Button Pushed”, required: false, multiple: true //tw
input “motion”, “capability.motionSensor”, title: “Motion Here”, required: false, multiple: true
input “contact”, “capability.contactSensor”, title: “Contact Opens”, required: false, multiple: true
input “contactClosed”, “capability.contactSensor”, title: “Contact Closes”, required: false, multiple: true
input “acceleration”, “capability.accelerationSensor”, title: “Acceleration Detected”, required: false, multiple: true
input “mySwitch”, “capability.switch”, title: “Switch Turned On”, required: false, multiple: true
input “mySwitchOff”, “capability.switch”, title: “Switch Turned Off”, required: false, multiple: true
input “arrivalPresence”, “capability.presenceSensor”, title: “Arrival Of”, required: false, multiple: true
input “departurePresence”, “capability.presenceSensor”, title: “Departure Of”, required: false, multiple: true
input “smoke”, “capability.smokeDetector”, title: “Smoke Detected”, required: false, multiple: true
input “water”, “capability.waterSensor”, title: “Water Sensor Wet”, required: false, multiple: true
}
section(“Send this message (optional, sends standard status message if not specified)”){
input “messageText”, “text”, title: “Message Text”, required: false
}
section(“Via a push notification and/or an SMS message”){
input(“recipients”, “contact”, title: “Send notifications to”) {
input “phone1”, “phone”, title: “Send a text message (enter tel. #)?”, required: false
input “phone2”, “phone”, title: “Also send a text message to:”, required: false
input “pushAndPhone”, “enum”, title: “Both Push and SMS?”, required: false, options: [“Yes”, “No”]
}
}
section(“Minimum time between messages (optional, defaults to every message)”) {
input “frequency”, “decimal”, title: “Minutes”, required: false
}
}

def installed() {
log.debug "Installed with settings: ${settings}"
subscribeToEvents()
}

def updated() {
log.debug "Updated with settings: ${settings}"
unsubscribe()
subscribeToEvents()
}

def subscribeToEvents() {
subscribe(acceleration, “acceleration.active”, eventHandler)
subscribe(arrivalPresence, “presence.present”, eventHandler)
subscribe(button, “button.pushed”, eventHandler)
subscribe(contact, “contact.open”, eventHandler)
subscribe(contactClosed, “contact.closed”, eventHandler)
subscribe(departurePresence, “presence.not present”, eventHandler)
subscribe(motion, “motion.active”, eventHandler)
subscribe(mySwitch, “switch.on”, eventHandler)
subscribe(mySwitchOff, “switch.off”, eventHandler)
subscribe(smoke, “smoke.detected”, eventHandler)
subscribe(smoke, “smoke.tested”, eventHandler)
subscribe(smoke, “carbonMonoxide.detected”, eventHandler)
subscribe(water, “water.wet”, eventHandler)
}

def eventHandler(evt) {
log.debug "Notify got evt ${evt}"
if (frequency) {
def lastTime = state[evt.deviceId]
if (lastTime == null || now() - lastTime >= frequency * 60000) {
sendMessage(evt)
}
} else {
sendMessage(evt)
}
}

private sendMessage(evt) {
def msg = messageText ?: defaultText(evt)
log.debug “$evt.name:$evt.value, pushAndPhone:$pushAndPhone, ‘$msg’”

if (location.contactBookEnabled) {
    sendNotificationToContacts(msg, recipients)
} else {

    if (!phone || pushAndPhone != "No") {
        log.info "sending push"
        sendPush(msg)
    }
    if (phone) {
        log.info "sending SMS"
        sendSms phone1, msg
    }
    if (phone2) {
        sendSms phone2, msg
    }

}
if (frequency) {
	state[evt.deviceId] = now()
}

}

private defaultText(evt) {
if (evt.name == “presence”) {
if (evt.value == “present”) {
if (includeArticle) {
"$evt.linkText has arrived at the $location.name"
} else {
"$evt.linkText has arrived at $location.name"
}
} else {
if (includeArticle) {
"$evt.linkText has left the $location.name"
} else {
"$evt.linkText has left $location.name"
}
}
} else {
evt.descriptionText
}
}

private getIncludeArticle() {
def name = location.name.toLowerCase()
def segs = name.split(" “)
!([“work”,“home”].contains(name) || (segs.size() > 1 && ([“the”,“my”,“a”,“an”].contains(segs[0]) || segs[0].endsWith(”'s"))))
}
[/code]

Thanks, that works.:smile:

Glad to hear! I forgot to mention earlier how to get the The Flasher app. Within IDE > My SmartApps, create a dummy smartapp, and then hit the Browse SmartApp Templates text link in the upper-right. You’ll find The Flasher near the bottom of the scrolling list. Then just Overwrite/Save/Publish.