My Next Tstat

The Unofficial SmartThings Blog
Jump to: navigation, search


Nest T3021US Learning Thermostat, Easy Temperature Control for Every Room in Your House, Copper (Third Generation), Works with Alexa Small

Nest T3021US Learning Thermostat, Easy Temperature Control for Every Room in Your House, Copper (Third Generation), Works with Alexa Small


Brand: Nest®

Models: all Nest Learning Thermostat™: Nest E, Nest thermostats 1,2 &3rd generation

Type: 'Smart Thermostat

Protocol: Wi-Fi

Link to Nest website [1]

Device Type Author:Yves Racine

ST Community handle http://community.smartthings.com/users/yvesracine/activity

Company Link: http://www.ecomatiqhomes.com#!home/mainPage



Contribution is required

The Next devices have required hundreds of hours of development & testing efforts to build, so a mandatory contribution is required to get the code.


To download the code, go to

http://www.ecomatiqhomes.com/store

Technical support packages are also available.


If you want to contribute more, here is the paypal link below.

https://paypal.me/ecomatiqhomes

Prerequisites

  • Nest thermostat operational & connected to Nest Backend via the internet.
  • SmartThings hub fully operational
  • Use of the SmartThings classic mobile app for instantiation of the custom devices (only the basic attributes will display within the new Samsung Connect mobile app as ST is working on the required migration steps).

Information

  • Support of US and metric scale systems (Celsius, Fahrenheit, etc)


