whatisgithub

What is pug?

skull-candy/pug — explained in plain English

Analysis updated 2026-05-18

1PythonAudience · ops devopsComplexity · 3/5Setup · moderate

In one sentence

A Raspberry Pi tool that reads UPS status and re-serves it as SNMP, REST, MQTT, Prometheus, and a web dashboard so devices like QNAP can monitor your battery backup.

Mindmap

mindmap
  root((pug))
    What it does
      Reads UPS status
      Shares one state
      Serves multiple protocols
    Tech stack
      Python
      SNMP
      MQTT
    Use cases
      QNAP UPS monitoring
      Home Assistant integration
      Power flow dashboard
    Audience
      Homelab admins
      NAS owners
    Setup
      Raspberry Pi
      apcupsd or NUT
      Systemd service

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Let a QNAP NAS monitor a UPS connected to a Raspberry Pi over SNMP.

USE CASE 2

Feed live UPS battery and power status into Home Assistant or Prometheus dashboards.

USE CASE 3

Get MQTT notifications and a web dashboard for UPS status and power flow.

What is it built with?

PythonSNMPMQTTRaspberry Pi

How does it compare?

skull-candy/pug0xustaz/streamgatea-bissell/unleash-lite
Stars111
LanguagePythonPythonPython
Setup difficultymoderatehardhard
Complexity3/54/54/5
Audienceops devopsdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Needs a UPS connected via apcupsd or NUT, and root or capability grants to bind the privileged SNMP port.

So what is it?

PowerPi UPS Gateway, called PUG, turns a Raspberry Pi or other Linux machine into a bridge between an uninterruptible power supply and devices that expect a specific network protocol to check its status. Many UPS units are easy for a Raspberry Pi to read directly, but appliances like QNAP network storage boxes only understand SNMP messages formatted the way old APC Smart-UPS units send them. PUG solves this gap: a single collector process reads the real UPS status, either through apcupsd, through NUT (Network UPS Tools), or through a built in simulator for testing, then stores that status in one shared object in memory. Every other part of the program reads from that same shared state instead of talking to the UPS again, so the UPS itself is only asked once no matter how many other systems want to know its status. From that shared state, PUG offers the status through several different doors at once: it pretends to be an APC Smart-UPS over SNMP so devices like QNAP accept it, and it also serves the same data as REST JSON, as Prometheus metrics for monitoring dashboards, as Home Assistant discovery messages for smart home setups, over MQTT for automation tools, and through a built in web dashboard. The web dashboard is the main way a person interacts with PUG day to day. It shows a live diagram of how power is flowing, from the wall, from the battery, or in bypass mode, lets an administrator start or cancel battery self tests and calibration runs, tail recent logs, edit settings, and check for and install updates, all without needing to reload the page. Setup involves installing apcupsd or NUT on the same Raspberry Pi or Linux box, cloning the repository, installing it as a Python package, and optionally registering it as a system service so it starts automatically and restarts on changes. Running the SNMP server on the standard port needs elevated privileges on Linux, though a higher port can be used for local testing without that requirement.

Copy-paste prompts

Prompt 1
Help me install PowerPi UPS Gateway on a Raspberry Pi and connect it to apcupsd.
Prompt 2
Show me how to configure PowerPi UPS Gateway so my QNAP NAS can read my UPS over SNMP.
Prompt 3
Explain how to set up Home Assistant discovery for this UPS gateway.
Prompt 4
Walk me through installing PowerPi UPS Gateway as a systemd service.

Frequently asked questions

What is pug?

A Raspberry Pi tool that reads UPS status and re-serves it as SNMP, REST, MQTT, Prometheus, and a web dashboard so devices like QNAP can monitor your battery backup.

What language is pug written in?

Mainly Python. The stack also includes Python, SNMP, MQTT.

How hard is pug to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is pug for?

Mainly ops devops.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.