Ecobee plugin continued

Posted on
Sun Jul 29, 2018 6:15 pm
FlyingDiver offline
User avatar
Posts: 7211
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Ecobee plugin continued

Code: Select all
lastmodeVar = indigo.variables[12345678] # "some Indigo variable"
Ecobee = indigo.devices[9876543] # "Ecobee Thermostat"

indigo.variable.updateValue(lastmodeVar, str(Ecobee.hvacMode))


Or, in one line:

Code: Select all
indigo.variable.updateValue(indigo.variables[12345678], str(indigo.devices[9876543].hvacMode))


And I'm not sure that string cast is actually needed. ;)

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

Posted on
Sun Jul 29, 2018 6:19 pm
FlyingDiver offline
User avatar
Posts: 7211
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Ecobee plugin continued

Or:
Attachments
Screen Shot 2018-07-29 at 8.18.13 PM.png
Screen Shot 2018-07-29 at 8.18.13 PM.png (301.28 KiB) Viewed 3606 times

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

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

Re: Ecobee plugin continued


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

Posted on
Mon Jul 30, 2018 2:18 pm
bhough17 offline
Posts: 13
Joined: Jan 04, 2018

Re: Ecobee plugin continued

FlyingDiver - exactly what I was looking for. Thanks!

Posted on
Tue Jul 31, 2018 8:43 am
rapamatic offline
Posts: 276
Joined: Aug 03, 2015
Location: Glencoe, IL

Re: Ecobee plugin continued

I lost connectivity this morning, around 5:30 am Central Time. My log is below. My log was filled with the not authenticated messages every minute. Upon restarting the plugin everything seems to be working again.

Code: Select all
Jul 31, 2018, 5:29:10 AM
   Ecobee                          Error connecting to Ecobee.  Possible connectivity outage.
   Ecobee                          no thermostats found; authenticated?
   Ecobee                          Error connecting to Ecobee while attempting to get thermostat data.  Refreshing tokens and trying again.
   Ecobee Error                    Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 164, in runConcurrentThread
  File "plugin.py", line 320, in updateAllDevices
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Ecobee.indigoPlugin/Contents/Server Plugin/ecobee_devices.py", line 160, in updateServer
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Ecobee.indigoPlugin/Contents/Server Plugin/ecobee_devices.py", line 118, in updatable
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Ecobee.indigoPlugin/Contents/Server Plugin/pyecobee/__init__.py", line 158, in get_thermostats
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Ecobee.indigoPlugin/Contents/Server Plugin/pyecobee/__init__.py", line 130, in refresh_tokens
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Ecobee.indigoPlugin/Contents/Server Plugin/pyecobee/__init__.py", line 88, in request_pin
KeyError: 'code'

   Ecobee Error                    plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   Ecobee                          not authenticated to pyecobee yet; not initializing state of device G5PH
   Ecobee                          not authenticated to pyecobee yet; not initializing state of device 314784831377
   Ecobee                          not authenticated to pyecobee yet; not initializing state of device 173448830954
   Ecobee                          not authenticated to pyecobee yet; not initializing state of device 150992022817
   Trigger                         Ecobee Auth Event
   Pushover Debug                  Auth Failure Event
   Pushover Debug                  Ecobee Sync
   Pushover Debug                  Result: {"status":1,"request":"d1c0f799-27f1-4065-b867-dde0561eff0b"}



Sent from my iPad using Tapatalk

Posted on
Tue Jul 31, 2018 8:45 am
FlyingDiver offline
User avatar
Posts: 7211
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Ecobee plugin continued

Happened to me at the same time:

Code: Select all
2018-07-31 06:29:03.717   Ecobee   Error connecting to Ecobee while attempting to get thermostat data.  Refreshing tokens and trying again.


So their servers went down and the plugin didn't handle it well. I'll be looking into that.

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

Posted on
Tue Jul 31, 2018 4:03 pm
FlyingDiver offline
User avatar
Posts: 7211
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Ecobee plugin continued

I've taken out all the places where the underlying Ecobee library would get an error and try to force a re-authentication. So right now the plugin refreshes the tokens on a schedule.

If a real error occurs it'll just fail until it can actually refresh tokens. I think this is actually safer and more stable, since I think almost all the authentication fails are actually caused by temporary Ecobee server outages.

This is marked as a pre-release until it gets some testing time.

https://github.com/IndigoDomotics/indig ... /tag/1.2.4

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

Posted on
Thu Aug 02, 2018 8:45 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Ecobee plugin continued

Playing with this tonight.

Ver 1.2.2 is a bad link, apparently.

