- Register and enable the developer dashboard on your Ecobee account at https://www.ecobee.com/developers/
- Go to https://www.ecobee.com/consumerportal/index.html , navigate to Developer in the right-hand menu, and create an App.
- Create a JSON config file containing that API key and a 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.
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.
A Docker image is also provided that can be configured via environment variables. View it on Docker Hub, or pull it via docker pull cdzombak/ecobee_influx_connector
.
To use the docker container make sure the path to the config.json
is provided as a volume with the path /config
. This location will also be used to store the refresh token.
Example usage: docker run -v $HOME/.ecobee_influx_connector:/config -it ecobee_influx_connector
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
.
The connector does not directly support multiple thermostats. To support this use case, I'd recommend running multiple copies of the connector. Each copy will need its own working directory and config file, but you should be able to use the same API key for each connector instance.
(If deploying using the "systemd on Linux" instructions, give each connector's service file a unique name, like ecobee-influx-connector-1.service
, ecobee-influx-connector-2.service
, and so on.
Apache 2; see LICENSE
in this repository.
Chris Dzombak (GitHub @cdzombak).