We have moved at community.getvera.com

Author Topic: Important Ecobee plugin update coming - PLEASE READ  (Read 4496 times)

Offline watou

  • Community Beta
  • Hero Member
  • ******
  • Posts: 889
  • Karma: +44/-12
Important Ecobee plugin update coming - PLEASE READ
« on: May 28, 2015, 12:42:17 am »
I was contacted by Ecobee late Wednesday, who reported that many instances of the Vera Ecobee plugin have entered a loop that is spamming their servers.  This root cause of the bug is in Vera, not in the plugin itself (the plugin has not been updated in almost a year).  I have implemented a workaround for this problem which appears in v1.1 of the plugin, which I submitted for review a little while ago.

tl;dr

Be on the lookout for version 1.1 of the plugin.  If you are using an older version, it is very important that you upgrade.  You will be able to force an update to it by going to this URL:

http://<your vera ip>:3480/data_request?id=update_plugin&Plugin=3586

The only difference from the previous version is that, when the Vera bug described below occurs, the plugin will not then spam Ecobee's API servers.  Read on for why this is important.

Technical Explanation

This spamming loop is caused by a bug in Vera, where when a plugin writes device variables, they are in fact not written until minutes later, but if the LuaUPnP process crashes before writing the variables, the variables will be lost and the plugin will restart with stale variables.  The variables of concern are OAuth authorization tokens, so when the plugin restarts with stale tokens, it will repeatedly attempt to use them until you either press the "Get PIN" button, uninstall the plugin, or disconnect or turn off the Vera.  Many users have not done this, yielding a non-working plugin that only spams Ecobee's servers.

Why This Is Important

If Ecobee plugin users do not update their plugins, then Ecobee may be forced to block the plugin for all users, at which point it will most likely not be revived.  I no longer use the plugin myself, and while I'm happy that people are using it, I will not hand over my copyrighted work to Vera or another third-party developer.  I have made this new bug workaround version purely for the benefit of existing users, and to try to mitigate the problem on behalf of Ecobee, who are a good bunch with a great set of products.  (No one is paying me to do this, and I don't benefit in any way other than knowing I tried to stave off disappointment from existing users and Ecobee.)

Ideally, Vera would fix their bugs so that this situation could be mitigated.  I am not able to fix Vera bugs.

With your help and if Vera fixes the "lost device variables problem," I will be able to proceed to the v1.2 features discussed elsewhere.



Offline slief

  • Full Member
  • ***
  • Posts: 243
  • Karma: +1/-5
Re: Important Ecobee plugin update coming - PLEASE READ
« Reply #1 on: May 28, 2015, 10:34:17 am »
When do you anticipate the new version being with the work around being released? I will go ahead and remove the plugin in the interim.

Offline tomgru

  • Hero Member
  • *****
  • Posts: 1403
  • Karma: +18/-6
Re: Important Ecobee plugin update coming - PLEASE READ
« Reply #2 on: May 28, 2015, 10:42:27 am »
I'll do it the minute I see it!

Will the update also include the temp sensor devices?  :)  (you knew that was coming...)

Offline watou

  • Community Beta
  • Hero Member
  • ******
  • Posts: 889
  • Karma: +44/-12
Re: Important Ecobee plugin update coming - PLEASE READ
« Reply #3 on: May 28, 2015, 10:48:20 am »
When do you anticipate the new version being with the work around being released? I will go ahead and remove the plugin in the interim.

@slief: Thank you for removing the plugin in the interim.  I submitted v1.1 maybe 12 hours ago or so, and historically it has taken several days for a new update to be approved.  Hopefully Vera people are reading this and will expedite their review.

For those that are using all previous versions, if your ecobee "bee" logo is grey, your Vera might be spamming Ecobee's servers.  Either ensure the "bee" logo is always green (by pressing "Get PIN" and registering the new PIN with your Ecobee account), or disable the plugin until v1.1 is available.