I tried ver 1.2.1
Adding my device via the Ecobee web interface with the provided pin worked. When I clicked "Refresh Credentials," the log started showing errors as follows (please let me know if you need more specific data (and how to get it)):
Code: Select all
   Stopped plugin "Ecobee 1.2.1"
   Starting plugin "Ecobee 1.2.1" (pid 87633)
   Ecobee Error                    pyecobee::get_thermostats(): Error connecting to Ecobee while attempting to get thermostat data
   Ecobee Error                    Status code = 500
   Ecobee Error                    pyecobee: refreshing tokens; current authentication flag is False
   Ecobee Error                    pyecobee: NOT authenticated after refreshing tokens
   Ecobee Error                    Status code = 400, error = The request is malformed. Check parameters.
   Ecobee Error                    Please authorize your ecobee developer app with PIN code ymy8
Goto https://www.ecobee.com/consumerportal/index.html, click
My Apps, Add application, Enter Pin and click Authorize.
After authorizing, call request_tokens() method.
   Ecobee Error                    pyecobee: finished refreshing tokens; authenticated flag is False
   Ecobee Error                    pyecobee::get_thermostats(): refresh_tokens() failed.
   Ecobee Error                    Ecobee device requires authentication; open plugin configuration page for info
   Started plugin "Ecobee 1.2.1"
   Ecobee                          Starting Ecobee
   Ecobee                          not authenticated to pyecobee yet; not initializing state of device VWSF
   Ecobee                          added remote sensor VWSF
   Ecobee                          not authenticated to pyecobee yet; not initializing state of device VWXG
   Ecobee                          added remote sensor VWXG
   Ecobee                          not authenticated to pyecobee yet; not initializing state of device VWWX
   Ecobee                          added remote sensor VWWX
   Ecobee                          not authenticated to pyecobee yet; not initializing state of device 511892028983
   Ecobee                          added thermostat 511892028983
   Ecobee                          added smart thermostat 411980329199
   Ecobee                          not authenticated to pyecobee yet; not initializing state of device VWSF
   Ecobee                          not authenticated to pyecobee yet; not initializing state of device VWXG
   Ecobee                          not authenticated to pyecobee yet; not initializing state of device VWWX
   Ecobee                          not authenticated to pyecobee yet; not initializing state of device 511892028983
   Ecobee                          not authenticated to pyecobee yet; not initializing state of device 411980329199

Aug 2, 2018, 10:40:27 PM
   Ecobee Error                    pyecobee: requesting tokens; current authentication flag is False
   Ecobee Error                    Error while requesting tokens from ecobee.com.
   Ecobee Error                    Status code = 401, error = Waiting for user to authorize application.
   Ecobee Error                    pyecobee: finished requesting tokens; authenticated flag is False



Sorry if this is human error.

The irony is this plugin was working for me (albeit a hacky workaround).
Last edited by mundmc on Thu Aug 02, 2018 8:46 pm, edited 1 time in total.

Posted on
Thu Aug 02, 2018 8:46 pm
FlyingDiver offline
User avatar
Posts: 7211
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Ecobee plugin continued

The latest is 1.2.4. Try that. Get a new PIN, put it in the web interface, then refresh credentials.

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

Posted on
Sat Aug 04, 2018 3:06 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Ecobee plugin continued

Version 1.2.4 running really well for me so far. Thank you again!

Posted on
Tue Aug 07, 2018 8:05 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Ecobee plugin continued

Just got this (below), tell me what else you need, if anything.

Code: Select all
Aug 7, 2018, 10:03:22 PM
   Ecobee                          Error connecting to Ecobee.  Possible connectivity outage.
   Ecobee Error                    Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 163, in runConcurrentThread
  File "plugin.py", line 319, in updateAllDevices
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Ecobee.indigoPlugin/Contents/Server Plugin/ecobee_devices.py", line 159, in updateServer
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Ecobee.indigoPlugin/Contents/Server Plugin/ecobee_devices.py", line 56, in _get_thermostat_json
TypeError: 'NoneType' object is not iterable

   Ecobee Error                    plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)

Posted on
Tue Aug 07, 2018 8:12 pm
FlyingDiver offline
User avatar
Posts: 7211
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Ecobee plugin continued

mundmc wrote:
Just got this (below), tell me what else you need, if anything.

Code: Select all
Aug 7, 2018, 10:03:22 PM
   Ecobee                          Error connecting to Ecobee.  Possible connectivity outage.
   Ecobee Error                    Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 163, in runConcurrentThread
  File "plugin.py", line 319, in updateAllDevices
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Ecobee.indigoPlugin/Contents/Server Plugin/ecobee_devices.py", line 159, in updateServer
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Ecobee.indigoPlugin/Contents/Server Plugin/ecobee_devices.py", line 56, in _get_thermostat_json
TypeError: 'NoneType' object is not iterable

   Ecobee Error                    plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)


