Ecobee 3 Plugin --> How long does a PIN last?

I updated my ecobee 3 plugin’s PIN number the middle of last week. This morning Vera is saying, “ecobee : Not yet authorized. Press ‘Get PIN’ once; wait for PIN; enter at ecobee.com.” Yet in the Ecobee web interface - it shows that Vera is still authorized. How long does this authorization last? IF this is a Vera error, where do I look to find out why it is not retaining the authorization?

Thanks!

The PIN is simply to authorize the device to the Ecobee website. What happens is that the plugin needs a new access token from time to time and it’s supposed to happen without any user interaction. If, for some reason, it misses the new token (or reboots before it’s committed to storage), then you get the message you describe. There’s more to it than this, but that’s the jist of it. Remove the “app” from the Ecobee web page and use the new PIN to authorize it again. Used to happen to me fairly often, now it’s rare. Reboots seem to be the usual cause, at least for me…

I just came back from “fixing” it by deleting the app(s) and reinstalling them. Then reauthorized it and was enjoying the functionality for at least 3 - 5 days before this informative message.

Yes - there was a forced reboot but it was Saturday - many days after the authorization.

Will go thru the delete/re-add procedure once again. . . . Thanks for responding.

The Vera is likely rebooting without your knowledge. Mine still does it from time to time for reasons I haven’t determined as of yet. It was doing it several times a day and that appeared to be caused by the ERGY plugin (that is installed by default). All it takes is one reboot at the wrong time. Hope you get this ironed out before you get too frustrated. I haven’t had to reauthorize in weeks…

I have been going for months without this problem. The big factor is to not have the vera reload luup right at the time the token is changing. The API changes the token on a regular basis. For example if you load a config from backup on your vera, you are very likely to have renew your token.
I have been able to stabilize the vera enough to go weeks between a luup restart by moving a lot of my plugins and scenes/automation to Openluup. You can track the reboots by installing the system monitor plugin and set it to send a notification every time luup reloads.

[quote=“rafale77, post:5, topic:198582”]I have been going for months without this problem. The big factor is to not have the vera reload luup right at the time the token is changing. The API changes the token on a regular basis. For example if you load a config from backup on your vera, you are very likely to have renew your token.
I have been able to stabilize the vera enough to go weeks between a luup restart by moving a lot of my plugins and scenes/automation to Openluup. You can track the reboots by installing the system monitor plugin and set it to send a notification every time luup reloads.[/quote]

I think the issue is the stability of my Vera Secure. It seems when I have hard reboots, when it awakes everything is screwed up. Wondering if the PIN persists somewhere that is volatile and when I have to do a forced reboot, it is erased.

Well, I’ve reset it yet again. Thanks for everyone’s feedback.

I reset it on the 17th. My Vera unit hasn’t needed a force reboot during that time. This morning it asked me to get another PIN. So it lasted 7 days. ALTHOUGH on the Ecobe3 app side, it said the previous PIN was still authorized. So it undoubtedly is the Ecobee app.

The way this token works is:

  1. The app sends a request to the API with a 4 letter code,
  2. The API generates a token
  3. We manually need login into the ecobee account and link the 4 letter code of the app to the API token.
  4. The app then connects to the API using this token.
  5. The API periodically changes the token. When this occurs it sends a sync up to the app.
  6. The App receives the new token and updates it.

If your unit does a Luup reload right when step 5 occurs (or if your internet was disconnected), it misses that the token was renewed so the token is out of sync and you have to manually reconnect by going back to step 1. Of course the API will tell you the link is still valid. The API token is renewed, it is the vera which missed the change while rebooting itself.

The issue is the timing of your luup reload. I don’t know anyway around it. It is just that the Ecobee API is pretty strict on these security token.
I have been using this app for many years now and stability has dramatically improved over time without changing the app but by reducing the frequency of Luup reloads… I did this by reducing the loading on the vera, removing apps, removing devices and scenes etc… As I am gradually obsoleting the vera as well turning it into just a zwave stick.

[quote=“rafale77, post:8, topic:198582”]If your unit does a Luup reload right when step 5 occurs (or if your internet was disconnected), it misses that the token was renewed so the token is out of sync and you have to manually reconnect by going back to step 1. Of course the API will tell you the link is still valid. The API token is renewed, it is the vera which missed the change while rebooting itself.

The issue is the timing of your luup reload. I don’t know anyway around it. It is just that the Ecobee API is pretty strict on these security token.
I have been using this app for many years now and stability has dramatically improved over time without changing the app but by reducing the frequency of Luup reloads… I did this by reducing the loading on the vera, removing apps, removing devices and scenes etc… As I am gradually obsoleting the vera as well turning it into just a zwave stick.[/quote]

WOW - that explains it! We did experience internet issues with one of my routers - it lost internet connectivity for about 1 hour and it had to be rebooted. That must have been the time the new token was sent!

OK - I’ll chill. But I wanted to THANK YOU for this explanation! It really cleared things up! If I ever get extra time in my life, I’d love to learn how to develop in this ‘language’ so I can help update apps. . . Thanks again rafale77

No Problem, I only somewhat merely reverse engineered someone else’s code to make it work on UI7 and learned how it works in the process. It was originally written for UI5.
The irony of it all is that the last remaining source of my Luup reloads is currently the Hue2 Plugin which is a MCV app. All the other 3rd party plugin I have (and I run a lot of them) do not cause unwanted Luup reloads.