While typing this I got word that for those Veras that continue to spam Ecobee's servers, they will block those IPs, which will require a phone call or other contact to Ecobee to remove the block, and this would of course affect other, non-Vera clients at those IP addresses as well.  So of course we all want to avoid that if at all possible.

For those that have their plugins set to auto-update, that *ought* to happen shortly after Vera approves the update.  But some users' plugins will not auto-update.

@tomgru : Sorry, for the moment I'm just trying to put out the fires caused by this Vera bug.  After we appear to have gotten out of the danger zone, I will carry on with the v1.2 changes, which include the remote temp/occupancy sensor support.

« Last Edit: May 28, 2015, 10:59:16 am by watou »

Offline tomgru

  • Hero Member
  • *****
  • Posts: 1403
  • Karma: +18/-6
Re: Important Ecobee plugin update coming - PLEASE READ
« Reply #4 on: May 28, 2015, 10:59:35 am »
Got it... and understand.. thanks!

I checked... still green and set to auto-update... but i'll double check anyway when I see the post!

thanks for working on this for us still.. understand the challenge!

Offline watou

  • Community Beta
  • Hero Member
  • ******
  • Posts: 889
  • Karma: +44/-12
Re: Important Ecobee plugin update coming - PLEASE READ
« Reply #5 on: May 28, 2015, 11:03:31 am »
Got it... and understand.. thanks!

I checked... still green and set to auto-update... but i'll double check anyway when I see the post!

thanks for working on this for us still.. understand the challenge!

Great.  Unless I've missed something, a green "bee" icon should mean that you are OK for the moment (and that you are probably using a reliable UI5).  I will post when I see that v1.1 has been approved, but it may be approved before I see it (plugin developers don't receive automated emails when approval happens, would be nice).

Offline slief

  • Full Member
  • ***
  • Posts: 243
  • Karma: +1/-5
Re: Important Ecobee plugin update coming - PLEASE READ
« Reply #6 on: May 28, 2015, 11:29:07 am »
In the interest of not being part of an issue, I went ahead and removed the plugin. I wasn't using Vera to control my Ecobee at the moment anyway and it's been cool enough here that I haven't had the need to turn my AC on in weeks regardless. I will keep an eye on the plugin updates and reinstall mine when a new version becomes available. It's a shame that you had to do an interim plugin update instead of the new version but it's completely understandable and I know we all appreciate your efforts!

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: Important Ecobee plugin update coming - PLEASE READ
« Reply #7 on: May 28, 2015, 09:05:36 pm »
I have been trying to force the update but the version number remains at 1.0... What am I doing wrong?

Edit: I just realized that the URL only forces and update to the latest version released by mcv and does not force an update to a specific unreleased version. I guess I'll to wait.
« Last Edit: May 28, 2015, 09:17:13 pm by anhman »
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline watou

  • Community Beta
  • Hero Member
  • ******
  • Posts: 889
  • Karma: +44/-12
Re: Important Ecobee plugin update coming - PLEASE READ
« Reply #8 on: May 29, 2015, 03:39:48 am »
OK! The v1.1 version of the Ecobee plugin has been approved (thanks Vera). 

All Ecobee plugin users: PLEASE UPDATE YOUR PLUGIN NOW.

The only difference from previous is that, should a Vera bug result in the plugin restarting with stale OAuth tokens, it will now stop repeatedly making failed API calls.  You will have to press the Get PIN button and register the new PIN with your account at ecobee.com in order to continue.

If you don't update your plugin and it's stuck in this spamming mode, Ecobee has said that they may be forced to block your Vera's public IP address until the issue is resolved.  So let's avoid that by making sure you are running v1.1 from the Vera app store.

Thanks for your cooperation.

Offline tomgru

  • Hero Member
  • *****
  • Posts: 1403
  • Karma: +18/-6
