Skip to content

Brandawg93/PeaNUT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PeaNUT

PeaNUT

A Tiny Dashboard for Network UPS Tools

PayPal Docker Pulls Crowdin

Installation

Install using Docker

docker run

docker run -v ${PWD}/config:/config -p 8080:8080 --restart unless-stopped \
--env WEB_PORT=8080 brandawg93/peanut

docker-compose.yml

services:
  peanut:
    image: brandawg93/peanut:latest
    container_name: PeaNUT
    restart: unless-stopped
    volumes:
      - /path/to/config:/config
    ports:
      - 8080:8080
    environment:
      - WEB_PORT=8080

compile from source

git clone https://github.com/Brandawg93/PeaNUT.git
cd PeaNUT
npm i -g pnpm # only if you don't have pnpm installed
pnpm i
pnpm run build:local
pnpm run start:local

More examples can be found in the examples folder.

Environment Variables

Variable Default Description
WEB_HOST localhost Hostname of web server
WEB_PORT 8080 Port of web server
BASE_PATH undefined Base path for reverse proxy

Configuration

Configuration is primarily done via the UI, but manual configuration can be done via the /config/settings.yml file within the container. More information can be found on the wiki.

API

API Call Description
GET /api/v1/devices Retrieves information about all UPS devices
GET /api/v1/devices/[ups] Retrieves information about the specified UPS device
GET /api/v1/devices/[ups]/var/[param] Retrieves value for a single parameter of the specified UPS device
POST /api/v1/devices/[ups]/var/[param] Saves value for a single parameter of the specified UPS device
GET /api/v1/devices/[ups]/var/[param]/description Retrieves description for a single parameter of the specified UPS device
GET /api/v1/devices/[ups]/var/[param]/type Retrieves type for a single parameter of the specified UPS device
GET /api/v1/devices/[ups]/commands Retrieves available commands for the specified UPS device
GET /api/v1/devices/[ups]/description Retrieves the description for the specified UPS device
GET /api/v1/devices/[ups]/clients Retrieves the connected clients for the specified UPS device
GET /api/v1/devices/[ups]/rwvars Retrieves writable variables for the specified UPS device

Homepage Support

For information about how to set up Homepage, check the Homepage docs.

Ex:

widget:
  type: peanut
  url: http://peanut.host.or.ip:port
  key: nameofyourups

Or use the customapi widget for complete customization!

Ex:

widget:
  type: customapi
  url: http://{HOSTNAME}:{PORT}/api/v1/devices/ups
  mappings:
    - field: battery.charge
      label: Battery Charge
      format: percent
    - field: battery.runtime
      label: Battery Runtime
      format: text
    - field: ups.load
      label: UPS Load
      format: percent
    - field: ups.status
      label: UPS Status
      format: text
      remap:
        - value: OL
          to: Online
        - value: OB
          to: On Battery
        - value: LB
          to: Low Battery
        - any: true
          to: Unknown

Tested Devices

A wiki has been compiled of tested UPS devices. Feel free to look there for your device or add your device to the list by submitting an issue with the tested device label.

Donate to Support PeaNUT

This project was made with you in mind. If you would like to show your appreciation for its continued development, please consider sponsoring me on Github.

Star History

Star History Chart