Warning on Temp


(Cj) #1

Anyone write an App that requests a temperature and an "Over/Under setting that will Notify, and maybe even trigger an alarm if the temperature from a Multi-Sensor goes above or below the set value?

I have a hydro-air heating system that uses water lines in the attic to bring heat to the second floor and would like a way to know if the lines are going cold. Basically anything under 50 degrees is an indication of something bad.

Thanks


(Egarl005) #2

Here ya go!

/**

preferences {
section(“Choose a temperature sensor”){
input “sensor”, “capability.temperatureMeasurement”, title: “Sensor”
}

section("High Limit") {
	input "highTemp", "number", title: "High Boundary"
}
section("Low Limit"){
	input "lowTemp", "number", title: "Low Boundary"
}
section("Text this number...") {
	input "phoneNumber", "phone", title: "enter your number", required: false
}

}

def installed() {
subscribe(sensor, “temperature”, temperatureHandler)
}

def updated() {
unsubscribe()
subscribe(sensor, “temperature”, temperatureHandler)
}

def temperatureHandler(evt) {
def currentTemp = sensor.latestValue(“temperature”)
if (currentTemp >= highTemp) {
sendSms(phoneNumber, “Your ${sensor} is running hot”)
sendPush(“Your ${sensor} is running hot”)
}
if (currentTemp <= lowTemp) {
sendSms(phoneNumber, “Your ${sensor} is running cold”)
sendPush(“Your ${sensor} is running cold”)
}
}


(Cj) #3

Thanks.


(Chrislindinger) #4

nice!


(Ross Peterson) #5

I’m embarrassed to admit this…but I can’t seem to figure out how to install this custom app. Can anyone set me on the right path? Thanks in advance. :slight_smile:


(Jay) #6

Ross, you need to sing up as a ST developer, then access the developer tools. There you’ll find a place where to write an app. after entering the code above, you can “publish it” then it becomes available to install in your ST hub…


(Ross Peterson) #7

Ah…nevermind…I think I got this figured out inside the IDE. For anyone else copying/pasting…be sure to clean up the quote marks and elipses. :slight_smile:


(Ross Peterson) #8

Thanks for the response Jay. I did get this working and had just missed the step to publish to one’s self. All is well. I stuck this in the freezer to test and got the notifications once my temp had gone below 50 deg F. Then I kept getting messages…I assume at each polling of the temp. At some point I can see value in an app that allows the user to limit how often they get notified…but what is here will work for me for now unti I try my hand at the programming modifications down the road.

Thanks for the help!