HomeHub 4000 Prometheus Exporter

Prometheus exporter for the Virgin Plus Vincent / Bell HomeHub 4000 router. Uses Playwright to scrape the admin UI and expose metrics for Prometheus. Device events are stored in SQLite so other tools can query them independently of Prometheus.

Grafana dashboard (included)

Grafana Dashboard

Architecture diagram
flowchart LR
    subgraph exporter.py
        direction TB
        prom[Prometheus Server]
        scraper[router_scraper.py]
        poller[router_log_fetcher.py]
    end

    subgraph Router["HomeHub 4000"]
        mon["/monitoring"]
        stats["/statistics"]
        logs["/logs"]
    end

    scraper --> mon
    scraper --> stats
    poller --> logs
    poller --> db[(SQLite)]

Quick Start

# Install
uv sync
uv run playwright install chromium

# Run
ROUTER_PASSWORD="your_password" uv run python src/exporter.py

# Check
curl http://localhost:9100/metrics | grep homehub_

Docker

cd deploy
echo "ROUTER_PASSWORD=your_password" > .env
docker-compose up -d

Services:

Default Grafana credentials are admin/admin. Override with GRAFANA_ADMIN_USER and GRAFANA_ADMIN_PASSWORD in .env.

Configuration

Variable Default Description
ROUTER_PASSWORD (required) Router admin password
ROUTER_IP 192.168.2.1 Router IP address
EXPORTER_PORT 9100 Metrics port
SCRAPE_INTERVAL 60 Seconds between scrapes
LOG_POLL_INTERVAL 75 Seconds between log polls
HEADLESS_BROWSER true Run browser headless

Metrics

All metrics prefixed with homehub_. Covers system health (CPU, memory, load), network interfaces (status, throughput, errors), connected devices, router uptime, and log statistics. See the Grafana dashboard screenshot above or query curl localhost:9100/metrics | grep homehub_ for the full list.

Development

uv sync        # includes dev dependencies
uv run pytest
uv run ruff check src/

Troubleshooting

  • Set HEADLESS_BROWSER=false to watch the browser and debug scraping issues
  • Delete virgin_monitor.db to reset device history

Tested on Virgin Plus Vincent (Bell HomeHub 4000), firmware 2.13, UI 7.3.29.

Description
No description provided
Readme MIT 1 MiB
Languages
Python 98.4%
Dockerfile 1.6%