Skip to content

A simple Node.js application that fetches and displays real-time power usage data from the n2g-ynni.net API.

Notifications You must be signed in to change notification settings

nilicule/power-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Power Monitor

A simple Node.js application that fetches and displays real-time power usage data from the n2g-ynni.net API.

Description

Power Monitor connects to the n2g-ynni.net API to retrieve instantaneous electricity consumption data. It displays:

  • Current power usage in watts
  • Daily minimum power usage
  • Daily maximum power usage
  • Timestamp of the measurement

Installation

  1. Clone this repository:

    git clone https://github.com/yourusername/power-monitor.git
    cd power-monitor
    
  2. Install dependencies:

    npm install
    
  3. Create a .env file in the root directory with your API key:

    API_KEY=your_api_key_here
    

Usage

Run the application with:

node power-monitor.js

The application will display your current power usage information in the console.

Dependencies

  • dotenv - For loading environment variables
  • node-fetch - For making HTTP requests (required for Node.js < 18)

Requirements

  • Node.js (version 12 or higher recommended)
  • An API key from n2g-ynni.net

About

A simple Node.js application that fetches and displays real-time power usage data from the n2g-ynni.net API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published