Here is a list of ST Capabilities

   capability "Thermostat"
   capability "ThermostatSetpoint"
   capability "ThermostatMode"
   capability "ThermostatFanMode"
   capability "ThermostatOperatingState"        
   capability "Temperature Measurement"
   capability "Relative Humidity Measurement"
   capability "Polling"
   capability "Refresh"
   capability "Sensor"
   capability "Health Check"
   capability "Presence Sensor"


  • Here is the complete list of commands (see the signature in the DTH code, next to command's implementation for details about parameters):
   command "getStructure"
   command "setStructure"
   command "setStructureHome"          // to set your whole Nest structure to home 
   command "setStructureAway"          // to set your whole Nest structure to away
   command "produceSummaryReport"
   command "setETA"                    ex.YourNestTstat.setETA("",“sample-trip-id”,“2018-01-30 23:00:00”,“2018-01-31 23:59:59”)
   command "cancelETA"                 ex.YourNestTstat.cancelETA("",“sample-trip-id”) 
   command "levelUp"
   command "levelDown"
   command "setTemperature", ["number"]
   command "getThermostatList"
   command "getThermostatInfo"
   command "setThermostatSettings"
   command "setHold"
   command "heatLevelUp"
   command "heatLevelDown"
   command "coolLevelUp"
   command "coolLevelDown"
   command "setThermostatFanMode"
   command "setThermostatFanTimer", ["number"]
   command "setTemperatureScale"
   command "setThermostatLabel"
   command "away"                    // to set your whole Nest structure to away and your tstat to eco
   command "present"                 // call the home() method
   command "home"                    // to set your whole Nest structure to home and your tstat to its previous mode (before eco)
   command "eco"                     // to set your tstat to eco mode
   command "getTips"
   command "resetTips"
   command "fanOff"

List of Attributes available for subscription (in any rule engine like CoRE/WebCoRE/SmartRules)

Please refer to the Nest Developer APIs documentation for more details on each attribute.

https://developers.nest.com/documentation/cloud/api-overview

   attribute "structure_id"
   attribute "st_away"
   attribute "st_name"
   attribute "st_country_code"
   attribute "st_postal_code"
   attribute "st_peak_period_start_time"
   attribute "st_peak_period_end_time"
   attribute "st_time_zone"
   attribute "st_eta_begin"
   attribute "st_trip_id"
   attribute "st_estimated_arrival_window_begin"
   attribute "st_estimated_arrival_window_end"
   attribute "st_wwn_security_state"      // value is OK or deter (for deter actions to be trigerred)


   attribute "thermostatId"
   attribute "thermostatName"
   attribute "thermostatsList"
   attribute "thermostatOperatingState"
   attribute "programScheduleName"        // indicate if a 'hold' or 'auto' setpoint adjustment has been made.
                                          // If made by a schedule at Nest, the value of programScheduleName  would be 'schedule'.
   attribute "coolingSetpointDisplay"
   attribute "heatingSetpointDisplay"
   attribute "heatingSetpointRangeHigh"
   attribute "heatingSetpointRangeLow"
   attribute "coolingSetpointRangeHigh"
   attribute "coolingSetpointRangeLow"
   attribute "coolingSetpointRange"
   attribute "heatingSetpointRange"
   attribute "thermostatId"
   attribute "locale"
   attribute "tstat_scale"
   attribute "is_using_emergency_heat"
   attribute "has_fan"
   attribute "software_version"
   attribute "has_leaf"
   attribute "where_id"
   attribute "can_heat"
   attribute "can_cool"
   attribute "target_temperature_c"
   attribute "target_temperature_f"
   attribute "target_temperature_high_c"
   attribute "target_temperature_high_f"
   attribute "target_temperature_low_c"
   attribute "target_temperature_low_f"
   attribute "ambient_temperature_c"
   attribute "ambient_temperature_f"
   attribute "eco_temperature_high_c"
   attribute "eco_temperature_high_f"
   attribute "eco_temperature_low_c"
   attribute "eco_temperature_low_f"
   attribute "is_locked"
   attribute "locked_temp_min_c"
   attribute "locked_temp_min_f"
   attribute "locked_temp_max_c"
   attribute "locked_temp_max_f"
   attribute "sunlight_correction_active"
   attribute "sunlight_correction_enabled"
   attribute "fan_timer_active"
   attribute "fan_timer_timeout"
   attribute "fan_timer_duration"
   attribute "previous_hvac_mode"
   attribute "hvac_mode"
   attribute "time_to_target"
   attribute "time_to_target_training"
   attribute "where_name"
   attribute "label"
   attribute "battery_health"
   attribute "is_manual_test_active"
   attribute "last_manual_test_time"
   attribute "name_long"
   attribute "is_online"
   attribute "last_connection"
   attribute "last_api_check"
   attribute "hvac_state"


   attribute "weatherDateTime"
   attribute "weatherStation"
   attribute "weatherCondition"
   attribute "weatherTemperature"
   attribute "weatherPressure"
   attribute "weatherRelativeHumidity"
   attribute "weatherWindSpeed"
   attribute "weatherWindDirection"
   attribute "weatherPop"

Look & Feel

In Farenheit


MyNextTstatInFP1.pngMyNextTstatInFP2.pngMyNextTstatInFP3.png



In Celsius

MyNextTstatInCP1.pngMyNextTstatInCP2.pngMyNextTstatInCP3.png


List Of Events (refreshed up to the minute!)


MyNextTstatEvents.png


UI Fields

Upper section of the multi-tile

  • Current indoor temperature in the circle
  • Thermostat's Operating state (idle, cooling, heating, fan only)

Lower section of the multi-tile

  • Current indoor Relative Humidity value (secondary key in multi-tile)
  • Thermostat's Operating State appears when it changes.

Lower section of the multi-tile

  • Name of the thermostat
  • Current hvac mode (press to change to cool, heat, auto, eco, off)
  • Current fan mode (press to turn on/off)
  • Current heatingSetpoint with up and down arrows to control it
  • Current coolingSetpoint with up and down arrows to control it
  • Time to Target
  • Lock status (locked or unlocked)
  • Software version (firmware)
  • Nest Last connection - date& time
  • Nest last API check - date& time
  • Refresh (press to get the latest values from Nest)
  • Weather Date and time
  • The current weather conditions
  • The current outdoor temperature
  • The current outdoor Relative Humidity
  • The Probabilty of Precipitation (PoP) in %
  • Google Graph that represents the thermostatMode,RoomTemperature,RoomDesiredTemperature,RoomSetpoint,HumidityLevel over a period of time (week, last 24 hrs).

The button is used to change the view window (past week Vs. last 24 hrs).

Known issues

.................................................................................................................................

The HTLMTile is not officially supported by SmartThings

.................................................................................................................................

My Next Tstat uses the HTMLtile for rendering the graph. As ST is not supporting the HTMLTile, it may not work properly on all devices. This is a ST UI platform issue and not related to my code per se.

It runs properly on all iOS devices (even the Ipod) when javascript is enabled. It is also supported now on all recent Android devices.

To enable javascript on your iOS device, refer to

http://activatejavascript.org/en/instructions/ios

Also, since v2.2.2 of the ST mobile app, most of the Android devices are now supported.

P.S. You can also visualize the graph in the IDE at any time (make sure that javascript is enabled too in your browser).

a) Go to https://graph.api.smartthings.com/ide/devices (or the equivalent shard)