Can you create an issue for that on GitHub? The problem is as logged in the first line, something failed talking to the servers. But the plugin should recover better.

Did it work ok on the retry?

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

Posted on
Wed Aug 15, 2018 9:42 am
wmldwilly offline
Posts: 51
Joined: Aug 21, 2010

Re: Ecobee plugin continued

I'm pretty darn excited to see my fan events working as expected and no apparent disconnects for about a day now!!!! One oddity and this is probably my misunderstanding: I downloaded the plugin to my indigo machine and let it "update" itself, then followed (sort of reflexively) the "get pin, go to ecobee site, remove app, re-add app, return to indigo, get keys" move and encountered a log full of errors. I noticed in the log entries it seemed the plug-in reached out and got it's own 4-character pin that was different from the one I got when using the configuration dialog box? It seemed to settle in and work from then on out after I repeated the process using that different 4 character pin that I caught going by in the log entries.

I kind of like the "get it's own pin" maneuver...is that the new way coming going forward?

Thanks again - great work!

Posted on
Wed Aug 15, 2018 10:09 am
FlyingDiver offline
User avatar
Posts: 7211
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Ecobee plugin continued

wmldwilly wrote:
I kind of like the "get it's own pin" maneuver...is that the new way coming going forward?


No, that's a holdover from the original development of an underlying library that the plugin uses. I don't want anyone to have to dig through the logs to get the PIN. It should all work from the config dialog.

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

Posted on
Thu Aug 16, 2018 6:05 pm
wmldwilly offline
Posts: 51
Joined: Aug 21, 2010

Re: Ecobee plugin continued

Hmm...

A good stretch of a day and a half or so with no issues, then early this morning:

Aug 16, 2018, 7:34:07 AM
Ecobee Error connecting to Ecobee while attempting to get thermostat data. Refreshing tokens and trying again.
Z-Wave received "Console area - Temperature" sensor update to 79.77 °F
Z-Wave received "Console area - Humidity" sensor update to 57.37%
Z-Wave received "Console area - Luminance" sensor update to 1.21%
Z-Wave received "002 - Console area - Motion Sensor" status update battery level 5%
Ecobee Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 164, in runConcurrentThread
File "plugin.py", line 318, in updateAllDevices
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Ecobee.indigoPlugin/Contents/Server Plugin/ecobee_devices.py", line 272, in updateServer
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Ecobee.indigoPlugin/Contents/Server Plugin/ecobee_devices.py", line 118, in updatable
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Ecobee.indigoPlugin/Contents/Server Plugin/pyecobee/__init__.py", line 158, in get_thermostats
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Ecobee.indigoPlugin/Contents/Server Plugin/pyecobee/__init__.py", line 123, in refresh_tokens
File "/Library/Application Support/Perceptive Automation/Indigo 7/IndigoPluginHost.app/Contents/PlugIns/requests/api.py", line 111, in post
File "/Library/Application Support/Perceptive Automation/Indigo 7/IndigoPluginHost.app/Contents/PlugIns/requests/api.py", line 57, in request
File "/Library/Application Support/Perceptive Automation/Indigo 7/IndigoPluginHost.app/Contents/PlugIns/requests/sessions.py", line 477, in request
File "/Library/Application Support/Perceptive Automation/Indigo 7/IndigoPluginHost.app/Contents/PlugIns/requests/sessions.py", line 587, in send
File "/Library/Application Support/Perceptive Automation/Indigo 7/IndigoPluginHost.app/Contents/PlugIns/requests/adapters.py", line 467, in send
ConnectionError: ('Connection aborted.', error(54, 'Connection reset by peer'))

Ecobee Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
Ecobee not authenticated to pyecobee yet; not initializing state of device M8RV
Ecobee not authenticated to pyecobee yet; not initializing state of device LG78
Ecobee not authenticated to pyecobee yet; not initializing state of device DJ8Z
Ecobee not authenticated to pyecobee yet; not initializing state of device DJ7V
Ecobee not authenticated to pyecobee yet; not initializing state of device FNJR
Ecobee not authenticated to pyecobee yet; not initializing state of device 310135690846
Ecobee not authenticated to pyecobee yet; not initializing state of device 315601667399

...but this is using v 1.2.3. I'm assuming you'd want me to install 1.2.4 (which I'm about to do) but just wanted to doublecheck.

thanks as always!

Who is online

Users browsing this forum: No registered users and 2 guests