MyEcobee Switch

The Unofficial SmartThings Blog
Jump to: navigation, search


ecobee Switch+ Smart Light Switch, Amazon Alexa Built-in

ecobee Switch+ Smart Light Switch, Amazon Alexa Built-in

Brand:Ecobee

Model: Ecobee Switch+

Type:smart switch with Alexa Integration

Protocol:Wi-Fi

Link to ecobee 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


Contents

Notes to MyEcobee Users - Contribution is now required

MyEcobee device, My Ecobee Switch and related smartapps have required thousands of hours of development & testing efforts to build (around 6000 lines of code just for the thermostat), so a minimum financial contribution is now required to get the latest code.


You can now download MyEcobee Device and Switch's code at my store as part of My Ecobee Bundle package at:

'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

Github integration for the complimentary apps

For the related complimentary smartapps, refer to this brief tutorial on how to integrate ST with github (1st post):

https://community.smartthings.com/t/faq-github-integration-how-to-add-and-update-from-repositories/39046

GitHub Settings:

Owner: yracine

Name: SmartThingsPublic

Branch: master

All of my smartapps are at the end of the "new (only at github)" window.

You can also copy and paste (manually) them from my github.

https://github.com/yracine/device-type.myecobee/tree/master/smartapps

In any case, you'd need to save & publish at the end.



Article(s) in the media

  http://m.imore.com/using-ecobee-3-smartthings
  http://www.connectedly.com/ecobee3-review
  http://medium.com/@KeenHome/smartthings-and-smart-vents-5a61234fa7a3#.19lf2bqz6
  https://iotrant.com/2018/08/15/making-smartthings-and-ecobee-play-better-together/

Prerequisites

  • ecobee switch+ connected via wi-fi to ecobee
  • SmartThings hub fully operational
  • Some ST basic skills to add custom DTH and smartapps (see troubleshooting section, item 1)
  • 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

Functionality: Supports regular ST Switch capabilities.


Here is a list of ST Capabilities

   capability "Switch"
   capability "Polling"
   capability "Refresh"
   capability "Sensor"
   capability "Health Check"

Device Type: https://github.com/yracine/device-type.myecobee

Instructions for My Ecobee Device installation (readme): http://github.com/yracine/device-type.myecobee/blob/master/README.md

Look & Feel

MyEcobeeSwitch.png


UI Fields

Upper section of the multi-tile

  • Current Switch State, you can press in the middle to toggle the switch to on/off

Lower section of the multi-tile

  • Capabilities of the Switch (integration with Alexa, Microphone, etc).
  • Last updated Date&Time (in local time)
  • Connected status (ecobee cloud)


Configuration


Item 1) Follow the readme file's step by step instructions under - setup time = around 5 min.

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

http://github.com/yracine/device-type.myecobee/blob/master/README.md


Known issues

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

1. The ST-ecobee cloud-to-cloud connection can be lost (connection pool or timeout issues) from time to time

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


Update: Following some ST DB and some scheduler changes (more to come), the http exceptions previously generated by ST are gone. I just keep the documentation just in case (as a reference).

Important Note:

   Don't enter any preference values for the switch's serial number or for the appKey as the values are only
   used for the PIN authentication method (not with the Service Manager called the MyEcobeeInit smartapp).  If you do it, you may experience authentication issues.


For some unknown reasons, the cloud-to-cloud connection between SmartThings and ecobee can sometime generate some timeout and unauthorized exceptions (when the refresh token is not issued on time).

It may be caused by some connection pool management issues or just DB/server issues that are not tracked by either party (ST or ecobee).

If you have many connection issues, please contact ST support as My Ecobee's device code does not have any control over the connection issues between ST and ecobee.

My smartapps can notify (handleException flag needs to be set) you if the number of exceptions is too high and may ask you to re-connect (re-login) at ecobee.

In the meantime, here are my recommendations to reduce the number of exceptions:

If you have many ecobee thermostats and/or many ecobee switches or many ecobee3's remote sensors, create many MyEcobeeInit (for 2 or 3 switches max) instances and/or many ecobeeRemoteSensorInit (for 2-3 remote sensors max) instances and split your ecobee devices between the instances that you created. You can assign a different name for each instance on the last page.

