New version of Ecobee thermostat APIs

Hello,

Following the release of the ecobee API changes yesterday, I added some functionalities to the existing Smartthings-Ecobee integration code base:

  • to handle the current equipment’s status (live) in the ecobee device type
  • to create,update, and delete groups

I also added a smartapp that calls the ecobee device type to allow a user to easily manage the groups associated to a given thermostat

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

Regards.

P.S. For more details on the API changes, see the changes log at https://www.ecobee.com/home/developer/api/documentation/v1/index.shtml

2 Likes

Hello, I made some changes to include alerts display and climates update processing today.

Here are some pictures of the resulting device within smartthings.

The device can show the following information on any android or iOs devices (phones & tablets):

Name of the thermostat
Group(s) of the thermostat if any
Current indoor temperature (in Celsius or Farenheits) as shown within the circle
Current hvac mode (cool, heat, off)
Current fan mode (on, auto)
Current Program Mode (you can tap to switch either to Home, Sleep, Awake, Away, or QuickSave)
Current heatingSetpoint
Current coolingSetpoint
Arrows to change the Cooling & Heating set points
Current Equipment Status (what is currently running )
The current indoor Humidity
Alerts if any
Current FanMinOnTime (minimum fan time in minutes per hour)
The Program’s HeatingSetpoint
The Program’s CoolingSetpoint
The name of the current Program
A " Resume Program" icon to press if desired
The type of Program (Program or Vacation)
Weather Date and time
The current weather conditions
The current outdoor temperature
The current outdoor humidity level
The forecast min. temperature
The forecast max. temperature
The current pressure level (in hpa)
The current Wind direction
The current Wind Speed
The Probabilty of Precipitation (PoP) in %

This is available at https://github.com/yracine/device-type.myecobee

Enjoy!





2 Likes

Thank so much for this!

Hi Yves, this looks good! When using this, do we need to do anything special with existing programs on the Ecobee? I had a pre-SmartThings ecobee schedule and haven’t been able to truly “clear” out the existing programs. From what I can tell, most SmartThings integrations are indefinite holds which means it should otherwise ignore the Programs.

Thanks!

Also, one additional question, how does this handle multiple Thermostats under the same ecobee account? Is that what the Serial number is used for? IE: What steps need to take place to add a second ecobee? I assume adding another device using the existing device type and updating preferences, but I assume I don’t need to add another App from within Ecobee, correct?

I’m wondering if having multiple Ecobees on my account is doing something strange as right now I have no data within the “Things” menu for the thermostat, just gives blanks for everything.

Thanks again!

Yves, thanks for all of your hard work on this.

This link: https://github.com/yracine/device-type.myecobee1 is not functioning, although it appears the old one (https://github.com/yracine/device-type.myecobee) is with updates today.

Also, using the code from https://github.com/yracine/device-type.myecobee, I am able to create the device and authorize, but when I use the controls to increase the cooling setpoint, the ecobee does not actually change setpoint (although the event log in SmartThings says it does.)

Hi terigox, you don’t need to do anything special except registering the ecobeeTstat app at the ecobee portal
according to the instructions in the readme file:

As specified in the instructions, you can set the holdType parameter to different values
according to your own requirements:

refer to the following link for more details
https://www.ecobee.com/home/developer/api/documentation/v1/functions/SetHold.shtml

I personally set the holdType parameter to ‘nextTransition’, so that it does not hold
the setpoints indefinitely and use the programs that I set as much as possible.

Enjoy.

Hello Fauxreigner,

Thnx for your comment, I corrected the link to github.

I just tested the UI display response on all my nexus (4,5,7) devices and setting the coolingSetpoint or the heatingSetpoint works fine. What kind of device do you have? I can"t test on iOS as I don’t own an iphone or an ipad myself.

Let me know. You may also want to try to press the ‘activity’ button and come back to the main console to refresh the UI.

Regards

Hi terigox,

As I don’t own multiple thermostats, I haven’t tested it. To be safe, I would recommend to use another app key and PIN in order to establish a different connection for each of your thermostats.

