Ecobee3RemoteSensorInit

The Unofficial SmartThings Blog
Jump to: navigation, search
This smartapp is Ecobee approved badge YVESR.png
ecobee3 Thermostat with Sensor, Wi-Fi, 2nd Generation, Works with Alexa

ecobee3 Thermostat with Sensor, Wi-Fi, 2nd Generation, Works with Alexa

Category: My Apps

Author:Yves Racine

ST Community handle: http://community.smartthings.com/users/yvesracine/activity

Company Link: http://www.ecomatiqhomes.com#!home/mainPage


Prerequisites

 * Ecobee3 or ecobee4 thermostat controlled via ST by MyEcobee device
    => see http://thingsthataresmart.wiki/index.php?title=My_Ecobee_Device
 * Connected & fully operational ecobee3's or ecobee4's proprietary remote sensors (ecobee3 and higher- type of sensors)

Summary

ecobeeRemoteSensorsInit, the smartapp that creates individual ST sensors for your ecobee3's & ecobee4's proprietary remote Sensors and polls them on a regular basis. Please note that the smartapp can handle one ecobee thermostat at a time.

If you have many ecobee thermostats, you need to rename the smartapp at the last page.

Supported Features

  • Multiple remote sensors (temperature,motion) from a single thermostat can be selected to be exposed to SmartThings.
  • Do a poll at regular intervals (input parameter) to get the refresh occupancy and/or temperature values from ecobee.
  • Notify you if there is any issue with the ST/ecobee connection (optional).

Code location:

http://github.com/yracine/device-type.myecobee/tree/master/smartapps

Instructions for ecobee3RemoteSensorInit installation (readme):

http://github.com/yracine/device-type.myecobee/blob/master/smartapps/readme.ecobee3RemoteSensor

Instructions for My Ecobee Device installation (readme):

http://github.com/yracine/device-type.myecobee/blob/master/README.md


Known issues

.................................................................................................................................

1. Occupancy sensors (not motion sensors) are not updated in real time

.................................................................................................................................

In brief, ecobee doesn't allow real-time motion events at the moment.

As specified in the ecobee API documentation:

   http://www.ecobee.com/home/developer/api/documentation/v1/objects/RemoteSensor.shtml

Which states (about motion occupancy):

The remote sensor data will only show computed occupancy, as does the thermostat. Definition - For a given sensor, computed occupancy means a sensor is occupied if any motion was detected in the past 30 minutes.


N.B. The remote sensor's temp capability is different as it can be refreshed every 3-5 minutes.

Troubleshooting

For specific MyEcobee Device's errors/issues, please check the following troubleshooting section:

   http://thingsthataresmart.wiki/index.php?title=My_Ecobee_Device

.................................................................................................................................

Issue #1: I don't know how to create a custom smartapp

.................................................................................................................................

See the explanations of a fellow community member here:

http://community.smartthings.com/t/faq-an-overview-of-using-custom-code-in-smartthings/16772


