No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
app.json
package.json
server.js

README.md

DreamHouse Thermostat

This sample app allows you to control an Ecobee3 Smart Thermostat from the DreamHouse app. Check out a demo:

Demo

To get started you will need an Ecobee3 Smart Thermostat and either hook it to an actual HVAC or mock HVAC system. Setup the thermostat and connect it to the internet and your Ecobee account.

Run Locally:

  1. Install ngrok
  2. Start ngrok: ngrok http 5000
  3. Create a new Developer App in the Ecobee Developer Dashboard setting the Authorization Method to Authorization Code and the Redirect Domain to your ngrok domain. Take note of your API key.
  4. Start the app: ECOBEE_APP_KEY=<YOUR ECOBEE APP KEY> npm run dev
  5. To turn on the heater (or mock heater) open: http://<YOUR NGROK ID>.ngrok.io/on
  6. After authorizing the app your thermostat's target temperture will be raised by 10 degrees, turning the heater on.
  7. To turn off the heater open: http://<YOUR NGROK ID>.ngrok.io/off

Run on Heroku:

  1. Create a new Developer App in the Ecobee Developer Dashboard setting the Authorization Method to Authorization Code and the Redirect Domain to a temporary domain name. Take note of your API key.
  2. Deploy the app: Deploy on Heroku
  3. Update the Redirect Domain for the newly created Ecobee Developer App to the domain of your Heroku app (e.g. foo-bar-123.herokuapp.com)
  4. Turn the heater on: http://<YOUR HEROKU APP NAME>.herokuapp.com/on

App Architecture

This application uses Ecobee's OAuth API to get an access token used with the Ecobee REST APIs. For the purposes of this demo the access token (and a refresh token) are cached in memory. For a production app you should use more secure and mutli-user methods of handling authentication. With an access token the current temperature is read and then the temperature is increased or decreased by 10 degrees (depending on whether the /on or /off endpoint was accessed). This is done by making REST API calls to the Ecobee API. The app is built with Node.js and Express. You can find the full source in the server.js file.