Help adding Nest into ST


(Bdjl2011) #1

Hello all,
Need help finishing my Nest addition into ST.

It shows as one of the last steps, to go back in to the list of Devices, click the Nest that you added, and then hit “Edit, next to Preferences”. I actually see nowhere where those 2 buttons are. I am at the point where I am looking to put the Nest’s serial number in.

Where specifically am I putting this? Inside the web console that I built this all in, or within the iOS app? Can anyone clarify with a little more detail? The instructions generically say to put in all your info… Besides serial number, are there other specific things that have to go in so ST will recognize my Nest?


(Cory S) #2

You open the device, and just click the highlighted edit button to add that information.


(Bdjl2011) #3

I think I got it figured out, but also a question now too.

FYI, when you create the Device Type and hit save, it puts this code in on the following screen:

/**
 *  N2
 *
 *  Author: dianoga7@3dgo.net
 *  Date: 2014-03-09
 */
 // for the UI
metadata {
	simulator {
		// TODO: define status and reply messages here
	}

	tiles {
		// TODO: define your main and details tiles here
	}
}

// parse events into attributes
def parse(String description) {
	log.debug "Parsing '${description}'"
	// TODO: handle 'temperature' attribute
	// TODO: handle 'heatingSetpoint' attribute
	// TODO: handle 'coolingSetpoint' attribute
	// TODO: handle 'thermostatSetpoint' attribute
	// TODO: handle 'thermostatMode' attribute
	// TODO: handle 'thermostatFanMode' attribute
	// TODO: handle 'thermostatOperatingState' attribute
	// TODO: handle 'humidity' attribute
	// TODO: handle 'presence' attribute

}

// handle commands
def poll() {
	log.debug "Executing 'poll'"
	// TODO: handle 'poll' command
}

def setHeatingSetpoint() {
	log.debug "Executing 'setHeatingSetpoint'"
	// TODO: handle 'setHeatingSetpoint' command
}

def setCoolingSetpoint() {
	log.debug "Executing 'setCoolingSetpoint'"
	// TODO: handle 'setCoolingSetpoint' command
}

def off() {
	log.debug "Executing 'off'"
	// TODO: handle 'off' command
}

def heat() {
	log.debug "Executing 'heat'"
	// TODO: handle 'heat' command
}

def emergencyHeat() {
	log.debug "Executing 'emergencyHeat'"
	// TODO: handle 'emergencyHeat' command
}

def cool() {
	log.debug "Executing 'cool'"
	// TODO: handle 'cool' command
}

def setThermostatMode() {
	log.debug "Executing 'setThermostatMode'"
	// TODO: handle 'setThermostatMode' command
}

def fanOn() {
	log.debug "Executing 'fanOn'"
	// TODO: handle 'fanOn' command
}

def fanAuto() {
	log.debug "Executing 'fanAuto'"
	// TODO: handle 'fanAuto' command
}

def fanCirculate() {
	log.debug "Executing 'fanCirculate'"
	// TODO: handle 'fanCirculate' command
}

def setThermostatFanMode() {
	log.debug "Executing 'setThermostatFanMode'"
	// TODO: handle 'setThermostatFanMode' command
}

def auto() {
	log.debug "Executing 'auto'"
	// TODO: handle 'auto' command
}

def away() {
	log.debug "Executing 'away'"
	// TODO: handle 'away' command
}

def present() {
	log.debug "Executing 'present'"
	// TODO: handle 'present' command
}

def setPresence() {
	log.debug "Executing 'setPresence'"
	// TODO: handle 'setPresence' command
}

What exactly is this code above? It’s only about 112 lines, vs. looking out on GitHub and what appears to be the latest full code and 313 lines of code:

Can anyone explain if I am supposed to do anything with these 112 lines of code and add or replace the full code?


(Brian Steere) #4

Just replace the code created by the editor.


(Gpajak) #5

I got this to work to add my Nest, but the temp is in °F. How can i change this to read °C? I use celsius up here in Canada


(Chris K) #6

Looking at the code you should be able to:

  1. Update “def cToF(temp)” to just return temp, i.e. no conversion
  2. Same for “def fToC(temp)”

Looks like Nest is native Celsius, so the device hander is converting to/from C which you don’t want for native celsius.

Then if you want the background colours to be “correct” update lines 73-79 and 96-102 to have equivalent Celsius values:
31 is approx 0
44 is approx 7
59 is approx 15
74 is approx 23
84 is approx 29
95 is approx 35
96 is approx 36

That would be a quick “hack”. Proper way would be to allow unit to be a preference setting.


(Gpajak) #7

Perfect. thanks for the code changes. Seems to works fine now.


(Gpajak) #8

One other question. Is there a way to change the temp change slider to a “Set Temp Increase” and “Set Temp Decrease” tap buttons with some sort of arrow or direction indication instead (maybe the direction indication in place of “increase” or “decrease”)? I find that buttons are better (for myself anyway)


(Huy Nguyen) #9

Anyone else notice the instructions or code seem to be missing something? I recently got my ST setup and started with getting my garage door hooked up, which works amazingly. I moved on to connecting my Nest and followed the steps to the tee and it didn’t work. For the life of me I couldn’t figure it out.

I then noticed that the code generated once you create the device type in the ST IDE has the following code under the metadata section which is missing from the code provided on GIT:

definition (name: “Nest”, author: "dianoga7@3dgo.net") {
capability "Polling"
capability "Thermostat"
capability “Relative Humidity Measurement”

	attribute "presence", "string"

	command "away"
	command "present"
	command "setPresence"
}

Once I added that to the code provided here: https://github.com/smartthings-users/device-type.nest/blob/master/nest.devicetype.groovy and pasted that all back into the device on the ST IDE, saved and published, created the device, set the preferences, it seemed to start working .

Not sure if the above code is now required due to a change in with ST or it was a step that I missed. I’m going to keep testing to see if what I did actually allows for everything to work, so far so good.


(Dane) #10

Am missing something :), how do I add nest to st hub to begin with, thanks.


(Boris M) #11

You dont add it to ST hub, nest is a wifi device. What you are doing you are telling ST cloud to communicate with NEST cloud using your id, password and serial number of your thermostat, so to speak.


(fightingmajor) #12

I have tried to get this to work at least 10 times or so and I just can’t seem to get it to see and talk to my nest.