Dump Ecobee thermostat history to a CSV file. Useful for deep diving into thermostat data and monitoring HVAC usage over time using tools like Domo.
- Make sure Python 3 and the Python
requests
library is installed- macOS:
brew install python3
thenpip3 install requests
- macOS:
- Clone the repository
- Run
python3 setup.py
from the cloned directory - Run
python3 ecobee-csv.py --all-time
to download all data
Running python3 ecobee-csv.py --all-time
will download all thermostat history and dump it into a CSV. Best to use when initially creating your CSV.
Running python3 ecobee-csv.py
will update your CSV file with today's and yesterday's data while preserving all older data.
Data to fetch and update can be set at runtime by adding --days-ago-start X
and --days-ago-end Y
flags. For example, running python3 ecobee-csv.py --days-ago-start 30 --days-ago-end 7
would pull data from 30 days until 7 days ago and update it in the CSV. The update method used is similar to upsert, where a row of data is inserted if it doesn't exist or updated if it does.
After initial setup and download of all history, I scheduled the ecobee-csv.py
script to run hourly to update the CSV. The CSV dump lives in a cloud-synced folder which is then imported into Domo for data visualization.
After running the initial setup, open config.json
and change the value of "csv_location"
to the desired file path.
Add --verbose
to any script call and you will see more details about what is happening while the script is running.