As I’ve stated, when it works, it’s great! :slight_smile:

But I’ve basically given up on the PIN issue and will let it sit around without being in sync until something changes with how it is working.

As someone going through this same issue with Ecobee and Vera, this thread has been very helpful, thanks. I’m using Vera and PLEG to control window fans during the summer, turning them on when the outside temperature drops below the inside temperature. I use the Ecobee remote sensors in each room to compare with the outside temperature. I was very frustrated that the Ecobee sensors would just simply stop updating, remaining stuck at the same temperature until I deleted and re-added them to my Ecobee account with a new PIN. PINs only seem to last for a few days.

If I could add something, I have found that there is a variable called “status” in the Ecobee device that has a value of 1 when everything is fine, and 0 when the connection has been lost. To get a better handle on this issue, I set up a notification on this variable, and have observed that sometimes the status goes to 0 for a few secods or minutes, and then comes back on its own, but other times it remains disconnected/status 0 until a new PIN is used.

There are additional variables (auth_token, access_token, and refresh_token) that seem to hold, or are related to, the token that rafale77 mentioned. Would there be some way to have the device automatically sense when the status has been 0 for some period of time, and then update the token automatically?

[quote=“timtownsend, post:12, topic:198582”]As someone going through this same issue with Ecobee and Vera, this thread has been very helpful, thanks. I’m using Vera and PLEG to control window fans during the summer, turning them on when the outside temperature drops below the inside temperature. I use the Ecobee remote sensors in each room to compare with the outside temperature. I was very frustrated that the Ecobee sensors would just simply stop updating, remaining stuck at the same temperature until I deleted and re-added them to my Ecobee account with a new PIN. PINs only seem to last for a few days.

If I could add something, I have found that there is a variable called “status” in the Ecobee device that has a value of 1 when everything is fine, and 0 when the connection has been lost. To get a better handle on this issue, I set up a notification on this variable, and have observed that sometimes the status goes to 0 for a few secods or minutes, and then comes back on its own, but other times it remains disconnected/status 0 until a new PIN is used.

There are additional variables (auth_token, access_token, and refresh_token) that seem to hold, or are related to, the token that rafale77 mentioned. Would there be some way to have the device automatically sense when the status has been 0 for some period of time, and then update the token automatically?[/quote]

The token change is actually initiated by the ecobee server. It is up to the ecobee app to receive the token and then adjust its communication accordingly. Mine stays up for months at a time but it is because I moved it to openLuup. The issue is that the vera slows down, hangs and reboots much too frequently causing the ecobee plugin to often miss the token from the server. At that point the communication is broken and you have to reinitiate. The solution if you have to run it on the vera is to eliminate the random spontaneous luup reload which is something I am still fighting and am about to give up on.

I have completely defeated this issue. My Ecobee now interfaces my home automation through Home Assistant. Slowly moving most of my automation over to it. Will still be keeping the Vera in the loop mostly for access to Alexa (without any effort on my part)…

Yes that’s another way to do it. I have a number of devices set up that way and then reporting into openLuup but the vera plugin actually works very well directly on openLuup so I did not feel the need t move it over.

I had it directly on the Vera. Had AltUI running as well but never managed to get a stable instance of OpenLuup. Seemed like every reboot caused issues. My RPi now runs on a 120GB SSD so many of the issues which I believe were SD card related, are gone…

I’m going to try doing it this way:

[url=https://support.ecobee.com/hc/en-us/articles/115002735511-How-do-I-connect-my-ecobee-to-the-Google-Assistant-]https://support.ecobee.com/hc/en-us/articles/115002735511-How-do-I-connect-my-ecobee-to-the-Google-Assistant-[/url]

Although I’ve become accustomed to periodically having to update the PIN in the ecobee plug-in, yesterday was the first time the plug-in refused to give me a PIN when I click “Get PIN”.

No matter how often I do so, whether in the “Devices” tab of VeraPlus or on the “Control” section of the pseudo-device (called “Thermostats” on my system), nothing seems to happen. No 4-character code.

Any clues about how to rectify this impasse, without (ugh) having to remove and re-install the plug-in?

THANKS for any insights!

  • Libra

Uh-oh, I may have stumbled upon an explanation to my own problem…

Over on his support page at Vera Plugin for Ecobee Thermostats, the plug-in’s author explains in the FAQ:

"History
2018-10-26 v1.9
Plugin stopped working, most likely due to dropping of support for TLS older than 1.2.

Fixes:

TLS 1.0 no longer supported #42"

NOTE: The “Issue #42” referenced above lives at this link - TLS 1.0 no longer supported · Issue #42 · watou/vera-ecobee · GitHub

I’m going to try digesting what all that means, and take matters into my own hands, unless someone else points me to a simple ‘fix’ in the meantime. Again, thanks for any insights!

Please excuse my rapid-fire sequence of posts, but considering that I just discovered the posted solution to this problem, I felt compelled to share the necessary information.

(1) Read and understand this thread - http://forum.micasaverde.com/index.php/topic,13836.780.html
(2) Go into the ecobee app and perform an Update. Allow it to complete.
(3) Retry the “Get PIN” (now works for me) and complete the remove/add procedure over at the “Apps” page of your Ecobee account.

Problem solved. THANKS to WATOU and RAFELE77 for their tireless efforts keeping this plug-in alive and working.