ST Temperature control for making beer


(Erin) #1

Ok, so I have the GE plug connected to the Kegerator and the ST Multi in the Kegerator.

I would like to find/write a smartapp that can:

  • set high temp and low temp for ~5° variance (i.e., 62°–67°) and switch on/off the GE switch
  • text or notify me if the temperature goes 10° above or below the set temps
  • for over 60 mins text or notify me if the door is left open

Is there an existing smartapp that could be modified? Where would I find it? If not, I guess i’ll have to learn to create it. FYI - I am a noob coder. Any pointers on where to begin?

This is to control the Kegerator so I can control the temperature for lagering a homemade brew, which require set temps for long periods of time.

Any and all help will be rewarded with a Maibock*.

*must reside in Austin, TX, and delivery not included.


(Edward Pope) #2

In the developer area there is a SmartApp that could be readily modified to work for your needs. Called Virtual Dehumidifier. I am going to attempt to place the code here. If it doesn’t show for you, go to the developer section and look under green living for VIrtual Dehumidifier.

definition(
    name: "Virtual Dehumidifier",
    namespace: "My Apps",
    author: "Barry Burke",
    category: "Green Living",
    description: "Turns on a humidifier when humidity gets too high, back off when it reaches the target again.",
    iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
    iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png"
)

preferences {
	section("Humidity") {
		input "humiditySensor", "capability.relativeHumidityMeasurement", title: "Which Sensor?"
		input "desiredHumidity", "number", title: "Desired Humidity?"
        input "dehumidifierSwitch", "capability.switch", title: "Which Switch?"
	}
}

def installed() {
	initialize()
}

def updated() {
	unsubscribe()
    initialize()
}

def initialize() {
	subscribe(humiditySensor, "humidity", humidityHandler)
    log.debug "Initialized... current humidity is ${humiditySensor.latestValue("humidity")}%, max humidity is ${desiredHumidity*1.05}, dehumidifier is ${dehumidifierSwitch.latestValue( "switch" )}"
    dehumidifierSwitch.poll() 			// Update power display
}


def humidityHandler(evt) {
	log.debug "Humidity: $evt.value, $evt"
    
	if (Double.parseDouble(evt.value.replace("%", "")) <= desiredHumidity) {
    	if ( dehumidifierSwitch.latestValue( "switch" ) != "off" ) {
        	log.debug "Turning dehumidifier off"
        	dehumidifierSwitch.off()
        }
    }
    else if (Double.parseDouble(evt.value.replace("%", "")) > desiredHumidity ) {
    	if ( dehumidifierSwitch.latestValue( "switch" ) != "on" ) {
        	log.debug "Turning dehumidifier on"
            dehumidifierSwitch.on()
        }  
    }
    else {
    	log.debug "Current humidity is ${evt.value}"
    }
    dehumidifierSwitch.poll()				// every time the humidity changes, poll the switch for power updates
}

(Tim Slagle) #3

Give this a shot. I was in the process of modifying the code when @theedpope posted it :smile:

definition(
    name: "Virtual Temp Controller",
    namespace: "tslagle13",
    author: "Tim Slagle/Barry Burke",
    category: "Green Living",
    description: "Turns on a switch when temp gets too high, back off when it reaches the target again.",
    iconUrl: "http://icons.iconarchive.com/icons/icons8/windows-8/512/Science-Temperature-icon.png",
    iconX2Url: "http://icons.iconarchive.com/icons/icons8/windows-8/512/Science-Temperature-icon.png"
)

preferences {
    section("Humidity") {
        input "tempSensor", "capability.temperatureMeasurement", title: "Which Sensor?"
        input "desiredTemperature", "number", title: "Desired Temperature?"
        input "tempSwitch", "capability.switch", title: "Which Switch?"
    }
}

def installed() {
    initialize()
}

def updated() {
    unsubscribe()
    initialize()
}

def initialize() {
    subscribe(tempSensor, "temperature", tempHandler)
    log.debug "Initialized... current humidity is ${humiditySensor.latestValue("humidity")}%, max humidity is ${desiredHumidity*1.05}, dehumidifier is ${dehumidifierSwitch.latestValue( "switch" )}"
    tempSwitch.poll()             // Update power display
}


def tempHandler(evt) {
    log.debug "temp: $evt.value, $evt"

    if (Double.parseDouble(evt.value.replace("%", "")) <= desiredTemperature) {
        if ( tempSwitch.latestValue( "switch" ) != "off" ) {
            log.debug "Turning ${tempSwitch} on"
            tempSwitch.off()
        }
    }
    else if (Double.parseDouble(evt.value.replace("%", "")) > desiredTemperature ) {
        if ( tempSwitch.latestValue( "switch" ) != "on" ) {
            log.debug "Turning ${tempSwitch} on"
            tempSwitch.on()
        }  
    }
    else {
        log.debug "Current temp is ${evt.value}"
    }
    tempSwitch.poll()                // every time the temp changes, poll the switch for power updates
}

(Erin) #4

EDIT: figured it out.


(Tim Slagle) #5

Sweet! Let me know if you run into any issues.

Glad to see another tinkerer on the forums!!!


(Erin) #6

Looks like its working.

Now I want to figure out how to do a door left open and max. temp alert.

Thanks for the help!


(Tim Slagle) #7

Those are all configurable through the dashboard in the app :smile:

Damage and danger for the temps and then doors for the door stuff.

Just hit the gear icon in the top right under both those sections to get started.


(Erin) #8

I know they can be. I am trying to wrap my head around the ST stuff.

Wouldn’t it be better to have single SmartApp that has more functionality built in, then have several working to do one thing (i.e., monitor and control a fridge).

The ST iPhone app is confusing to say the least IMO.


(Tim Slagle) #9

They are working on a rule builder. so that should be coming soon :smile:

Soon you’ll be able to build a rule that says if it gets above this temp notify me and turn XYZ Switch. Did you want the app you jsut isntalle to notify you? I can build that in for you.


(Erin) #10

Let me take a shot at it, and see if I can figure it out. But will most likely hit you up for help. Thanks.


(Erin) #11

Where is this exactly? Is it a list of apps?

Am I blind?


(Tim Slagle) #12

In an app code window. Top right. Shared apps. Browse shared apps. Have fun!!:slight_smile:


(Edward Pope) #13

Yes what @tslagle13 said :smile:
Have lots of fun.