Pulls historical data from Ecobee and pushes to an Influx 1.x database.
This is heavily inspired by https://github.com/cdzombak/ecobee_influx_connector.
The major differences are:
- It pushes to InfluxDB 1.x database rather than InfluxDB 2.
- It pulls historical data rather than current (last 5 minute) data.
- It supports multiple thermostats.
- Enable the developer dashboard on your Ecobee account at https://www.ecobee.com/developers/ by logging in with your normal ecobee credentials.
- Go to https://www.ecobee.com/consumerportal/index.html, navigate to Developer in the right-hand menu, and create an App. Call it whatever you want. Use PIN authentication.
- Create a working directory on your machine for this tool to store your ecobee credentials in.
- Create a JSON config file based on the example containing the API key from the ecobee app and the path to your working directory.
- Run
ecobee_influx_connector -list-thermostats
at an interactive terminal; it'll provide a PIN. - Go to https://www.ecobee.com/consumerportal/index.html, navigate to My Apps in the right-hand menu, and click Add Application.
- Paste the PIN there and authorize the app.
- Return to the
ecobee_influx_connector
CLI and hit Enter.
You should then be presented with a list of thermostats in your Ecobee account, along with their IDs.
Configuration is specified in a JSON file. Create a file (based on the template
config.example.json
stored in this repository) and customize it with your
Ecobee API key, thermostat ID, and Influx server. Note, you may use a comma
separated list of thermostats (no spaces).
Use the write_*
config fields to tell the connector which pieces of equipment
you use.
The work_dir
is where client credentials and (yet to be implemented)
last-written watermarks are stored.
go build -o ./ecobee_influx_connector .
To cross-compile for eg. Linux/amd64:
env GOOS=linux GOARCH=amd64 go build -o ./ecobee_influx_connector .
- Build the
ecobee_influx_connector
binary per the Build instructions above. - Copy it to
/usr/local/bin
or your preferred location. - Create a work directory for the connector. (I put this at
$HOME/.ecobee_influx_connector
.) - Run
chmod 700 $YOUR_NEW_WORK_DIR
. (For my work directory, I ranchmod 700 $HOME/.ecobee_influx_connector
.) - Create a configuration JSON file, per the Configure instructions above. (I put this at
$HOME/.ecobee_influx_connector/config.json
.) - Customize
ecobee-influx-connector.service
with your user/group name and the path to your config file. - Copy that customized
ecobee-influx-connector.service
to/etc/systemd/system
. - Run
chown root:root /etc/systemd/system/ecobee-influx-connector.service
. - Run
systemctl daemon-reload && systemctl enable ecobee-influx-connector.service && systemctl start ecobee-influx-connector.service
. - Check the service's status with
systemctl status ecobee-influx-connector.service
.
Apache 2; see LICENSE
in this repository.
- Brad Campbell.
- Chris Dzombak (GitHub @cdzombak).