And, here are some basic explanations with screenshots.

  • Point your browser to you SmartThings IDE for your country (i.e. http://ide.smartthings.com or whatever your shard is) and Log In.

Loginscreen.jpg

  • Once you are logged in, find the My SmartApps link on the top of the page. Clicking My SmartApps will allow you to produce a new SmartApp.

MySmartApps.png

  • Find the button on this page labeled +New SmartApp and click it.

+NewSmartApp.png

  • Since you already have the code in your computer’s clipboard, find the tab along the top section called From Code. In the area provided, paste (typically CTRL+V) the code you copied from GitHub. Click Create in the bottom left corner of the page.

NewSmartAppCreate.png

  • This will bring up another page, with the code now formatted within the IDE. If the code was copied correctly, there are no other steps except to save and publish the code. In the upper right corner of the page, find and click Save. Now, click Publish (For Me), and you should receive a confirmation that the code has been published successfully.

SavePublish.png

.................................................................................................................................

Issue #2: I created the smartapp in the IDE, but I don't know where to execute it

.................................................................................................................................


For the initial setup, under the ST app, click on the Marketspace? item in the bottom menu, and then, on the smartapps link and finally, MyApps (last item in the list).

If you still do not see your smartapp, please make sure that you have published it in the IDE!

For any subs?equent execution, under the ST mobile app, click on automations>smartapps in the bottom menu. The list of installed smartapps will then appear.


......................................................................................................................................

Issue #3: I executed ecobee3RemoteSensorInit smartapp, but the remote sensors selection page is blank

......................................................................................................................................


If you have a blank page in ecobee3RemoteSensorInit or "a unexpected error occurred" while executing the smartapp, please check the following:

  • Make sure that you have the latest firmware (at least v3.6) as motion sensors are not detected prior to that firmware version.
  • Make sure that all your ecobee's remote sensors are actually reporting to the physical ecobee thermostat...

In some cases, remote sensors may have some connection issues with your physical thermostat, and the smartapp is not able to detect them.


......................................................................................................................................

Issue #4: I executed ecobee3RemoteSensorInit smartapp, but I get some error messages

  • physicalgraph.app.exception.UnknownDeviceTypeException: Device type 'Motion Detector' in namespace 'smartthings' not found
  • physicalgraph.app.exception.UnknownDeviceTypeException: Device type 'Temperature Sensor' in namespace 'smartthings' not found

......................................................................................................................................


Make sure to complete step 3 in the readme file.

   http://github.com/yracine/device-type.myecobee/blob/master/smartapps/readme.ecobee3RemoteSensor

......................................................................................................................................

Issue #5: I want to add additional remote sensors but I get the following error message

......................................................................................................................................

  • "Device still in use. Remove from any SmartApps or Dashboards, then try again"

ecobee3RemoteSensorInit will update the list of ST connected remote sensors by deleting all sensors first and then re-adding them.

If your previous remote sensors were used in other smartapps, you'd need first to unselect/remove them from all other smartapps before being able to add the new remote sensors.

As an alternative, you may want to create another instance of ecobeeRemoteSensorInit (and you change its name at the last page) with the additional remote sensors.

.................................................................................................................................

Issue #6: I want to disable any notifications from ecobee3RemoteSensorInit

.................................................................................................................................

Go to the smartapp's last page, and answer 'no' to the following question:

Send a push notification?"''

Be aware that you won't be notified of any connection issues.


.................................................................................................................................

Issue #7: I would like to add new remote sensors or new ecobee3 thermostat(s) at my home

.................................................................................................................................

You'd need to create new instance(s) of ecobee3RemoteSensorInit as the smartapp can handle only 1 thermostat at a time. You need then to rename the smartapp at the last page for each of your thermostats.


You can use the same approach if you need to add new ecobee3 remote sensors, and do not want to uninstall any of your existing ecobee3 remote sensors in other smartapps.


.................................................................................................................................

Issue #8: java.lang.NullPointerException: Cannot get property 'X' on null object

.................................................................................................................................


Just update your smartapp by going through all the smartapp setup pages by pressing 'Next' till 'Done'.

The smartapp was recently modified to include some defensive code to ensure that the smartapp is rescheduled. This is intended to alleviate some of the ST scheduling issue as discussed in these threads:


http://community.smartthings.com/t/scheduler-and-polling-quits-after-some-minutes-hours-or-days/16997

http://community.smartthings.com/t/schedule-not-working/3895

http://community.smartthings.com/t/is-it-me-or-schedules-not-firing-this-evening/10176


.................................................................................................................................

Issue #9: Execution time exceeded 'x' app execution seconds

.................................................................................................................................

ST has introduced some generic rate limiting rules for all smartapps and device handlers. For cloud-to-cloud integrations, these rate limiting constraints are sometimes too low, and this exception can be raised from time to time.

There are some threads about it in the ST community forum:

http://community.smartthings.com/t/rate-limiting-too-restrictive-max-execution-time-exceptions/17985

http://community.smartthings.com/t/execution-times-increasing/19979

http://community.smartthings.com/t/unschedule-api-execution-time-too-long/11232


.................................................................................................................................

Issue #10: I want to upgrade the code but I don't know how

.................................................................................................................................

Most of the time (unless specified otherwise), you just need to copy and paste the smartapp's new code into the IDE at:


https://graph.api.smartthings.com/ide/apps

Click on the smartapp that you want to update

Paste the code into the code window (and make sure to copy all the lines)

And save & publish.


.................................................................................................................................

Issue #11: I have too many connection and timeout issues

.................................................................................................................................

Update: Following some ST DB and some scheduler changes (more to come), the http exceptions are gone. I just keep the documentation just in case (as a reference)....


For some unknown reasons, the cloud-to-cloud connection between SmartThings and ecobee can sometime generate some timeout and unauthorized exceptions (when the refresh token is not issued on time).

It may be caused by some connection pool management issues or just server issues that are not tracked by either party (ST or ecobee).

If you have many recurrent connection issues, please contact ST support as my code does not have any control over the connection issues between ST and ecobee.

In the meantime, try to reduce the poll interval to at least 30 minutes (the default) within the ecobee3RemoteSensorInit smartapp.

And, the connection issues are not specific to MyEcobeeDevice as per these threads:

TCP Hub

https://community.smartthings.com/t/smartthings-losing-connection-to-tcp-hub/17093

Stock Ecobee device

https://community.smartthings.com/t/having-to-authorize-ecobee-2-3-times-a-day/18282

Philips Hue

https://community.smartthings.com/t/philips-hue-bulbs-no-longer-working-and-getting-noavailablehostsexception/20899/3

Wemo

https://community.smartthings.com/t/losing-comunication-with-wemo-switch/17045

Wink Quirky Pivot

https://community.smartthings.com/t/wink-authorization-to-connect-quirky-pivot-power-genius/12356

Logitech Harmony

https://community.smartthings.com/t/harmony-home-control-smartthings-control-and-vice-versa/6716

Amazon echo

https://community.smartthings.com/t/issues-with-smartthings-app-ide-and-cloud-integrations/30005

MyQ

https://community.smartthings.com/t/release-myq-liftmaster-chamberlain/8939/568


.................................................................................................................................

Issue #12: java.lang.ArrayIndexOutOfBoundsException

.................................................................................................................................


Make sure that MyEcobee device is operational and responsive to your commands. This may indicate that MyEcobee Device has some connection issues and it's not able to retrieve any sensor data.

Also, make sure to have the latest version at github for myEcobee device and ecobee3RemoteSensorInit smartapp.

In order to get more tracing:

(a) Set My ecobee Device's trace preferences to 'true'

N.B. You should remove this preference (and leave it to blank) after doing debugging as this may impact performance.

(b) Activate Live logging at https://graph.api.smartthings.com/ide/logs

(c) Filter the logs for myEcobee Device & ecobee3RemoteSensorInit.


If you have any connection issues with My Ecobee device, please refer to

http://thingsthataresmart.wiki/index.php?title=My_Ecobee_Device#Known_issues



.................................................................................................................................

Issue #13: My temp/motion sensors are not refreshing in the ST UI

.................................................................................................................................

Like any devices under ST, no updates to the UI are done automatically. A poll command needs to be sent to MyEcobee device to trigger the remote sensors' updates. If you see a temperature change at the ecobee thermostat unit, it will be sent via the APIs at the next cycle (the cycle intervals are defined under MyEcobeeInit and ecobeeRemoteSensorInit).


Please also take into account the following:

a) Only new motion values will be posted by ST

