Ecobee Plugin

Posted on
Wed Jun 13, 2018 8:24 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Ecobee Plugin

I looked at the open pull requests on that repo and neither of them seemed to be related to API authentication issues. One is fan support and the other is climate settings.

The latest release (as of November 30th) does have a resolution for some API issues, but assuming everyone that's experiencing the current issue is using that version (1.1.2) then apparently something else has changed in the way the API authenticates.

If someone can figure out how to fix the current issues and I don't hear from the developer in the next week or two, then we can fork the repo into our account and then they can submit the pull request to our fork and we'll work out the logistics of getting it integrated.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Jul 01, 2018 11:13 pm
thumpinc offline
Posts: 41
Joined: May 11, 2013

Re: Ecobee Plugin

That would be awesome. This is a key plugin for us as it provides occupancy and temp info on half a dozen rooms. Right now it is not reliable to use for HVAC management and would love to see that change.
Thanks!

Posted on
Mon Jul 02, 2018 11:02 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Ecobee Plugin

Has anyone figured out how to fix the current plugin? Let me know and I'll start the process of moving it over.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Jul 02, 2018 11:05 am
rapamatic offline
Posts: 276
Joined: Aug 03, 2015
Location: Glencoe, IL

Re: Ecobee Plugin

I think a lot of the stability issues could be fixed by incorporating the updates to the underlying pyecobee code that this is based off of... unfortunately the specifics of how to do this is a bit over my head.


Sent from my iPhone using Tapatalk

Posted on
Sun Jul 15, 2018 3:58 am
wmldwilly offline
Posts: 51
Joined: Aug 21, 2010

Re: Ecobee Plugin

I've been lurking waiting to see/hear what the "state of the state" is with respect to indigo supporting ecobee since I first started trying to use the plugin (in January or so...my trail of posts are still here in this forum from that time period), and experiencing the two biggest showstoppers we all experience...it de-authenticates every few days or maybe week or so and nobody knows why, and fan support still doesn't work. I'd add a third issue that is annoying but could be considered a bridge to storm later, as in *after* the authentication issue is worked out and hopefully the fan issue as well and that's triggering the thermostat's basic states such as it's "comfort settings" (their lingo for set point presets), or releasing a thermostat from a "hold" condition (which is enabled when a manual set point request is made), also known as "Resuming your schedule" in Ecobee lingo.

As of posting this note I just re-authenticated the plugin for the 889857594848678694837th time since I started using it. :shock: I'm sure that surprises no one, since it hasn't ever worked for seemingly anybody.

Jay or Matt are you guys ready to take ownership of this seemingly abandoned plugin? or are you still waiting for the community to figure out a way to fix it? As a person who regularly tells people about or shows my neighbors our terribly pervasive and slick home automation with Indigo at it's heart, I'm really getting tired of telling them "well, it, um, sort of doesn't really support the ecobee...in a...um...consistent working fashion...sort of..." :mrgreen:

Waiting and watching eagerly for a fix, or at least some statement of a path to get Indigo to a place where it actually can be said to "support" ecobee thermostats. :fingers crossed:

Posted on
Sun Jul 15, 2018 10:03 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Ecobee Plugin

Unfortunately, we can't assume development responsibility for any abandoned 3rd party plugins (we've already passed development of some of our plugins off to the community so that they can live on) - we've already got very full plates as it is. We can fork the plugin into our open source repo so that it's easier for others to contribute to it, but it's going to take someone else to actually do the development work.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Jul 15, 2018 10:40 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Ecobee Plugin

rapamatic wrote:
I think a lot of the stability issues could be fixed by incorporating the updates to the underlying pyecobee code that this is based off of... unfortunately the specifics of how to do this is a bit over my head.


The pyecobee files included in the plugin don't reference WHICH source it's based on. There's two on GitHub, very similar in layout, neither of which looks like the one in the plugin. So I'm not sure that's really a solution.

OTOH, I think I may know what the problem is with the current code. The authentication tokens expire after a certain amount of time. The API docs show 3599 (seconds) as an example of the expiration time that's returned by the API call. If the tokens are not refreshed BEFORE they expire, you have to start over with new tokens. You can't refresh expired tokens.

Now, the code does a refresh any time you send a command to change something via the API. It does not do a refresh on device queries, unless it gets an error. But if the error was due to expired tokens, it's too late to attempt to refresh them.

