Sign inSign up

billykwooten/ecobee-exporter

By billykwooten

•Updated over 5 years ago

Image
1

9.6K

billykwooten/ecobee-exporter repository overview

⁠ecobee_exporter

Docker Pulls Docker Automated Docker Build

Lots of references from: https://github.com/dichro/ecobee⁠

Check him out as well, initial idea from his repository.

⁠Summary

Ecobee exporter for metrics in Prometheus format

Setting up an ecobee exporter is complicated due to the need to authenticate with the Ecobee API service via tokens. The first time you run this program it requires some manual steps, however the exporter will subsequently manage its own authentication afterwards if you give the program a volume somewhere to store passwords and manage it's authorization cache.

⁠First time running ecobee exporters, read this

  1. Create a volume on your host so we can persist authentication cache

  2. Run docker run -v <volume from step 1>:/db -p 9098:9098 -it billykwooten/ecobee-exporter --appkey p3NbLx6iSYTjXDFHIMtM77SWWPLRuEZ0

  3. Open a browser and go to http://localhost:9098/metrics⁠ or curl -X GET http://localhost:9098/metrics from another terminal

  4. Docker will now print a pin like Pin is "ig7j"

  5. Go to https://www.ecobee.com/consumerportal/index.html#/my-apps⁠

  6. Register your app pin from step 4

  7. You can now run the container in any way you want, as long as you mount in the volume from step 1.

    Example: Binary/Docker Run Examples⁠

⁠Configuration

Ecobee exporter can be controlled by both ENV or CLI flags as described below.

EnvironmentCLI (--flag)DefaultDescription
ECOBEE_LISTEN_ADDRESSlisten-address:9098The port for /metrics to listen on
ECOBEE_APPKEYappkeyp3NbLx6iSYTjXDFHIMtM77SWWPLRuEZ0Your Application API Key or you can use my app key seen here
ECOBEE_CACHEFILEcachefile/db/auth.cacheCache file to store auth credentials

⁠Usage

Binary Usage

# Export ecobee metrics from thermostat
./ecobee-exporter

Docker Usage (recommended method of running)

# Export ecobee metrics from thermostat using docker with volume for cache
docker run -d --restart always --name=ecobee-exporter -v /example/persistancedirectory:/db -p 9098:9098 billykwooten/ecobee-exporter --appkey p3NbLx6iSYTjXDFHIMtM77SWWPLRuEZ0

Docker-compose Usage

  ecobee-exporter:
    image: billykwooten/ecobee-exporter
    container_name: ecobee-exporter
    restart: always
    ports:
      - "9098:9098"
    volumes:
      - /volume1/docker/ecobee-exporter/data:/db

Prometheus Scrape Usage

scrape_configs:
  - job_name: 'ecobee-exporter'
    scrape_interval: 60s
    static_configs:
      - targets: ['ecobee-exporter:9098']

⁠Development

If you'd like to build this yourself you can clone this repo and run:

./script/cibuild

Tag summary

Content type

Image

Digest

Size

6.7 MB

Last updated

over 5 years ago

docker pull billykwooten/ecobee-exporter