If there is no changes in motion values, ST will not post any events. As an example, if there is no motion in a room (with a remote sensor), then there may be no new motion events for hours.


b) Make sure that your remote sensors are reporting correctly at the physical ecobee thermostat

There are some known issues with the ecobee remote sensors:

http://www.smarthomehub.net/forums/discussion/691/remote-sensor-always-says-unoccupied


c) Ecobee API limitations

You also need to take into account that there are some known ecobee limitations related to the motion capability:

Refer to

http://thingsthataresmart.wiki/index.php?title=Ecobee3RemoteSensorInit#Known_issues


d) Make sure that your ST thermostat is operational by manually refreshing the thermostat device ( set the trace parameter to true, hit the "refresh" tile, and then check the list of events in the recently tab).

There have been some scheduling issues recently, so you may want to check your connection with ecobee. If you have lost your auth tokens, you need to re-authenticate withe ecobee using MyEcobeeInit smartapp (Service Manager).


e) ST Scheduler issues

As you may know by now, there have been some serious ST scheduler issues for months.

See this thread for more details about the ST scheduler issue:

https://community.smartthings.com/t/scheduler-and-polling-quits-after-some-minutes-hours-or-days/16997

Since the deployment of the new scheduler (Ticker), the scheduler issues are less prevalent, but still there are some issues from time to time.

