Skip to content

JeevanandanRamasamy/WattWindow

Repository files navigation

WattWindow — U.S. Grid Forecast & EV Charging Recommendations

WattWindow is an interactive web dashboard that visualizes Balancing Authority (BAA) regions across the United States and provides clean energy EV charging recommendations.

WattWindow

It displays regional grid boundaries, real-time and forecasted emissions, renewable energy share, and the best charging windows for the next 24 hours. The frontend is built using React + TypeScript + Vite, and backed by a Python forecasting pipeline using Prophet models trained on six years of historical energy-generation and weather data.

The map interface includes:

  • Selectable BAA regions (e.g., CAL, SOCO, NW, etc.)
  • Color-coded emissions intensity layers
  • Hover tooltips with energy mix, forecasts, and suggested charging times
  • Integration with an API backend serving region stats and forecasts

Usage (Hosted Version, No Setup Required)

If you simply want to use Watt Window without installing anything locally:

  1. Visit the hosted version at: https://wattwindow.vercel.app/
  2. Explore the interactive BAA map, hover over regions, and view EV charging recommendations.
  3. All backend data is already live. You can directly hit the API, for example: https://watt-window.vercel.app/api (automatically used by the frontend).
    • Replace SE with any region code used in the forecasting pipeline

Backend Overview (Power Forecasting Pipeline)

The backend consists of a fully automated forecasting system that:

  • Pulls hourly generation and weather data
  • Runs 91 trained Prophet models (13 BAAs × 7 resources each)
  • Generates 24-hour forecasts for each resource in each region
  • Saves results to Upstash Redis
  • Exposes forecasts through a Flask API hosted on Vercel

power_forecasting_main.py

  • Downloads 24-hour demand forecasts from the U.S. Energy Information Administration (EIA)
  • Retrieves weather and lagged weather data from OpenMeteo
  • Cleans and validates incoming data (removing negatives, NaNs, invalid values)
  • Loads the correct trained models for the region being processed
  • Runs 24-hour forecasts for each energy resource
  • Saves results to temporary .json files before they are pushed to Redis

api/index.py

  • Flask API endpoint used by the frontend
  • Stores JSON outputs in Upstash Redis
  • Serves /api/forecast?region_code=XX for any supported region

models/

  • Contains all Prophet forecasting models grouped by resource and region
  • Some regions do not generate certain resources; the main pipeline handles this automatically

models_training/

  • Jupyter notebooks used for training Prophet models (example included for the Southeast region)
  • Each notebook pulls historical generation + weather data, cleans it, and trains the resource-specific model

cron.yml

  • GitHub Action that runs power_forecasting_main.py daily
  • Automatically refreshes Redis with the latest 24-hour forecasts

data-pull+preprocessing.ipynb

  • This notebook was used to automate the data pull process for each region.
  • The code pulled energy generation data from the EIA (Energy Information Administration) API and weather data from the OpenMeteo API, cleaned and merged the data into one large dataset which was used to train the Prophet models.
  • This was only run once in the beginning for each region to pull all the data required to train our models.

Installation (Optional, Only needed if running locally)

  1. Clone the repository:
git clone https://github.com/JeevanandanRamasamy/EV-Charging-Dashboard.git
cd EV-Charging-Dashboard
  1. Install frontend dependencies: The React application lives inside the frontend/ directory.
cd frontend
npm install
  1. If you want to run forecasting locally: Navigate to the backend/ directory and install python dependencies.
pip install -r requirements.txt

Create a .env file in the root directory:

EIA_API_KEY=your_eia_key
UPSTASH_REDIS_REST_URL=your_redis_url
UPSTASH_REDIS_REST_TOKEN=your_redis_token

You won’t have our Redis credentials, so you can instead rely on the live deployed backend: https://watt-window.vercel.app/api/forecast?region_code=SE

Execution

Run the Frontend (Local Development)

From the frontend/ directory:

npm run dev

This starts the React development server. Open http://localhost:5173 in your browser to view the dashboard. The frontend will automatically proxy API calls from:

/api/*
→ https://watt-window.vercel.app/api/*

(based on your vite.config.ts proxy configuration).

Run the Backend (Local)

If you have your own keys and want to generate forecasts locally:

python power_forecasting_main.py

This will produce files like:

power_forecasting_results_SE.json
power_forecasting_results_TEX.json

If you want to serve the API locally using Flask (However, APIs are currently set up to use Upstash database, and so will not run locally without the appropriate credentials):

python api/index.py

Build for Production

Inside frontend/:

npm run build

This creates a production bundle inside frontend/dist/, which can be deployed to Vercel or any static hosting provider. vercel.json is already included for automatic configuration.

Running Demo

Whether running locally or at the hosted URL:

  1. Hover over different BAA regions on the map to see real-time emissions and energy mix.
  2. Tooltip shows current emissions / renewables, hourly forecast, and recommended charging windows.
  3. Use the TimeFilter to adjust the forecast window.
  4. Watch the map recolor dynamically based on intensity levels.

About

WattWindow: A Window into the Best EV Charging Opportunities

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages