Skip to content

Latest commit

 

History

History
138 lines (97 loc) · 5.93 KB

README.md

File metadata and controls

138 lines (97 loc) · 5.93 KB

DTE Calculator

Overview

DTE Calculator is a Python-based utility to compare electric service plans based on past consumption data.

I was recently trying to compare two electric service plans from DTE Energy - the Residential Electric Service plan vs. the Time of Day plan. The RES is a flat-rate plan, while the ToD has specific rates based on the season and time of day - the more expensive peak rate applies for 11am-7pm on a weekday. However, other than publishing the rates (link), DTE does not provide a utility for determining whether or not switching to the ToD plan would actually save me money, in addition to requiring a 12-month commitment to stay on the plan.

I decided to do my own analysis instead. DTE does provide a function on its website to generate an Energy Usage Report, which contains energy usage data for the previous 13 months on a hourly basis. By processing the data from my hourly usage, I then calculated my energy costs for the RES and ToD plans. As it turns out, I will end up paying a little bit more on the ToD plan, without making changes to my current behavior.

DTE Calculator

Getting Started

Installing Anaconda Python (Recommended)

All perquisites are installed as a part of Anaconda Python.

Supported Configurations:

OS Python version
MacOS 3.7
Ubuntu 3.7
Windows 3.7

(Optional) Create a virtual environment

I strongly recommend using a virtual environment to ensure dependencies are installed safely. This is an optional setup, but if you have trouble running the scripts, try this first.

The instructions below assume you are using Conda, though Virtualenv is essentially interchangeable. To create a new Python 3.7 environment, run:

conda create --name dte python=3.7
conda activate dte

The shell should now look like (dte) $. To deactivate the environment, run:

(dte)$ conda deactivate

The prompt will return back to $ or (base)$.

Note: Older versions of conda may use source activate dte and source deactivate (activate dte and deactivate on Windows).

Installing dependencies

All of the required packages should have been installed via Anaconda. If you are using another distribution of Python, then you might need to run

(dte)$ pip install -r requirements.txt

To install the required packages.

Cloning the repo

To checkout the repo:

git clone git@github.com:jiuguangw/dte_calculator.git

Running the script

The hourly energy usage data can be downloaded from the DTE website, by going to newlook.dteenergy.com and "Energy Usage Data" on the left navigation menu. Pick a start date as far back as possible (the limit is 13 months) and use "CSV" as the file type.

I renamed the resulting file to "dte.csv" and placed it under "data". I can then generate the plot by

(dte)$ python dte_calculator.py data/dte.csv

DTE.pdf is generated with the plots.

Development

The unit tests can be run by first installing the package, then running pytest:

(dte)$ python install .
(dte)$ pytest

License

License terms

The Python scripts and the data in CSV are released under the MIT license. The full license details can be found in LICENSE.

Technical contributions

I welcome bug fixes, feature additions, and other ways to improve the project. If you'd like to contribute your data, I'm happy to host it here, assuming it is in the same format and anonymized (DTE account number removed).

Please send me pull requests, issues, etc, and contact me if you'd like to be added as a collaborator to the repo.

For others without the time or skills to contribute, I'd also appreciate your help in spreading the word via Facebook, Twitter, etc.

Donation

Please support the project by making a donation via PayPal or crypto:

paypal

Bitcoin Ethereum Bitcoin Cash Litecoin

Contact

Please drop me a line!