https://github.com/thisislawatts/greenchoice-usage
Get the usage for your property yesterday
https://github.com/thisislawatts/greenchoice-usage
Last synced: about 2 months ago
JSON representation
Get the usage for your property yesterday
- Host: GitHub
- URL: https://github.com/thisislawatts/greenchoice-usage
- Owner: thisislawatts
- Created: 2024-07-12T16:47:43.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-22T17:40:47.000Z (almost 2 years ago)
- Last Synced: 2025-01-26T08:12:49.312Z (over 1 year ago)
- Language: JavaScript
- Size: 78.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GreenChoice Usage
## Overview
>
This script automates the process of logging into the GreenChoice website, extracting consumption data for electricity and gas, and comparing costs against yesterdays data.
## Prerequisites
- Node.js v22
- A GreenChoice account with valid login credentials
- Environment variables set for the user email, password
## Installation
```sh
npm install
```
## Configuration
The script requires the following environment variables to be set:
- `GC_USER_EMAIL`: Your GreenChoice user email.
- `GC_USER_PASSWORD`: Your GreenChoice password.
- `GC_TARGET_DATE`: (Optional) The target date for which you want to fetch the consumption data in `yyyy-MM-dd` format. If not provided, the script defaults to yesterday's date.
You can set these variables in a `.env` file at the root of your project:
```
GC_USER_EMAIL=your_email@example.com
GC_USER_PASSWORD=your_password
GC_TARGET_DATE=2024-07-11
```
## Usage
To run the script, use the following command:
```sh
npm start
```
## Logging
The script uses the `debug` module for logging. To enable logging, set the `DEBUG` environment variable:
```sh
DEBUG=greenchoice.usage npm start
```