After creating each device within smartthings (under https://graph.api.smartthings.com/device/list with
different names and network ids), you then have to set the preferences for each ecobee device, and the serial number is a key element in order to visualize each of your thermostats individually.

Later, you can use the smart app ‘ecobeeManageGroup’ under

to synchronize the values (schedule, alerts, vacation, quick save) of your different thermostats.

P.S. If it’s not working for you, a simpler way would be to create only one ecobee device within smartthings and use the 'iterate" functions in some smartapps to manage all thermostats at once (see my AwayFromHome or createVacation smartapps under github as examples).

For example, iterateSetHold would set the coolingSetpoint and heatingSetpoint values on all your thermostats through a loop based on a single ecobee device. You then don’t need to worry about setting different ecobee devices in smartthings with their own serial number.

Also, please use the latest version of the codebase at github by replacing the code that you have in your
ecobee device type with a copy and paste of the new code,press ‘save’ and then 'publish in the smartthings IDE as I made a lot of changes recently.

Let me know how it goes, so I can adjust my code if a problem occurs.

Regards.

Thank you Yves, I noticed a lot of inconsistencies with using the SmartThings Labs Ecobee integrations with the programming that existed on the thermostats, so I wasn’t sure if it was something with Ecobee’s API’s or something with SmartThings.

It does appear as though your code supports programs well, so that shouldn’t be a problem, thanks!

[quote]Hi terigox,

As I don’t own multiple thermostats, I haven’t tested it. To be safe, I would recommend to use another app key and PIN in order to establish a different connection for each of your thermostats.

After creating each device within smartthings (under https://graph.api.smartthings.com/device/list with
different names and network ids), you then have to set the preferences for each ecobee device, and the serial number is a key element in order to visualize each of your thermostats individually.

Later, you can use the smart app ‘ecobeeManageGroup’ under

to synchronize the values (schedule, alerts, vacation, quick save) of your different thermostats.
[/quote]
Interesting, I have not used groups yet, but I will definitely have to try this, sounds nice!

I ended up setting up the second thermostat following the entire process over again. New API key for Ecobee and all. It seems to be working great so far. I use my thermostats mostly independently as one is upstairs and one is downstairs so I would like to keep them as separate as possible for automation of the upstairs unit independently of the downstairs. Not sure if groups still allow this, but I’ll give it a try.

[quote]
Also, please use the latest version of the codebase at github by replacing the code that you have in your
ecobee device type with a copy and paste of the new code,press ‘save’ and then 'publish in the smartthings IDE as I made a lot of changes recently.

Let me know how it goes, so I can adjust my code if a problem occurs.[/quote]
Ah great, I will update to the new code now and report back on any inconsistencies or issues!

Thanks again!

@Fauxreigner -

[quote]Yves, thanks for all of your hard work on this.

This link: https://github.com/yracine/device-type.myecobee1 is not functioning, although it appears the old one (https://github.com/yracine/device-type.myecobee) is with updates today.

Also, using the code from https://github.com/yracine/device-type.myecobee, I am able to create the device and authorize, but when I use the controls to increase the cooling setpoint, the ecobee does not actually change setpoint (although the event log in SmartThings says it does.)[/quote]
Do you see the other data points on the Thermostat object in SmartThings? I noticed at first not all fields would populate after a few tries, I noticed a couple of things:

  1. Data was not showing up correctly, so I re-ran the get PIN process and re-registered within Ecobee, this seemed to fix the problem for me, not sure if it was just a timing thing or what.
  2. Data was slow to show up even after seeing authorization success in the logs, I think the initial pull of data took a while, and/or the EcoBee API’s aren’t speedy :smile:

Not sure if either of these apply to your problem!

Hello terigox,

By using groups, you may want to choose to synchronise only your vacation settings, but not your schedule so that you manage them independently. It gives a lot of flexibility for people like you that have many ecobee thermostats.

See https://www.ecobee.com/home/developer/api/documentation/v1/objects/Group.shtml for more details.

Bye.

Yeah, it seems to be working now. Ecobee support also let me know that they’re having server issues, so that’s probably part of it.