See the troubleshooting section, item no 6 for more details about the ST-ecobee connectivity issues.

BTW, these connection issues are not specific to MyEcobee Device as per these threads:

TCP Hub

https://community.smartthings.com/t/smartthings-losing-connection-to-tcp-hub/17093

Stock Ecobee device

https://community.smartthings.com/t/having-to-authorize-ecobee-2-3-times-a-day/18282

Philips Hue

https://community.smartthings.com/t/philips-hue-bulbs-no-longer-working-and-getting-noavailablehostsexception/20899/3

Wemo

https://community.smartthings.com/t/losing-comunication-with-wemo-switch/17045

Wink Quirky Pivot

https://community.smartthings.com/t/wink-authorization-to-connect-quirky-pivot-power-genius/12356

Logitech Harmony

https://community.smartthings.com/t/harmony-home-control-smartthings-control-and-vice-versa/6716

Amazon echo

https://community.smartthings.com/t/issues-with-smartthings-app-ide-and-cloud-integrations/30005

MyQ

https://community.smartthings.com/t/release-myq-liftmaster-chamberlain/8939/568

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 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

Please refer to the installation readme (prerequisites) to find out what is the right shard for the procedure.

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

Issue #2: I created the device handler and My EcobeeInit 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 mobile app, click on automations>smartapps in the bottom menu. The list of installed smartapps will then appear.

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

Issue #3: I executed MyEcobeeInit smartapp, but the list of switches is blank

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

If you get a blank screen after pressing 'Next or you get the following error: java.lang.RuntimeException: Unexpected status code 500 from global or "Error - bad state. Unable to complete page configuration" or java.lang.NullPointerException: Cannot get property "authorities" on null object

you'd need to enable oAuth as specified in step 2f) in the readme.

http://github.com/yracine/device-type.myecobee/blob/master/README.md


Refer to MyEcobeeInit smartapp's installation instructions for more details:

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


If you get the "physicalgraph.app.exception.UnknownDeviceTypeException" error in the IDE, then please make sure to create the required device type first (step 1 in the readme).

Don't forget to create the DTH (Device Type Handler) and the smartapp under the right shard (refer to the prerequisites in the readme file at the github).

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

Issue #4: I don't see my newly added Ecobee Switch in My EcobeeInit's list of switches for selection

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

You must first configure your new switch(es) at ecobee and make sure it is connected and communicates via wi-fi.

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

Issue #5: My ecobee Switch's state is off with the physical switch

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

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

Also, make sure that your ecobee switch is connected to wi-fi.

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

Issue #6: My Ecobee Switch is no longer authorized to send requests to ecobee

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

My ecobeeInit is a smartapp that polls the My ecobee device(s) on a regular basis to ensure that the refresh (authorization) token is constantly renewed when needed.

Ecobee requires (contrary to some other cloud providers) to refresh its authorization token every 59 minutes for greater security.

The device handler code is an interface between ST and ecobee, so there are some dependencies on both platforms.

The algorithm within MyEcobeeInit and MyEcobee device has been coded to renew automatically the authorization token every 55 minutes or so. If it fails to renew the token, then the connection with ecobee will be lost.

So, the algorithm will work all the same after 1 hour or several days. So, if the smartapp works for more than 1 hour, it should work for days even months without issues provided that there are no other external factors (ex. connection issues between ST and ecobee with your physical switch).

You can infer that there are 3 potential "points of failure":

(a) It could be an issue on the ecobee side: there could be a temporary network issue or an issue with the ecobee servers

For the past months, it has happened more frequently.

See this thread at the ecobee forum:


http://developer.ecobee.com/api/topics/ecobee-servers-outage

Here is the ecobee status page where you can register for some outage warnings.

https://status.ecobee.com/

(b) It could be due to a (temporary) bad internet connection on your side.

Ecobee switches connect thru wifi, so if the physical switch is not connected for a while, then you may not have control over the switch during that timeframe.

(c) It could also be an issue on the ST side. We've all experienced issues with ST scheduling.

If the smartapp is not rescheduled every 20 minutes, and you don't manually poll the switch through the ST app, then the "refresh token" will not be obtained, and the authorization token may be lost.


