Reference API App

The Reference API App provides a demonstration of the usage of the ecobee API in the most common end user scenarios. It is intended to provide a working example of how common use cases can be supported, and thus provide a reference for developers on the sequence of API calls to make to enable these use cases. Additionally, developers can understand the details of the API message exchange by examining the API HTTP requests that the App makes as well as the responses it receives.

Features

  • PIN Registration flow
  • A demonstration of how an App is granted authorization to a end user's ecobee account using the PIN registration.

  • List thermostats
  • A demonstration of how an App can discover the thermostats associated with a user's ecobee account.

  • Show thermostat
  • A demonstration of how an App retrieve the current thermostat details.

  • Adjust Thermostats
  • A demonstration of how an App can adjust the set point of a user's thermostat.

Install Instructions

The Reference API app is written in Node.js and requires it to run. To set up your environment to run the application follow these steps.

1. Download Node

Go to http://nodejs.org/ and click on the install button. This will autodetect which platform you are on and give you the correct download. Unzip and run the installer.

2. Download the reference application

You can download the reference application from our site. Unzip the application to a directory of your liking.

3. Install dependencies for the application

In the command line / terminal, go to the location you unzipped the reference application and run:

npm install
4. Get application's API Key

To obtain an API Key required for authentication, go to the 'Developer' panel on the ecobee portal, create an application and copy it's API Key.

5. Update your config.js file

Add the API Key copied from Step 4 to the config.js file. This file is located in the root of the example application directory you unzipped earlier. Add the API Key as the value for field titled 'exports.appKey'.;

6. Run the reference application

From the command line, run

node app.js

This will run the application which will be accessible in your web browser at:

http://localhost:3000

The application will first prompt you for an API Key which will start the authorization process. Once the access_token is obtained, you will see a list of your thermostats. Clicking on any of these thermostats will bring up a final screen allowing you to carry out simple interactions with that thermostat. This process is illustrated in the images below.

7. Modify existing JavaScript code

The 'ecobee-api.js' contains all API calls used in this app. Feel free to modify this file and add any other functions to gain a further understanding of our API.

Back To Top