[OBSOLETE] .. Updated Open Source Ecobee Device Type and SmartApps

UPDATE 2016-02-29: v0.9.13 Released for general Beta testing. Now with over 235 users!

UPDATE 2016-01-26: v0.7.5 Stable Released with Comfort Settings support. v0.8.0-RC1 Beta release with fanMode support released.

UPDATE 2016-01-16: We now have over 100 installs! Keep the feedback and requests coming!

UPDATE 2016-01-10: We now have over 75 people using the code! This should give us a good base to continue to squash any bugs, and to be able to focus on the features that most people want!

I am happy to finally provide my contribution for updated Ecobee devices and SmartApp.

Iā€™ve built this as a fork off the SmartThingsPublic repository with the desire to have it rolled back in once it is in good shape. It also uses the existing Open Source license so that users wonā€™t get stuck without source code if (for whatever reasons) I were unable to continue providing updates, the community would be able to step in. (Or if users wanted to go into a different direction with their own forks.)

Main items that I addressed with these updates:

  • Major refactoring of the stock SmartApp code
  • Structured for use with the GitHub / SmartThings IDE integration for easy updates!
  • Fixed several bugs around the OAuth Token Handling that was causing timeouts / exceptions
  • Optimized the API calls so that we do not call the remote APIs unless needed, use local cached data when it makes sense
  • Added a new Smart Auto Mode Temperature Control that allows you to adjust the temperature using the arrows (up and down) even when in Auto mode
  • Automatic creation of devices from the SmartApp, allows the selection of a subset of thermostats and sensors. And only shows sensors that are associated with the thermostats that were selected
  • Configurable Hold type (Permanent vs Temporary)
  • Configurable Poll times

And other stuff that Iā€™m too tired to remember at this point.

If you would like to try out the Device Types and SmartApp, you can follow the instructions on GitHub:. SmartThingsPublic/smartapps/smartthings/ecobee-connect.src at StrykerSKS-Ecobee3 Ā· StrykerSKS/SmartThingsPublic Ā· GitHub

It is still lacking the helper SmartApps for things like ST Hello modes integration, but now that I have this baseline released it shouldnā€™t be hard to add those apps. Feel free to give inputs on what youā€™d like to see added first in the thread as that will help guide my focus.

Now time for sleep.

// Sean

34 Likes

Thank you! I am setting everything up and have an Android phone. I wanted to make one comment on the steps of setting up the SmartApp after all of the code installation. After selecting the sensors that I want to incorporate the instructions. After selecting the sensors and selecting done I still had one final step which was to select ā€œNextā€ to complete the install of the app from the Marketplace.

I am going to start using/testing the app, I will let you know how it goes.

Long Live FOSS. Nice work Stryker!

Thanks, Iā€™ve updated the SmartApp install steps to include the last ā€œDoneā€ and also highlighted the popup that should appear.

Stryker, it seems to be working great. Thanks for your efforts!

However, Iā€™m getting a ā€œ?ā€ where the temperature should be. Any idea what would be causing this? Looking at the recently tab, it seems to be getting the temperature from the device, but itā€™s not updating the dashboard.

Iā€™ve tried clearing the app data, but that didnā€™t solve it. Iā€™m on Android.

Ugh. Okay, seems that multiAttributeTiles still do NOT work on Android!

This is quite unfortunate as it provides a very nice clean look and functionality.

Looking in the community, this is a known issue that came up with the 2.0.7 release of the Android client. Iā€™m opening a trouble ticket now to see when/if this will be resolved.

Here is what it would have looked like:

Iā€™ll come up with a workaround for Android so that you will still be able to use the main functions and get the main data. And if there are any specific data points from the thermostat that youā€™d like to see on the interface, let me know. It shouldnā€™t be hard for me to pull the data through.

// Sean

Are you using the same images for the weather as the Ecobee? I notice from adjusting my thermostat from the Ecobee controller that the Mostly Cloudy icon is a cloud with sun coming out from behind the left but in the app you have created it two clouds.

Regarding the comment about the work around for the Android my opinion is keep it the same, show or display the same items you are doing for the iOS.

Another feature I though about would be to make the ā€œResume Scheduleā€ similar to the ā€œAutoā€ where if you clicked ā€œResumeā€ it could cycle to ā€œHold Temporaryā€ or ā€œHold Permeantā€.