HOW TO FIX THE UNAUTHORIZED ISSUES:


a) If you are running the standalone version (with PIN):

You may need to execute getEcobeePIN again, and enter the PIN at the ecobee portal (for the standalone version) Under the ST app, press the 'refresh' tile on your device to check if it's running normally after.

b) If you are running the Service Manager (MyEcobeeInit):

Execute MyEcobeeInit and re-authenticate (re-login) at ecobee by pressing on 'ecobee' on the 2nd page. Under the ST app, press the 'refresh' tile on your device to check if it's running normally after.


c) Make sure that all related ecobee smartapps are scheduled correctly so that polling is done on a regular basis (in order to renew the authorization tokens)

Check that MyEcobeeInit, and/or pollster are really re-scheduled with a future timestamp

This is due to some ST scheduling issues, refer to this thread (and there are others in the community forum) for more details:


https://community.smartthings.com/t/scheduler-and-polling-quits-after-some-minutes-hours-or-days/16997


1) Go to https://graph.api.smartthings.com/location/list

2) Click on list Smartapps

3) Click on MyEcobeeInit, and pollster (in sequence)

4) Verify that the takeAction job is scheduled in the future (check the timestamp associated to the Next Run Time) under "Scheduled Jobs"

If it's not the case, you may want to re-execute MyEcobeeInit, or pollster

ST is aware of this problem for months, but has not made any permanent fix yet.

d) If you have multiple switches exposed to ST, try creating multiple instances of MyEcobeeInit (1 for each switch) as ST has some rate limiting issues that sometimes impedes the auth token renewal.

You can assign a different name for the smartapp instances at the last page.


Some workarounds have been implemented in my code to get around the ST scheduling issues.


You have 4 options available in the last page of the smartapp ("Other Options" under the "watchdogs" section):

(a)- The smartapp can subscribe to some temp sensor(s) for any change of values, and if so, reschedules the smartapp when values at the temp sensor are refreshed. By using some temp sensor(s) that regularly poll(s), this "heartbeat" is used to make sure that the smartapp is rescheduled when needed.

(b)- The smartapp can subscribe to some motion sensor(s) for any change of values, and if so, reschedules the smartapp when values at the motion sensor are refreshed. By using some motion sensor(s) that regularly poll(s), this "heartbeat" is used to make sure that the smartapp is rescheduled when needed.

(c)- The smartapp can subscribe to energy meter device for any change of values, and if so, reschedules the smartapp when energy values are refreshed. By using some energy meter(s) that regularly poll(s), this "heartbeat" is used to make sure that the smartapp is rescheduled when needed.

(d)- You'd can also used a (virtual or physical) switch in the smartapp and use a Rule Engine (WebCoRE/CoRE, SmartRules) to trigger the virtual/physical switch based on a timer.


To activate the subscriptions, you need to go through the smartapp's setup, press "Next" till the last Page (Other Options) and enter the new subscriptions indicated below:

   section("Watchdogs") {
       input (name:"tempSensor", type:"capability.temperatureMeasurement", title: "What do I use as temperature sensor to restart smartapp processing?",
           required: false, description: "Optional Watchdog- just use a single regular polling watchdog")
       input (name:"motionSensor", type:"capability.motionSensor", title: "What do I use as a motion sensor to restart smartapp processing?",
           required: false, description: "Optional Watchdog -just use a single regular polling watchdog")
       input (name:"energyMeter", type:"capability.powerMeter", title: "What do I use as energy sensor to restart smartapp processing?",
           required: false, description: "Optional Watchdog-  just use a single regular polling watchdog")
       input (name:"powerSwitch", type:"capability.switch", title: "What do I use as Master on/off switch to restart smartapp processing?",
           required: false, description: "Optional Watchdog - just use a single regular polling watchdog")
   }


You can use either a temp Sensor (such as Aeon MultiSensor, SmartSense or Keen Vents), a motion sensor (such as the SmartSense), a power meter (such as Aeon HEM) or a powerSwitch to reschedule the smartapp if needed (as long as this device is polled on a regular basis -ex. every 5 minutes ) so that it can create a 'heartbeat' for the smartapp.

