Git Product home page Git Product logo

peco-assistant's Introduction

I have archived this repository as I am no longer a Peco Customer and can no longer test to see if things work. At last run around 9/15/2021, everything was working well. No further updates to this code will happen though.

Peco Assistant

If you are a Peco customer, this app will collect the following stats:

  • Energy usage data by hour (rounded (by Peco))
  • Cost of energy by hour (est.)
  • Temperature by hour (est.)

And then stores that data within a database. Currently only InfluxDB is supported. It is best run within a Docker container.

Peco is an energy provider in Southeast Pennsylvania. Peco is part of Exelon Energy and ooking at their other energy company sites, they look like cut and past copies with different branding. This may very well work in other Northeast US Energy companies sites as is or with slight modifications. I can only confirm this works with Peco though.

The script will begin collecting data from either 2 years ago, or the most recent date with data from the configured database.

Notes

  • Peco's site usually runs around a 1-2 days behind realtime.
  • Not all Peco users may be able to use this based on differences in the meters.
  • Data seems to update about 1x per day. It is not advised to go below 24 hours for the time_interval.
  • This app uses selenium to log in to Peco's UI then hits API endpoints to collect the data. \
  • There is debug logging available. Just set log_level to debug

Configuring and Running Peco Assistant

Used ENVs for variables as it's what I use in my docker server.

Use 'docker compose'

Clone the repo to your machine. Within the repo, I've included a docker-compose.yml. Edit this to match your information.

Once updated, open your favorite CLI and run docker compose up. The container should start up and start collecting data.

Use 'docker run'

This builds automatically on Dockerhub so running the container with the needed variables should would. I've only tested in my environment.

docker run -e "PECO_USER=replace_me_with_peco_user_email" \
-e "PECO_PASS=replace_me_with_peco_pass" \
-e "START_DATE=2020-01-01" \
-e "DB_TYPE=influxdb" \
-e "DB_HOST=192.168.1.1" \
-e "DB_PORT=8086" \
-e "DB_USER=replace_me_with_db_user" \
-e "DB_PASS=replace_me_with_db_user_pass" \
-e "DB_DBNAME=peco" \
-e "SLEEP_INTERVAL=24" \
-e "LOG_TYPE=info" \
breadlysm/peco-usage-collector

Run as python script

I have a file named ".env" in the root of the directory that looks like for testing. It should work all the same as automated runs.

Once you've created that file, run the script using `python peco-usage-collector/peco-usage-collector/peco-usage-collector.py

# User Variables
PECO_USER = {peco username}
PECO_PASS = {peco password}

# Dates
DB_TYPE = influxdb
DB_HOST = 192.168.1.1 
DB_PORT = 8086
DB_USER = {influx user} 
DB_PASS = {influx password}
DB_DBNAME = peco

#intervals in hours. How often should it collect data. Peco updates 1x per day, lower than 24 hours is not advised. 
SLEEP_INTERVAL = 24 
LOG_TYPE = info

Disclaimer

Use at your own discretion. This app is not in any way associated or authroized by Peco or Exelon. It was created to automatically access the usage data in your account. Their terms do limit access by robots,spiders etc. from automatic collection of information however this is data I could easily grab by myself everyday and it is not doing anything abusive. It accesses 3 pages and then hits a JSON API once per day. Nevertheless, this is against their terms and I am not responsible for any problematic outcomes you may experience by using this. See their terms here https://www.exeloncorp.com/terms-and-conditions

peco-assistant's People

Contributors

breadlysm avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.