Regarding the images for the weather, the Ecobee API assigns a number to each symbol but does not provide the actual images. So then I have to map those numbers to a reasonable icon to represent it. Unfortunately, there is no easy way to find all the images that are available to a device, so Iā€™m using the stock images available as seen here:
http://scripts.3dgo.net/smartthings/icons/

And map those to the symbol numbers from the API here:
https://www.ecobee.com/home/developer/api/documentation/v1/objects/WeatherForecast.shtml

Would certainly prefer to get them to match as closely as possible, and perhaps someday ST will make it easier to create custom icon sets and include those. But for now, if you see a mismatch between one of the states and the image, let me know which of the icons from the standard set most closely matches and I can easily update it.

Regarding the workaround, what Iā€™ll do is simply add in some of the additional controls that were handled by the multiAttributeTile as individual tiles. That way you will still be able to control things. On iOS this will mean that some things are duplicated, but that is better than leaving people stranded.

Regarding the Hold Type, you can already edit that on a per Thermostat basis by going to ā€œEdit Deviceā€. Because of the way that the APIs work, we have to send the holdType with the hold request. So changing this AFTER you change to the temperature will NOT change the holdType used at the thermostat. So having a button to change this is probably not a good idea as people will think that changing it will immediately change the current setting. Iā€™ll have to think if there is a good way to do this on the backend (anything is possible with enough code). But I suspect that most people will mostly use one mode over another at any given timeā€¦ Iā€™ll need to think about it.

EDIT: Note, that I have not fully tested changing the holdType at the thermostat yet. Iā€™ll add that to my todo list.

// Sean

Thanks @StrykerSKS. This is excellent work and I truly thank you for keeping with the spirit of the community. Iā€™m fairly new to SmartThings and the whole GitHub but your ready made it easy to finally figure out how to utilize the repository and will make syncing updates so much easier. Everything came up and running on my side and Iā€™ll let you know if I see anything odd.

-Bob

1 Like

What a fantastic effort youā€™ve put forward here. Iā€™m running Android and Iā€™m experiencing the issue mentioned above, but this device shows incredible promise and man you have absolutely knocked it out of the park with the details. The Github integration is great, the documentation is simply outstanding, the presentation is good, and man I love that youā€™re sticking to your guns on keeping this open source. Iā€™m excited to see what becomes of this, and thanks for all your work so far.

Anyone else getting this alert? I got this notification at 2:37PM EST and now again at 8:37PMEST "Your Ecobee thermostat is disconnected from SmartThings, because the access credential changed or was lost. Please go to the Ecobee (Connect) SmartApp and re-enter your account login credentials?

Thanks everyone.

Okay, Iā€™ll try to address a few of the things in the thread so far.

Regarding the issues on Android and the inability to actually control the device. This is because the controls were on the multiAttributeTile. I will issue an update tonight that will add the controls as regular tiles as well so that it will be more usable on Android.

Regarding the alert: Yeah, Iā€™m seeing it now too. Everything was stable for me right up until I released the code (go figure). Looking through my logs, this happened right after one of the dreaded ā€œExecution time exceeded 20 app execution secondsā€ errors, which then cascaded into losing the AuthToken. Iā€™ve updated my local copy of the code to handle the exceptions more granularly so that we can separate true API Call errors from platform congestion errors. The old code would simply immediately try to refresh the Token, but when the platform is already congestion this simply led to more failures.

Now with the updated error handling I can better track what errors are happening and why. With this we should be able to isolate and maintain the connection.

In the meantime, you will have to open up the SmartApp and re-login to Ecobee to get a new token.

Okay, Iā€™ve made several updates to the SmartApp and the Device Types. Mostly around updating the UI for the Thermostat on the phone.

Iā€™ve switched over to using the Lighting multiAttributeTile which supposedly works on Android. I will switch back once ST fixes the current issues. Iā€™ve also added manual controls in case the multiAttributeTile fails to work. Below is a screenshot of the updated version. Iā€™ve also update the instructions on the README at GitHub to include instructions for updating via the GitHub integration. If you are not using the GitHub integration then you will have to manually paste in the new code, save it and publish to get the latest.

I just want to say thank you to StrykerSKSā€¦ This is a lot of work, and I really appreciate how you are sharing this openly with the community. The Ecobee app looks great!

1 Like

@StrykerSKS, registered here just to say thank you for your time and effort on this updated and most important open-sourced Ecobee device & app. Itā€™s been a whole day and it works so far without any issues!

2 Likes