b) Click on My Next Tstat, click on "simulator" on the right and the button under "API URL" as indicated below to launch the rendering.


MyEcobeeDeviceChartInIDE.png


Please contact SmartThings support if you have any HTMLTile issues on your devices.



.................................................................................................................................

Structures are cached

.................................................................................................................................

In order to avoid querying the Nest APIs for the structure data and for better performances, some information is locally cached in the device.

If you make changes to some stucture data and want to update the device immediately (by default, it's done once a day at midnight), please manually press the "refresh" tile.

Troubleshooting

Here are some typical troubleshooting cases explained below. For your specific use cases, you may want to contact the author (there may be some support fees to be applied).'

.................................................................................................................................

Issue #1: I don't know how to create a custom device

.................................................................................................................................

See the explanations of a fellow community member here:

http://community.smartthings.com/t/faq-an-overview-of-using-custom-code-in-smartthings/16772

or

http://thingsthataresmart.wiki/index.php?title=Using_Custom_Code

.................................................................................................................................

Issue #2: I created My Next Tstat handler and MyNextManager in the IDE, but I don't know where to execute it

.................................................................................................................................


For the initial setup, under the ST app, click on the Marketspace? item in the bottom menu, and then, on the smartapps link and finally, MyApps (last item in the list).

If you still do not see your smartapp, please make sure that you have published it in the IDE!

For any subsequent execution, under the ST app, click on the "hamburger" menu in the upper right section and then, Smartapps. You should see the smartapp in the list.'


.................................................................................................................................

Issue #3: I executed MyNextManager smartapp, but the 3rd page -after doing the login, and pressing Next- is blank

.................................................................................................................................

If you get a blank screen after pressing 'Next or you get the following error: " Error - bad state. Unable to complete page configuration" or any other ST errors, please check that you've enabled oAuth as specified in step 2f) in the readme.

https://github.com/yracine/device-type-myNext/blob/master/README.md

Also, make sure that you've followed all prerequisites:

http://thingsthataresmart.wiki/index.php?title=My_Next_Tstat#Prerequisites

Refer to MyNextManager smartapp's installation for more details:

http://thingsthataresmart.wiki/index.php?title=MyNextServiceMgr#Issue_.231:_I_don.27t_know_how_to_create_a_custom_smartapp

.................................................................................................................................

Issue #4: My Next Tstat is off by 'x' units with the Nest mobile app or portal

.................................................................................................................................

First try to refresh the UI by pressing the 'refresh' tile. The ST UI does not allow automatic refresh at the moment.

Please note also that the cloud-to-cloud integration may introduce some delays in getting the latest values.


.................................................................................................................................

Issue #5: I want to disable any notifications from MyNextManager

.................................................................................................................................

Go to the smartapp's last page, and answer 'no' to the following question:

Send a push notification?"''

Be aware that you won't be notified of any connection issues.

.................................................................................................................................

Issue #6: "An unexpected error has occurred" or 'deleteObserver onError: %s' messages in MyNextManager when I press 'Remove'

.................................................................................................................................

'Like any ST connected device, you need first to unselect all your Next devices from all the smartapps & routines as MyNextManager will not uninstall w/o doing this step.

MyNextManager is the Service Manager for all Next Devices, so uninstalling the smartapp means that all Next devices will be deleted. .................................................................................................................................

