Nest device type with a bunch of new features

Updated Nest Device Type

I am a new convert to SmartThings, and I needed a simple project to get familiar with writing custom smartapps and device types. I found a few things that I wanted to change for Nest support, so it seemed like a good way to learn. I forked @Dianoga Nest device type (https://github.com/smartthings-users/device-type.nest) and started tinkering. Well, I got a little carried away, but I now have an updated Nest device type that has quite a long list of new features. For anyone that’s interested, my fork is available at https://github.com/notoriousbdg/device-type.nest.

Change Log:

  • Renamed range to auto so the Nest Device Type works with existing SmartApps for thermostats.
  • Added heating set point slider as needed by auto mode (aka range mode).
  • Changed many icons to make them easier to read.
  • I made the away mode function as a presence sensor. Any device that supports presence can be used to see home/away mode. This can be useful to trigger smartapps when the Nest goes into or out of auto away mode.
  • Added support for thermostatOperatingState property. I only have cooling, heating, fan only, and idle setup due to the limited options available for the thermostatOperatingState property.
  • Added new tile to show the thermostatOperatingState property.
  • Switching between Fahrenheit and Celsius is now exposed via a tile. Switching from Fahrenheit to Celsius and back is performed by pressing on the new temperature units tile.
  • I made the temperature tile change colors for both Celsius and Fahrenheit. Due to the way I implemented it, the colors won’t work correctly below 40 degrees in Fahrenheit mode, but that seems unlikely to occur inside a home.
  • There is a option to manually switch from using sliders to buttons. All that is required is to comment out the slider only section, uncomment the button only section, and re-publish.
  • Added ability to change the the main tile between temperature, operating state, and humidity.

The first screenshot shows my Nest as Fahrenheit, away, and idle. The second screenshot shows my Nest as Celsius, present, and cooling. The last screenshot is the activity feed showing off some of the new features.

Enjoy!

P.S. Let’s hope official Nest supports comes soon


15 Likes

wow. Looks pretty good. I’ll have to experiment with it when I get home.

This looks great.

I think some people are going to be disappointed with the official integration once it is finally released since there is a lot of information that just isn’t available from the official API.

Well lets hope Nest updates their API over time to make the integration better. One thing about software is it can always be made better.

1 Like

Thanks for the code, it is great! Have you actually been able to adjust the target temp on the Nest using the slider? I can see the command is sent to the Nest in the event log, but the target never changes on the Nest itself.

So I added the device type and then added my upstairs and downstairs Nests. The Things tile shows it as connected based on the activity logs and I see that they are reporting humidity and a few other things. However, they are not reporting temp. All I see is state, mode, dan mode, and humidity. I have tried refreshes as, but that hasn’t updated with anything new.

Anyone else run into this issue?

I am having the exact same behavior. Temps were displayed earlier today, but are no longer there. I have removed and readded the device numerous times with no change.

OK, so not just me. Perhaps this is related to all the backend work that ST is doing?

Calling SmartWeatherTile.supportedAttributes throws error “GroovyCastException: Cannot
cast object ‘temperature’ with class ‘physicalgraph.device.cache.AttributeDTO’ to class ‘physicalgraph.device.Attribute’”.

Something must have changed with temperature object.

I just tested mine again and both sliders work for me. Are you still having issues?

I’m still not seeing any temps in either of my tiles. Activity is still only showing humidity and operating state.

I’m still having trouble. Only the humidity is displaying. No temp; sliders are ineffective.

I came across this code today, and I liked the idea of the button controllers. Sliders are just too finicky for me. I replaced the Nest device type code I had been using with my two Nests, but I’m running into some problems.

First, the temperatures weren’t showing up. This appears to be related to the F/C setting somehow. I stumbled across a way to get it working, which was to tap the temperature setting once, which switched it to C (this made the temperatures show up), then tap it a second time to set it back to F.

Second, the buttons do not seem to actually change the setpoint. The network activity indicator in my iPhone’s status bar spins briefly when I tap, so it seems like it’s attempting to do something, but the setpoint displayed in the app doesn’t change nor does the setpoint shown in the official Nest app.

Third, the home/away toggle is not working correctly. I tapped the button when it said “Present”. Again, the network activity in the status bar spun, but the icon on the button did not change. I flipped over to the Nest app, and it did in fact show that Away mode had been activated. The button in the ST device never updated to reflect the change in state, though, and that prevented me from being able to toggle back to Home mode. I had to use the Nest app.

Fourth, the heating setpoint is not colored in red as shown in the screenshot. Small cosmetic issue, but I wonder why the difference.

I should add that my system is heat only, as well as radiant only. I don’t know if it’s possible that any of the above issues are related to that difference.

On a side note, it would be nifty if someone had the chance to update the device implementation so that cooling and fan controls could be ignored based on a preference for those of us whose systems don’t involve them. I know this stuff is all volunteer/scratch your own itch, so I’m just tossing that out there in case someone who’s better at this than I might want to take a crack at it.

The tapping of the thermometer to change from F to C and back to F worked! I now have temps for both Nests. I’m sure that tidbit will be helpful for @notoriousbdg to debug? Thanks!

Thanks for all the feedback. I just updated the code with a couple fixes.

  1. Fixed the issue that preventing setting the heating set point when running in heat mode. The fix also addresses tile display issues when running in cool mode.
  2. Set default units to Fahrenheit, which fixes tile display issues when temperature unit is not set.

The fixed version is available at https://github.com/notoriousbdg/device-type.nest.

I don’t see red and blue color for temp tiles. Do I need to set something else to see it ?

Thanks for the fix! It works great!

Third, the home/away toggle is not working correctly. I tapped the button when it said “Present”. Again, the network activity in the status bar spun, but the icon on the button did not change. I flipped over to the Nest app, and it did in fact show that Away mode had been activated. The button in the ST device never updated to reflect the change in state, though, and that prevented me from being able to toggle back to Home mode. I had to use the Nest app.

@tamaracks, I am not able to reproduce this issue. The tile changes immediately for me. I have presence alerts setup to notify me when my Nests switch between present and away, and those fire immediately too.

On a side note, it would be nifty if someone had the chance to update the device implementation so that cooling and fan controls could be ignored based on a preference for those of us whose systems don’t involve them. I know this stuff is all volunteer/scratch your own itch, so I’m just tossing that out there in case someone who’s better at this than I might want to take a crack at it.

@tamaracks, you can remove thermostatFanMode, coolingSetpoint, coolSliderControl, coolingSetpointDown, and coolingSetpointUp from the details line in the tiles definition section and rearrange the order until you like the way they show. The code will still be in the device type, but the tiles that you don’t want to see will be hidden.

Example for sliders:

details(["temperature", "thermostatOperatingState", "humidity", "thermostatMode", "presence", "temperatureUnit", "heatingSetpoint", "heatSliderControl", "refresh"])

Example for buttons:

details(["temperature", "thermostatOperatingState", "humidity", "thermostatMode", "presence", "temperatureUnit", "heatingSetpointDown", "heatingSetpoint", "heatingSetpointUp", "refresh"])

What does it take to update the device type code for a device? I pasted in the new code to the device type on the web, saved it, and published it for me, but it doesn’t actually seem to be taking effect when I look at my Nests in the ST app. I tried making some changes to the tiles and those aren’t being reflected in the app.

The tiles seem to render differently depending on your OS (Android, IOS, and the simulator). I’m pretty new to SmartThings and I’m an Android user, so I don’t know all of the differences yet. What OS are you using to run the SmartThings mobile app?