Now I’m digging into how to actually make SmartThings do what I want it to do. I was hoping that the increased control that Yves’ work brought in would expose more commands to SmartThings, but that seems to not be the case. Feels kind of ridiculous that I can’t just tell the Ecobee to resume program when someone returns home.

Edit: Of course I missed that Yves already wrote a SmartApp for that. Thanks again!

Yes, I wrote many smartapps to control your ecobee device:

AwayFromHome : lower your ecobee’s heating and cooling settings while you’re away and there is no motion at home
ecobeeManageVacation: to create/delete a vacation period on your ecobee device from the smartthings platform
MonitorAndSetHumidityLevel: if you have a humidifer/dehumidifer connected to ecobee, this smartapp allows you to monitor your indoor humidity (like every 30 minutes or to whatever time interval in minutes) and to trigger your humidifier/dehumidifier based on the outdoor humidity and temperature.

For example, it can trigger the A/C in the Summer if the indoor humidity is above a certain threshold that you set and the outdoor humidity is too high to use the dehumidifer/hrv.

ecobeeResumeProg: resume your ecobee program when you’re back home
ecobeeManageGroup: to manage the group(s) associated to a given ecobee thermostat
ecobeManageClimate: to manage the climate objects associated to your ecobee thermostat (see https://www.ecobee.com/home/developer/api/documentation/v1/objects/Climate.shtml for more details).

Of course, you can use and modify those smartapps acccording to your own requirements within your smartthings env.

Please use the “like” button if all this code brings some added value to your life.

2 Likes

@yvesracine Not sure what is happening but ever since I updated my ecobee device with your new code, I have lost the ability to change any settings on the device tile (resume program seems to work though if I change the set temp on the thermostat itself manually). I went the through the PIN process to make sure that wasn’t the problem. I can read current Ecobee values, but I can’t make any changes.

Not sure if it matters but the top right of my device says “No groups%” and I’m using an EMS Ecobeee. Any ideas what the problem could be?

Hello sgonsalves,

The new code should not break any UI settings.

However, to fix the problem, I suggest to delete the device and re-create the the ecobee device type and ecobee device as specified in the readme file.

In order to delete the device and the device type, you need first to uninstall the smartapps linked to your ecobee device.

When recreating the ecobee device type, please copy and paste the latest release of my code under

to recreate the device type.

If you encounter any difficulties during the process, let me know. Please set
the verbose trace to ‘true’ in the preferences in order to get more detailed tracing
for debugging later. I may need this trace to better understand what’s going on in your specific case.

Sorry about the inconvenience, but I’m pretty confident that we can solve this issue that way.

If needed, I could also create more tracing events to pinpoint the exact issue you’re facing. Also, let me know what kind of device you’re using (iOS, Android).

Bye for now.

Hello sgonsalves,
After looking at my code more carefully, I would like you to try the following (before you delete
your ecobee device type and device):

Set the ecobeeType in the preferences to managementSet as your ecobee thermostat is EMS, and not SMART or SMART-SI (‘registered’ type).

That’s could be the reason why your group does not display properly in the UI as groups are only valid for ‘registered’ thermostats, not EMS thermostats.

Just my 2 cents.

That’s the first thing I tried, I also tried putting my serial number as the type…still doesn’t work :frowning:

Hello sgonsavles,

Last check: did you set the ecobeeType in preferences to managementSet exactly (notice the uppercase for ‘Set’)?

Otherwise, you must then delete the device type and device, and restart again.

And, after recreating it, set the preferences ecobeeType to managementSet, trace to true and
your appKey and serialNumber as specified in the readme file.

After all this, please send me the detailed trace following a poll() operation. There is something wrong that is specific to EMS thermostats when gettings groups. I need the trace to figure it out.

Against, sorry about this.

OK, as I assume that your EMS problems are related to groups, I implemented some changes
to the codebase to avoid doing getGroups() for this kind of thermostats.

Please copy and paste the latest release at github, save & publish again.

Then, if it’s not working, please send a detailed trace of the poll() operation.

Let me know.

P.S. Try doing this before deleting your deviceType and device. If it still not working, then
you can try the delete after.