Issue #7: I want to get more tracing in the IDE

.................................................................................................................................

Just update the device preferences, and edit the trace parameter, see step 7 in the readme

https://github.com/yracine/device-type-myNext/blob/master/README.md

Do not forget to remove the trace (leave the parameter blank) after your debugging session as this setting may impact performance.


You can now set the trace level to be displayed in the device's preferences (5 is the highest level for logging):

    input("trace", "bool", title: "trace", description:
      "Set it to true to enable tracing (no spaces) or leave it empty (no tracing)")
    input("logFilter", "number",title: "(1=ERROR only,2=<1+WARNING>,3=<2+INFO>,4=<3+DEBUG>,5=<4+TRACE>)",  range: "1..5",
      description: "optional" )        

Under the IDE, to activate live logging, just click on the link below (or the variant according to your shard).

https://graph.api.smartthings.com/ide/logs

You can also edit the device's preferences under the ST mobile app by clicking on its 'gear' button.


Note: To filter the logs for a given device or smartapp, you need to click on its name in the upper section of live logging. This filtering should be done before submitting any logs for analysis.


.................................................................................................................................

Issue #8: I want to upgrade the code but I don't know how.

.................................................................................................................................

Most of the time (unless specified otherwise), you just need to copy and paste the MyNextTstat Device's code from the the related txt files, and save & publish.

The same approach should be used for the smartapps.

For more details, please follow the instructions provided at:

https://github.com/yracine/device-type-myNext/blob/master/README.md


.................................................................................................................................

Issue #9: java.util.concurrent.TimeoutException: Execution time exceeded 'x' app execution seconds

.................................................................................................................................

ST has introduced some generic rate limiting rules for all smartapps and device handlers.

For cloud-to-cloud integration, these rate limiting constraints are sometimes too low (due to network latency, servers involved, etc.), and this exception can be raised from time to time. There are some threads about it in the ST community forum:

http://community.smartthings.com/t/rate-limiting-too-restrictive-max-execution-time-exceptions/17985

http://community.smartthings.com/t/execution-times-increasing/19979

http://community.smartthings.com/t/unschedule-api-execution-time-too-long/11232


................................................................................................................................

Issue #10: com.datastax.driver.core.exceptions.ReadTimeoutException

.................................................................................................................................

These exceptions are thrown by the ST backend from time to time. I've been told that ST is working on it. This is not a specific issue with my code.

https://community.smartthings.com/t/cassandra-timeout-during-read-query/46227/3

...............................................................................................................................

Issue #11: I want to change all scales to the metric system

.................................................................................................................................


The temperature scale needs to be changed for your ST account under the ST Mobile app, so that all your ST devices will be in the metric system.

Press the "hamburger" menu (upper left), and then the "gear" icon. You'll find the option to change the temperature scale there and press "save".

At the next "refresh", My Next Tstat will display the values in the metric system.

P.S. If you use the new Samsung app, you may have to press refresh tile and the up and down arrows in the ST classic app to force a refresh of the values under the new Samsung app as the app has a different cache than the ST classic app.


...............................................................................................................................

Issue #12: I cannot create any objects under the new Samsung app

.................................................................................................................................


No custom DTHs can be created under the new Samsung app for the moment as indicated in the prerequisites. You'd need to use the ST classic app to execute MyNextManager in order to create the Next devices. After creating the devices, follow the steps indicated in the installation pdf file included in the zip to force a refresh of the cache in order to make them appear correctly in the new Samsung app.


...............................................................................................................................

Issue #13: Some of my devices under the new Samsung app are disconnected

.................................................................................................................................


If some of your Next devices are disconnected under the new Samsung app, you may have created many of the same devices by executing MyNextManager too many times... Under the new Samsung mobile app, you then need to clean them up by pressing the "edit" button next to your location and removing them.

For further execution of the MyNextManager smartapp, Refer to issue #2 http://thingsthataresmart.wiki/index.php?title=My_Next_Tstat#Issue_.232:_I_created_My_Next_Tstat_handler_and_MyNextManager_in_the_IDE.2C_but_I_don.27t_know_where_to_execute_it