StrykerSKS questions about your Ecobee 3 app
Under Select Hold type- what does this refer to - Is it related to say, if I override my conform setting the thermostat willnt keep temperature until i change it or until next scheduled event.
smart auto temperature- Does this enable smart away feature in ecobee 3 or something else?In your thread you make reference to arrows for temperature adjustment, but just a little perplex with the name you used.

So both the Ecobee 3 and the sensors will be polled every 5 minutes. Is it possible that sensors be polled lest often based on they run on batteries.

My ecobee 3 shows up on family tile. Is this intentional.

@HLlalo,

Make sure to take a look at the READMEā€¦ @StrykerSKS did a great job of explaining things there:

This is the section that applies to your questions:

Optionally, set the other settings:
Select Hold Type: This determines how a hold will behave. Either Permanent (until changed) or Temporary (until next program engages)
Use Smart Auto Temperature Adjust: This allows you to adjust the temperature using the Up and Down arrows within SmartThings even when the device is in mode Auto.
Polling Interval: Determines how often to poll (via API calls) for fresh thermostat/sensor data

Your question #1: HoldType

Under Select Hold type- what does this refer to - Is it related to say, if I override my conform setting the thermostat willnt keep temperature until i change it or until next scheduled event.

Yes, the hold type on the device in the app does the same sort of thing as changing the hold type on the ecobee itself (Just right now your device has more options for hold types. The SmartThings app only has 2.)

If you change the holdtype in the settings of the thermostat device in the app then when you change the temperature in the SmartThings app itā€™ll use that instead of what you have set on the ecobee. So for example on myphysical ecobee I had it set to holdtype until next transition, but in the Ecobee device in SmartThings it was indefinite (default).

So when I changed the temp on the physical device it would go back to schedule on next event (as per the programmed schedule home, sleep, wake, away etc.) but if I changed it in SmartThings (using a SmartApp, or the SmartThings device) it would stay at that temperature forever until I manually clicked on ā€œReturn to Scheduleā€.

Having said that, @StrykerSKS did add a ā€˜holdtypeā€™ setting to the smartapp as well. Iā€™m not 100% sure how the two places vary. Perhaps @StrykerSKS can shed some light on that?

smart auto temperature- Does this enable smart away feature in ecobee 3 or something else?In your thread you make reference to arrows for temperature adjustment, but just a little perplex with the name you used.

Question #2: Smart Auto Temperature Adjust
My understanding is that this is because typically when you are in ā€œheatā€ mode the up arrow will change the heat temp, when you are in ā€˜coolā€™ mode the arrows change cooling temp. But in ā€œautoā€ mode the arrows will need to adjust both the heating and cooling.

I initially thought it would be for the smart home/away, or for smart recovery (preheating before scheduled time), but I think that sort of thing would still be controlled by your physical ecobeeā€™s settings.

Question #3: Polling
You also asked about the 5 minute polling? Thatā€™s a setting you can change yourself it you think thatā€™s too much (Options are 5, 10, 15, 30).

Remember the Ecobee and Sensors donā€™t run on Z-wave, or Zigbee, so it doesnā€™t communicate directly with the SmartThings hub. What it does is it syncs data to the Ecobeeā€™s servers, then this smartapp connects the Ecobeeā€™s Servers with the SmartThings servers. So the polling information isnā€™t how often the SmartThings hub is talking to the sensors, or the ecobee device, itā€™s how often the SmartThings servers are talking to the Ecobeeā€™s servers. I donā€™t think itā€™ll affect your battery life to have this at 5 minutes or to change it to 30.

Hope that helps!

@HLlalo, I have the thermostat showing up under family as well. Itā€™s not just you and itā€™s always been like that. (the community version and I think the one thatā€™s now a paid version all show up as part of the family. as far as I know)

Iā€™m not sure why, just wanted to let you know that this is normal.

@StrykerSKS, if this isnā€™t an intentional thing, I can open an issue ā€˜ticketā€™ on this in Github. Let me know if you need me to do this. (You can probably open a ticket too I assume.)

Thanks for clarification.
Another question
I am trying to use Rule Machine to change Ecobee 3 from Off,Heat, Cool. In rule machine I setup rule so that at a specific time the mode is change from off to heat and set temperature, I am only doing this as a test. When i say modes i am referring to off, heat, cool and not away and home. Rule machine changes the temperature on Ecobeee 3, but it willnt change mode to heat. If i open thermostat via smarttings I am able to change modes. Note sure if this is related to device type in smartthings or Rule Machine, but wanted to get your thoughts.