Temperature Alert below 32 degrees?

Hello I placed an Iris Contact sensor in my freezer so I could use it to trigger an alert if the temp raised. When I tried to set that up the lowest trigger point allowed is 32F. I’d like to set it at about 20F so I catch it before everything is thawed out. Is there a way to do that?
Thanks
Jerry

You’re not going to like this…

  1. Download and log in to the smartthings classic app. See my warning below.
  2. Tap"automation" at the bottom of the app. Scroll down to the bottom and tap “add a smart app”.
    3 Tap “smartthings recommends”, then “smart home monitor - custom”
  3. Tap “custom”, “new”, and follow the prompts to make a temperature sensor rule. You’ll be able to specify the temp without the limits of the new app.

Why “you’re not going to like this”? Because, when I did this, loading both apps caused duplicate “home” locations to be generated, and it was a pain to make sure all my devices we’re in the same location, make that location default, and delete the unneeded location. Others have complained about similar problems, so it may have been fixed by smartthings, but consider yourself warned.

1 Like

you can certainly modify the NotifyMeWhen smartapp for your purpose by having temperature event read for your sensor. when it reaches above 20F, trigger the event/notification

Thanks Philippe and Tleroy.
I have already downloaded both the new and classic apps and it doesn’t seem to have caused me any trouble yet although I am primarily working through the new app.

The NotifyMeWhen smartapp sounds like a good solution. But I’m a newbie at Smartthings and I have no idea what this really means. Doesn’t appear to be an app from the App Store. I see SmartApps in the Classic app at least but I don’t see this particular one. Is this something I can add somehow? Can I only use it in the Classic app? Any help and guidance is much appreciated.
Thanks
Jerry

This is a smartapp available to install from the classic app. You can find it in marketplace, smartapps, safety & security section.

1 Like

How do I modify the NotifyMeWhen smartapp to add an automated message when the temp goes above a certain limit? I don’t see an obvious solution.
Thanks!

  1. Log in the SmartThings IDE https://graph.api.smartthings.com/
  2. Select your Home location by clicking it in https://graph.api.smartthings.com/location/list (don’t forget to do that every time you log to the IDE)
  3. Go to the My Smartapp section https://graph.api.smartthings.com/ide/apps
  4. Click the +Create Smartapp blue button
  5. Click the “From Template” tab
  6. Click the "Notify Me When: in the list on the left
  7. Copy/Paste in the code window everything by my quick and dirty patched version below:
/**
 *  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.
 */
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",
		pausable: true
)

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
        // PPO
        input "temperature", "capability.temperatureMeasurement", title: "Temperature Sensor", required: false, multiple: true
        // PPO
	}
	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 "phone", "phone", title: "Enter a phone number to get SMS", required: false
			paragraph "If outside the US please make sure to enter the proper country code"
			input "pushAndPhone", "enum", title: "Notify me via Push Notification", 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(button, "button.pushed", eventHandler) //tw
	subscribe(contact, "contact.open", eventHandler)
	subscribe(contactClosed, "contact.closed", eventHandler)
	subscribe(acceleration, "acceleration.active", eventHandler)
	subscribe(motion, "motion.active", eventHandler)
	subscribe(mySwitch, "switch.on", eventHandler)
	subscribe(mySwitchOff, "switch.off", eventHandler)
	subscribe(arrivalPresence, "presence.present", eventHandler)
	subscribe(departurePresence, "presence.not present", eventHandler)
	subscribe(smoke, "smoke.detected", eventHandler)
	subscribe(smoke, "smoke.tested", eventHandler)
	subscribe(smoke, "carbonMonoxide.detected", eventHandler)
	subscribe(water, "water.wet", eventHandler)
    //PPO
    subscribe(temperature, "temperature", eventHandler)
	//PPO
}

def eventHandler(evt) {
	log.debug "Notify got evt ${evt}"
    log.debug evt
	if (frequency) {
		def lastTime = state[evt.deviceId]
		if (lastTime == null || now() - lastTime >= frequency * 60000) {
			//PPO
            if (evt.name=="temperature" && evt.value.toFloat() > 20.0)
            	// Temp above 20
            	sendMessage(evt)
            else if (evt.name!="temperature")
            //PPO
            	sendMessage(evt)
		}
	}
	else {
    		//PPO
            if (evt.name=="temperature" && evt.value.toFloat() > 20.0)
            	// Temp above 20
            	sendMessage(evt)
            else if (evt.name!="temperature")
            //PPO
				sendMessage(evt)
	}
}