Jay - if you fork it onto the Indigodomo account, I'll merge the existing requests and attempt a fix for this token refresh.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun Jul 15, 2018 12:59 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Ecobee Plugin

FlyingDiver wrote:
Jay - if you fork it onto the Indigodomo account, I'll merge the existing requests and attempt a fix for this token refresh.


Ok, I'll do that tomorrow.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Jul 16, 2018 9:22 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Ecobee Plugin

jay (support) wrote:
FlyingDiver wrote:
Jay - if you fork it onto the Indigodomo account, I'll merge the existing requests and attempt a fix for this token refresh.


Ok, I'll do that tomorrow.


Done. Let me know if I got something wrong... ;)

[EDIT] Looking at it more closely, it looks like the pull requests didn't come over with the fork. Not sure how to rectify that but perhaps you do. Keep me posted.

[EDIT, EDIT] This might help.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Jul 16, 2018 9:26 am
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Ecobee Plugin

[quote="Flying Diver]

OTOH, I think I may know what the problem is with the current code. The authentication tokens expire after a certain amount of time. The API docs show 3599 (seconds) as an example of the expiration time that's returned by the API call. If the tokens are not refreshed BEFORE they expire, you have to start over with new tokens. You can't refresh expired tokens.

Now, the code does a refresh any time you send a command to change something via the API. It does not do a refresh on device queries, unless it gets an error. But if the error was due to expired tokens, it's too late to attempt to refresh them.
[/quote]

Nice! Thanks for putting the problem up for shleps like me who are following!


Sent from my iPhone using Tapatalk

Posted on
Mon Jul 16, 2018 9:38 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Ecobee Plugin

FlyingDiver wrote:
The authentication tokens expire after a certain amount of time. The API docs show 3599 (seconds) as an example of the expiration time that's returned by the API call. If the tokens are not refreshed BEFORE they expire, you have to start over with new tokens. You can't refresh expired tokens.


If they are implementing OAuth, then this is broken. In OAuth 2.0, when you originally request a token from an OAuth server, you receive both an authorization token and a refresh token. The auth token usually has a relatively short lifespan. You send the auth token in an HTTP_AUTHORIZATION header, and when the auth token expires, then the client uses the refresh token to get a new auth/refresh token pair (and you receive both an auth token and a refresh token). When that auth token expires, you use the refresh token that came with it to get a new token pair. Rinse, repeat.

I wonder if the problem is that the plugin is keeping the original refresh token and trying to always use that. That would definitely cause errors because you're supposed to use the refresh token that you got with the auth token to get a new pair.

We include both oauthlib v2.0.2 and requests_oauthlib v0.8.0 with Indigo 7.1+. Those might help in adding the OAuth client stuff.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Jul 16, 2018 10:07 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Ecobee Plugin

jay (support) wrote:
If they are implementing OAuth, then this is broken. In OAuth, when you originally request a token from an OAuth server, you receive both an authorization token and a refresh token. The auth token usually has a relatively short lifespan. When the auth token expires, then the client uses the refresh token to get a new auth/refresh token pair (and you receive both an auth token and a refresh token). When that auth token expires, you use the refresh token that came with it to get a new token pair.


That's how it's supposed to work, but I'm not sure if it's actually working as designed. It's invalidating the auth token on any error, as best I can tell. I don't think that's the right approach.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Jul 16, 2018 10:36 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Ecobee Plugin

jay (support) wrote:
I wonder if the problem is that the plugin is keeping the original refresh token and trying to always use that. That would definitely cause errors because you're supposed to use the refresh token that you got with the auth token to get a new pair.


I think it's saving the new tokens. I'm running a modified version of the plugin with better debugging so I might be able to figure out what's going on.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Jul 16, 2018 3:13 pm
wmldwilly offline
Posts: 51
Joined: Aug 21, 2010

Re: Ecobee Plugin

...and literally all of us are cheering you on! :P :P :P

Posted on
Mon Jul 16, 2018 3:15 pm
rapamatic offline
Posts: 276
Joined: Aug 03, 2015
Location: Glencoe, IL

Re: Ecobee Plugin

FlyingDiver wrote:

I think it's saving the new tokens. I'm running a modified version of the plugin with better debugging so I might be able to figure out what's going on.


Awesome, thanks for helping with this. I’m out of town this week, but happy to help with any testing next week. Thanks for taking the reins on this. Where do I send the beer?


Sent from my iPhone using Tapatalk

Who is online

Users browsing this forum: No registered users and 7 guests

cron