Re: Important Ecobee plugin update coming - PLEASE READ
« Reply #9 on: May 29, 2015, 09:46:02 am »
DONE.  thanks so much for fast turnaround!

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: Important Ecobee plugin update coming - PLEASE READ
« Reply #10 on: May 29, 2015, 11:31:43 am »
I guess I will wait for 1.2 at this point...
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline slief

  • Full Member
  • ***
  • Posts: 243
  • Karma: +1/-5
Re: Important Ecobee plugin update coming - PLEASE READ
« Reply #11 on: May 29, 2015, 11:35:13 am »
I guess I will wait for 1.2 at this point...
If you do so, then I would suggest removing the existing plugin so that you aren't blocked by Ecobee and contribute to the server spam issue. That said, the update has been posted to Vera so you should no be able to update to the interim version which if you plan on using an Ecobee plugin while you wait for 1.2 then I would strong suggest doing the update.

Offline theal

  • Jr. Member
  • **
  • Posts: 53
  • Karma: +0/-3
Re: Important Ecobee plugin update coming - PLEASE READ
« Reply #12 on: June 02, 2015, 09:35:45 am »
thanks watou,
I had to force update to 1.1 via  http://apps.mios.com/plugin.php?id=3586 as 'auto' update did not work nor it worked through APPS tab on remote Vera's interface.

Just curious, is this related to our earlier discussion on losing token and would а suggestion 'to save the value in 2 places: in the state variable, and in a file in /tmp' help reduce this occurrence?
http://forum.micasaverde.com/index.php/topic,13836.msg211544.html#msg211544

Offline watou

  • Community Beta
  • Hero Member
  • ******
  • Posts: 889
  • Karma: +44/-12
Re: Important Ecobee plugin update coming - PLEASE READ
« Reply #13 on: June 02, 2015, 02:03:12 pm »
thanks watou,
I had to force update to 1.1 via  http://apps.mios.com/plugin.php?id=3586 as 'auto' update did not work nor it worked through APPS tab on remote Vera's interface.

I'm glad you were able to update the plugin to v1.1.  There was a long history before about trouble updating plugins, and hopefully your experience will help others.

Just curious, is this related to our earlier discussion on losing token and would а suggestion 'to save the value in 2 places: in the state variable, and in a file in /tmp' help reduce this occurrence?
http://forum.micasaverde.com/index.php/topic,13836.msg211544.html#msg211544

It may be related, but I have no logs from those instances which were/are failing and causing the server spamming, no means to identify who the users are that are in this situation, what percentage of plugin users are having this problem, or what the root cause of the problem is.  All I can do is put out the update v1.1, that, upon the error back from the API stops the spamming, and post this topic on the forum, in hopes users read it.

So, from that, I'm left with the possibility of writing very speculative code in order to try to work around what for some users may be a major bug in Vera, where device variable storage is simply not to be relied upon.  It's like saying, "we ship a product with two hard disks and the primary disk is known to fail sometimes due to software bugs, so save a backup copy of what you think is important on the second hard disk, just in case." My preference would be to have the vendor fix the buggy disk software, so I could simply know that writing important values to the documented locations could be relied upon.

But at the end of the day, I have very limited time to diagnose issues outside the plugin, and can only keep it from spamming the API servers, and try to deliver the intended functions.

watou

Offline theal

  • Jr. Member
  • **
  • Posts: 53
  • Karma: +0/-3
Re: Important Ecobee plugin update coming - PLEASE READ
« Reply #14 on: June 03, 2015, 08:39:52 am »

So, from that, I'm left with the possibility of writing very speculative code in order to try to work around what for some users may be a major bug in Vera, where device variable storage is simply not to be relied upon.  It's like saying, "we ship a product with two hard disks and the primary disk is known to fail sometimes due to software bugs, so save a backup copy of what you think is important on the second hard disk, just in case." My preference would be to have the vendor fix the buggy disk software, so I could simply know that writing important values to the documented locations could be relied upon.

watou

I read somewhere in this forum that MCV claims this bug is a 'feature' of caching writes for not to wear-down the memory.
LOL