GithubHelp home page GithubHelp logo

homeassistantecobeebridge's Introduction

Home Assistant Ecobee Bridge

NOTES:

  • This project is still in development, its a good proof of concept that can be used. This project is open source, you can improve it by creating Pull Request.
  • The base of the project is from https://github.com/OutsourcedGuru/ecobee-app

Description

This is a simple nodejs server used to control an Ecobee thermostat from Home assistant.

Home Assistant enables you to control some basic feature of an Ecobee thermostat, but can't set for example the Ecobee mode to AUX.

This proxy servers receive REST/HTTP request from HA and sends them to the Ecobee API. Using this proxy server any functionnality of the Ecobee API can be accessed from HA.

ecobeeConfig.json

This nodejs server will keep in a local file (ecobeeConfig.json) all the required information to access the Ecobee API. In the following setup, some private data will be written on this JSON file. Be certain to not make that file public since it contains authorization information to access your Ecobee thermostat.

This JSON file contains all the server's required information to access the Ecobee API, so the setup will needs to be done only once.

Set up

  • npm install

  • npm start

  • Open a web page to that server (ex: http://localhost:3000/)

    • The first time you will need to setup the Ecobee application:

      • Copy the displayed PIN code (ex: RRWV-KJKD)
      • Go to the Ecobee website and signin on your account.

        • From the menu select "My Apps"
        • Select "Add Application" button
        • Enter the PIN code (ex: RRWV-KJKD)
        • A confirmation page will be displayed, select "Confirm".
        • A Congratulation page will be displayed
      • Returns on your nodejs server webpage

        • Press the "Complete Link" button.
        • Your list of Ecobee thermostat should now be visible:

You are now ready to sends HTTP request from Home Assistant!

Changing the MODE and the hold temperature

Before using HA, you can test this using a tool such as Postman

  • Create a request of type: POST http://[YOUR_SERVER_ADDRESS]/thermostats/[THERMOSTAT_ID]/sethold?hvacmode=heat&holdtemp=21
    • YOUR_SERVER_ADDRESS: Its your nodejs server IP (ex: http://localhost:3000)
    • THERMOSTAT_ID: Its your thermostat Id. You can retrieves your list of thermostats and their ids at http://localhost:3000/thermostats
    • hvacmode: heat or auxHeatOnly
    • holdtemp: Optional parameter specifying the hold temperature in celcius.

Setup Home assistant

Setup REST commands

Add this section in your HA configuration.yaml file to setup all REST commands

rest_command:
  # Set the mode only
  ecobee_set_hvac:
    url: "http://[YOUR_SERVER_ADDRESS]/thermostats/[THERMOSTAT_ID]/sethold"
    method: post
    content_type: 'application/x-www-form-urlencoded'
    payload: "hvacmode={{ hvacMode }}"

  # Set the mode and the hold temperature
  ecobee_set_hvac_and_temp:
    url: "http://[YOUR_SERVER_ADDRESS]/thermostats/[THERMOSTAT_ID]/sethold"
    method: post
    content_type: 'application/x-www-form-urlencoded'
    payload: "hvacmode={{hvacMode}}&holdtemp={{temperature}}"

Restart Home assistant to apply the configuration change.

Use REST commands

In automations.yaml

In your automations file automations.yaml you can add a service like these:

  # Set HVAC mode to HEAT
  - service: rest_command.ecobee_set_hvac_and_temp
    data:
      hvacMode: "heat"

  # Set HVAC mode to AUX at 22
  - service: rest_command.ecobee_set_hvac_and_temp
    data:
      hvacMode: "auxHeatOnly"
      temperature: 22

Using the Editor

homeassistantecobeebridge's People

Contributors

lucdion avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.