Do not use an ecobee switch or the ecobee thermostat or ecobee remote sensors as this is not an external "heartbeat" for ensuring proper scheduling.

Finally, please use 1 or 2 watchdogs as too many can also cause too much rescheduling.


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

Issue #7: I want to disable any notifications from MyEcobeeInit

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

Go to MyEcobeeInit 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 #8: "An unexpected error has occurred" or 'deleteObserver onError: %s' messages in MyEcobeeInit when I press 'Remove'

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


Like all ST connected devices, you need first to unselect/remove your ecobee device from all the smartapps as MyEcobeeInit will not uninstall w/o doing this step.

MyEcobeeInit is the Service Manager for MyEcobee Device, so uninstalling the smartapp means that all your ecobee devices will be deleted.


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

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

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

Just update the device preferences, and edit the trace parameter, and set it to 'true'

See step 7 in the readme:

http://github.com/yracine/device-type.myecobee/blob/master/README.md


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" )        


Do not forget to set the trace back to 'false' after your debugging session as this setting may impact performance.


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 #10: 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 My Ecobee Device's code from the text file from my email (I will send you emails with a zip file attached when required).

Go to http://graph.api.smartthings.com/ide/devices

Click on the device you want to update.

Copy and paste the code, save & publish.

N.B. Make sure to copy and paste ALL the code!

For the related "free" smartapps, refer to this brief tutorial on how to integrate ST with github (1st post):

https://community.smartthings.com/t/faq-github-integration-how-to-add-and-update-from-repositories/39046


GitHub Settings:

Owner: yracine

Name: SmartThingsPublic

Branch: master

All my smartapp are at the end of the "new (only at github)" window.

You can also copy and paste (manually) them from my github.

https://github.com/yracine/device-type.myecobee

In any case, you'd need to save & publish at the end.


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

Issue #11: java.util.concurrent.TimeoutException

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

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 #12: No signature of method: physicalgraph.device.CommandService.executeAction() is applicable for argument types

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

There seems to be a generic issue with some custom DTHs and it doesn't affect the DTH normal behavior.

See smartThings explanations here:

https://community.smartthings.com/t/mysterious-commandservice-executeaction-call/13553/5



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

Issue #13: I'd like to uninstall My ecobee switch(es)

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

a) Like any SmartThings device, first you'd need to unselect My Ecobee switch(es) from all smartapps and/or routines (ex Amazon Echo).

To know which smartapps are using My Ecobee switch(es), go to

https://graph.api.smartthings.com/device/list (or whathever your shard is)

or click on the smartapps tab on the device itself under the ST mobile app.

b) Click on My Ecobee Switch(es)

And note all smartapps under the list "In Use By".

c) Then, you'd need to unselect the device(s) from the smartapps or routines using the ST mobile app.

d) Finally, you can remove the MyEcobeeInit smartapp (if you don't have any other ecobee devices).

If you have any delete issues, you can also delete the devices directly from the ST or Samsung mobile by clicking on the device, pressing the 'gear button (upper right), and then remove at the bottom.


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

Issue #14: ecobee exception while parsing json from response: com.datastax.driver.core.exceptions.ReadTimeoutException

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

These exceptions are thrown by the ST backend from time to time when using the Async Http requests. 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 #15: I want to be notified of any exceptions coming from ST and/or ecobee

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

If you want to be notified of any serious ST/ecobee exceptions, you can set the following flag to true in MyEcobeeInit (in Other Settings -last page):


   section("Handle/Notify any exception proactively [default=false, you will not receive any exception notification]") {
      input "handleExceptionFlag", "bool", title: "Handle exceptions proactively?", required: false
   }


The smartapp will then send you notifications when exceptions occur.


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

Issue #16: 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 MyEcobeeInit in order to initially create My Ecobee 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 #17: Some of my devices under the new Samsung app are disconnected

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


If some of your ecobee devices are disconnected under the new Samsung app, you may have created many of the same devices by executing MyEcobeeInit 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 MyEcobeeInit smartapp, refer to issue #2: http://thingsthataresmart.wiki/index.php?title=MyEcobee_Switch#Issue_.232:_I_created_the_device_handler_and_My_EcobeeInit_in_the_IDE.2C_but_I_don.27t_know_where_to_execute_it