private sendMessage(evt) {
	String msg = messageText
	Map options = [:]

	if (!messageText) {
		msg = defaultText(evt)
		options = [translatable: true, triggerEvent: evt]
	}
	log.debug "$evt.name:$evt.value, pushAndPhone:$pushAndPhone, '$msg'"

	if (location.contactBookEnabled) {
		sendNotificationToContacts(msg, recipients, options)
	} else {
		if (phone) {
			options.phone = phone
			if (pushAndPhone != 'No') {
				log.debug 'Sending push and SMS'
				options.method = 'both'
			} else {
				log.debug 'Sending SMS'
				options.method = 'phone'
			}
		} else if (pushAndPhone != 'No') {
			log.debug 'Sending push'
			options.method = 'push'
		} else {
			log.debug 'Sending nothing'
			options.method = 'none'
		}
		sendNotification(msg, options)
	}
	if (frequency) {
		state[evt.deviceId] = now()
	}
}

private defaultText(evt) {
	if (evt.name == 'presence') {
		if (evt.value == 'present') {
			if (includeArticle) {
				'{{ triggerEvent.linkText }} has arrived at the {{ location.name }}'
			}
			else {
				'{{ triggerEvent.linkText }} has arrived at {{ location.name }}'
			}
		} else {
			if (includeArticle) {
				'{{ triggerEvent.linkText }} has left the {{ location.name }}'
			}
			else {
				'{{ triggerEvent.linkText }} has left {{ location.name }}'
			}
		}
	} else {
		'{{ triggerEvent.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"))))
}
  1. Click “Create” button, then on the next screen, click “Save” and “publish” “for me”
  2. Take you phone, in the Mobile App, go on the “Automation” section, “SmartApp”, go down the list, click “Add a SmartApp”, down the list click “my Apps”, click on “Notify Me When”, select your sensor in the “Temperature” setting, save.
  3. Enjoy (except I coded wrongly…). You will find in the code the 20 I used. If you want another value, just replace

The SmartThings v3 app (the new app) allows custom trigger of temps between 14 to 122 F.

Automations then plus sign and then Custom Automation.

Thanks everyone.

HA_Fanatic: I believe I am using the the most recent version of the app or at least I don’t see a newer one in the app store. The version I have is 1.6.33. It still has a temp range of 32-104F. Are you using a beta version?

Philippe_Portis: I am going to try out your method. Looks like a good learning opportunity for me.

Thanks again everyone!

1 Like

I am on Android, are you iOS?

I am using iOS. Must be different for some reason.

ouch, nice inconsistency. Very odd :frowning: Good luck getting “Notify Me When” up and running. Is not as bad is it seems, once you do it once :slight_smile:

Philippe: I tried to follow your instructions and got the following error:

startup failed: script_app_metadata_4c876a72_a9c7_405f_8c6a_dae8fd91e7f7: 182: expecting ‘}’, found ‘’ @ line 182, column 127. ) || segs[0].endsWith("'s")))) ^ 1 error

I have no experience or knowledge of coding so I’m not sure what this error means.

When I tried this I copied everything in the patch code you had and highlighted everything in the code window in the IDE and then pasted. I did change the event value from 20.0 to 15.0. Then hit create and got the above error message.

What did I do wrong?

Thanks
Jerry

Ignore the issue about the error in the code. I found an extra space that caused the error and was able to publish it. This was reminding me of my Fortran 77 days in engineering college a few decades ago.
My next issue: On Step 9 in your instructions I can’t see a line for “Temperature” setting.
Thanks for all the help and your patience!
Jerry

2 Likes

Never mind on the last issue. I was able to figure it out. Somehow, it didn’t save the code I pasted over from your post. I was able to modify the smartapp code and successfully saved and published and then activated in my Classic App.
Thanks for all the help and your patience!

1 Like

You solved all your issues by yourself so you are on the good way to do great things in Smarthings.

If you want to learn how to code things, you can try to add a preference setting and replace the hardcoded 20 I put in the code. This will make you familiar with inputs, preferences. This is well documented and exampled in the https://docs.smartthings.com/en/latest/ref-docs/reference.html

Enjoy!

@derby @HA_fanatic
This is an old thread, but I wanted to bump it as I may have found the reason you were seeing different allowable ranges.
I came across this thread last night because I was trying to do the same thing…set a freezer alarm. I found that I could only set a low point of 32F…but as I checked my other sensors I found some were 4F!
ST button (the small square push button): 32F
ST contact/multipurpose: 4F
ST water leak: 4F

I submitted a problem report in the ST app asking them to make the button 4F like the others. I have no idea if they will…but I’m also thinking that 32F might be the design spec min temperature for the button, which is why they used that value.