https://community.smartthings.com/t/new-scheduler-codename-ticker-being-rolled-out/42897


In any case, some watchdogs have been implemented in my code to get around the scheduling issues.

The watchdog acts as a 'heartbeat', so you should use a single device which polls on a regular basis (every 5-10 minutes) such as a SmartSense sensor, a Smart Vent, Aeon HEM (energy meter), etc.


You have 4 options available in the last page of the smartapp ("Other Options" under the "watchdogs" section). Please choose a single watchdog to avoid too frequent scheduling.


(i)- The smartapp can subscribe to some temp sensor(s) for any change of values, and if so, reschedules the smartapp when values at the temp sensor are refreshed. By using some temp sensor(s) that regularly poll(s), this "heartbeat" is used to make sure that the smartapp is rescheduled when needed.

(ii)- The smartapp can subscribe to some motion sensor(s) for any change of values, and if so, reschedules the smartapp when values at the motion sensor are refreshed. By using some motion sensor(s) that regularly poll(s), this "heartbeat" is used to make sure that the smartapp is rescheduled when needed.

(iii)- The smartapp can subscribe to energy meter device for any change of values, and if so, reschedules the smartapp when energy values are refreshed. By using some energy meter(s) that regularly poll(s), this "heartbeat" is used to make sure that the smartapp is rescheduled when needed.

(iV)- You'd can also used a (virtual or physical) switch in the smartapp and use a Rule Engine (WebCoRE/CoRE, SmartRules) to trigger the virtual/physical switch based on a timer.


To activate the new subscriptions, you need to go through the smartapp's setup, press "Next" till the last Page (Other Options) and enter the new subscriptions indicated below:


   section("Watchdogs") {
       "What do I use as temperature sensor to restart smartapp processing?",type:"capability.temperatureMeasurement"
       "What do I use as a motion sensor to restart smartapp processing?",type:"capability.motionSensor"
       "What do I use as energy sensor to restart smartapp processing?",type:"capability.powerMeter"
       "What do I use as Master on/off switch to restart smartapp processing?",type:"capability.switch"
   }

In order to verify that the smartapp has been re-scheduled properly, follow the steps described below:

i) Go to https://graph.api.smartthings.com/location/list

ii) Click on list Smartapps

iii) Click on the smartapp to be checked

iv) Verify that the takeAction job is scheduled in the future (check the timestamp associated to the Next Run Time) under "Scheduled Jobs"

If it's not the case, you may want to re-execute the smartapp by pressing the arrow next to its name under My Home/Smartapps.

Issue #14: I want detailed Logging/Notifications

......................................................................................................................................

In order to have detailed Logging/Notifications, you'd need to do the following:

  • a) Notifications & Other Settings Setup> On the last setup page, set the following flag to true
   input "detailedNotif", "bool", title: "Detailed Logging & Notifications?", required:false
  • b) Set the filtering level (ERROR, WARNING, DEBUG, TRACE): the TRACE level is the more detailed tracing you can get.
   input "logFilter", "enum", title: "log filtering [Level 1=ERROR only,2=<Level 1+WARNING>,3=<2+INFO>,4=<3+DEBUG>,5=<4+TRACE>]?",required:false, metadata: [values: [1,2,3,4,5]]


  • c) To receive push notifications, answer 'Yes' to the following input parameter
   input "sendPushMessage", "enum", title: "Send a push notification?", metadata: [values: ["Yes", "No"]],


.................................................................................................................................

Issue #15 - My new Ask Alexa's Message Queues are not showing up in the smartapp

.................................................................................................................................


You'd need to execute the ecobeeRemoteSensorInit smartapp under Automation/Smartapps in the ST mobile app by doing "Next" till "Done" to subscribe to the new AskAlexaMQHandler. The new handler will then be able to process any Queue refresh value from Ask Alexa.


You can then go to the AskAlexa smartapp, and make any queue changes... The updated queue values will be then sent to the smartapp.