SmartThings Community

[Release] Updated Open Source Ecobee Device Type and SmartApps

thermostat
smartapp_hvac
dth_hvac

(Sean Kendall Schneyer) #1

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:. https://github.com/StrykerSKS/SmartThingsPublic/tree/StrykerSKS-Ecobee3/smartapps/smartthings/ecobee-connect.src

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


Official Ecobee 3 Integration
Ecobee3 - what is the newest way to get this working?
Smarthings new video features Ecobee3?
Calling all community members: New SmartApp Ideas
[BETA RELEASE] Keenect V2.7 and Keenzone 2.8, Proportional Vent Control with System Wide Zone Balancing
My new Ecobee Device (disconnection issues are resolved)
Solaredge Device Type?
Official Ecobee 3 Integration
Ecobee3 again
Ecobee Comfort Settings Change Based on Smart Things Mode
Show and Tell March Edition
Native ST ecobee 3 intergration?
Thermostats with good SmartThings integration
Official Ecobee 3 Integration
Ecobee3 again
[DEPRECATED] Free Ecobee Suite, Version 1.2.*
Nest or Ecobee3
Reliable Presence SmartApp
What Thermostats Besides the Nest Do You All Use?
(John L) #2

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.


(Adam) #3

Long Live FOSS. Nice work Stryker!


(Sean Kendall Schneyer) #4

Thanks, I’ve updated the SmartApp install steps to include the last “Done” and also highlighted the popup that should appear.


(Andrew Ostler) #5

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.


(Sean Kendall Schneyer) #6

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


(John L) #7

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


(Sean Kendall Schneyer) #8

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


(Bob A) #9

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


#10

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.


(John L) #11

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?


(Sean Kendall Schneyer) #12

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.


(Sean Kendall Schneyer) #13

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.


(Kris) #14

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!


Ecobee3 - Official integration plans?
Native ST ecobee 3 intergration?
Ecobee3 thermostat officially supported or not?
Ecobee3 thermostat officially supported or not?
(Andrei Zharov) #15

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


Official Ecobee 3 Integration
#16

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.


#17

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


(Kris) #18

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


(Kris) #19

@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.)


#20

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.