Skip to content

About

NetBox plugin: utility power outages (PGE, ODIN) near your sites — dashboard, per-site map tab, REST API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

24 Commits

Folders and files

Repository files navigation

NetBox Power Outage

A NetBox plugin that shows utility power outages near your sites.

  • Dashboard — every site with active outages within a chosen radius (½, 1, 2 or 5 miles; default 1), with a map and a utility feed freshness table.
  • Site tab — a "Power Outage" tab on each site with a map (site pin, radius ring, outage dots sized by customers out) and a list of nearby outages.
  • Background collector — a NetBox system job pulls outages every few minutes and stores them; pages never call the outage sources directly.
  • Geocode Sites — a page listing sites without coordinates, and a geocode_sites command that fills in site latitude/longitude from the physical address (US Census geocoder, OpenStreetMap fallback).
  • Read-only REST API — outages, site matches and feeds.

Data sources

Source Coverage Notes
pge Portland General Electric Uses the public, undocumented GraphQL API behind portlandgeneral.com's outage map. Read-only queries only, polled every 15 minutes by default. It may change without notice.
odin Utilities reporting to ODIN (DOE / ORNL) Public /odi endpoints, no account needed. Some utilities report exact points, others county-level only.

Sources are tried in priority order (sources setting). When a higher-priority source covers a utility and its feed is fresh, lower-priority data for that utility is not used for matching. If that feed goes stale, the lower-priority data is used again.

Outage locations are approximate. County-level reports match every site in that county.

Scope

This plugin is Oregon-focused today: the PGE source and the ODIN states default to Oregon and Washington, and it was built for an Oregon network. The source adapters are pluggable (netbox_poweroutage/sources/), so other utilities or regions can be added by writing one adapter that returns the same outage records.

Requirements

  • NetBox 4.7.5 or later
  • A running NetBox worker (rqworker) for the scheduled collector

Installation

pip install netbox-poweroutage
# configuration.py / plugins.py
PLUGINS = ["netbox_poweroutage"]
PLUGINS_CONFIG = {"netbox_poweroutage": {}}

Then run manage.py migrate and restart NetBox.

Configuration

Setting Default Description
sources ["pge", "odin"] Enabled sources, in priority order
odin_states ["41", "53"] FIPS state codes to pull from ODIN (Oregon, Washington)
odin_base_url https://odin.ornl.gov ODIN base URL
odin_client_id / odin_client_secret "" Reserved for authenticated ODIN endpoints (unused in 0.1.0)
collect_interval_minutes 5 System job interval
pge_interval_minutes 15 Minimum minutes between PGE polls
pge_details True Fetch cause / crew status / estimated restore for PGE outages near a site (one extra call per outage, refreshed every 15 minutes)
pge_details_radius_miles 1 Only PGE outages within this distance of a site get detail lookups
default_radius_miles 1 Default radius on the dashboard and site tab
stale_after_minutes 60 A utility feed older than this is flagged stale
retention_days 90 Ended outages older than this are purged
timeout 30 HTTP timeout in seconds
tab_weight 9006 Site tab ordering weight
top_level_menu False Show a top-level menu instead of items under Plugins
carto_api_key "" CARTO Basemaps key; when set, maps use keyed Voyager (light) / Dark Matter (dark) tiles

Commands

python manage.py collect_outages [--force]
python manage.py geocode_sites [--apply] [--overwrite]

geocode_sites is a dry run unless --apply is given, and lists every address it could not match.

Support

If you find this plugin helpful, consider supporting development:

Buy Me A Coffee

License

Apache-2.0

About

NetBox plugin: utility power outages (PGE, ODIN) near your sites — dashboard, per-site map tab, REST API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages