Skip to main content

Human-friendly dashboard for mtr2mqtt summary topics

Project description

mtrview

mtrview

mtrview is a small standalone web dashboard for retained JSON summaries published by mtr2mqtt. mtr2mqtt writes the measurement summaries to MQTT; mtrview subscribes to those topics and turns the latest values into a simple human-friendly dashboard.

The app subscribes to summary topics such as summary/<receiver>, keeps the latest summary per receiver in memory, normalizes transmitter readings, and serves a dark auto-updating dashboard at http://localhost:8000/.

MQTT input

By default mtrview subscribes to:

summary/#

Each retained message should be a JSON object with a receiver, an updated_at timestamp, and a transmitters mapping. Transmitter metadata may be partial; missing location, zone, quantity, description, or unit fields are displayed with sensible placeholders instead of failing.

Configuration

Settings are read from environment variables:

Variable Default
MTRVIEW_MQTT_HOST localhost
MTRVIEW_MQTT_PORT 1883
MTRVIEW_MQTT_USERNAME unset
MTRVIEW_MQTT_PASSWORD unset
MTRVIEW_MQTT_TOPICS summary/#
MTRVIEW_HTTP_HOST 0.0.0.0
MTRVIEW_HTTP_PORT 8000
MTRVIEW_REFRESH_INTERVAL_SECONDS 20
MTRVIEW_DISPLAY_TIMEZONE UTC

See .env.example for a copyable starting point.

Local run

uv sync --group dev
uv run mtrview

Then open http://localhost:8000/.

Useful endpoints:

  • GET / - dashboard
  • GET /api/summary - normalized JSON for all receivers and transmitters
  • GET /health - health status

Docker

docker build -t mtrview .
docker run --rm -p 8000:8000 \
  -e MTRVIEW_MQTT_HOST=host.docker.internal \
  -e MTRVIEW_MQTT_TOPICS=summary/# \
  mtrview

Dashboard

The UI is server-rendered first, with a small vanilla JavaScript refresh loop that fetches /api/summary. It includes summary counts, MQTT connection state, search, status/zone/receiver filters, card and compact table views, and a priority section for non-online readings.

Development

make install
make verify

Individual checks:

uv run pytest
uv run ruff check .

Releases

Releases are managed by GitHub Actions using Conventional Commits and semantic-release. Merges to master can create GitHub releases, publish the Python package to PyPI, and publish multi-arch Docker images to Docker Hub as tvallas/mtrview.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mtrview-0.2.0.tar.gz (343.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mtrview-0.2.0-py3-none-any.whl (269.6 kB view details)

Uploaded Python 3

File details

Details for the file mtrview-0.2.0.tar.gz.

File metadata

  • Download URL: mtrview-0.2.0.tar.gz
  • Upload date:
  • Size: 343.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mtrview-0.2.0.tar.gz
Algorithm Hash digest
SHA256 75da1ca747b4712090006f46d2d8223a90e285cc747f9f38ce5f779c2d4e88b6
MD5 a5a0414d9a30b7cc584f102c684847c2
BLAKE2b-256 4d36363429c84193e410c10e116d780258a2e2bd5bc2be7cd36964b0a9bcf1f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtrview-0.2.0.tar.gz:

Publisher: semantic_release.yml on tvallas/mtrview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mtrview-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: mtrview-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 269.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mtrview-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10466b3c1fc9ebe5154d3d75946c428a2f46e807ddf2353ffc96f85972a10677
MD5 a724e6f67c42d1f3be0f8f9654804692
BLAKE2b-256 2f420ee7658392414728c2d8ee1d6fe0607f6f90b5b0206c8b20009b8801052d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtrview-0.2.0-py3-none-any.whl:

Publisher: semantic_release.yml on tvallas/mtrview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page