MQTT logger and browser

If this is wrong place to share MQTT logger and browser project for Home Assitant, please, point me to the proper subforum. Thank you!

HA has built-in ability to log debug MQTT messages. However, it is not very sane to run all devices in debug mode. I searched to ready MQTT logger and viewer and did not find anything. If you know about such ready add-on or blueprint or HACS, please, share!

In the meanwhile, here is “beand new” MQTT Logger and browser (or viewer).

What is does:

  1. Listens to (almost) all MQTT messages in HA MQTT broker.
  2. Writes them to Loki.
  3. Filters them to Grafana dashboard. You can control the filtering by device name, topic, and time window. The MQTT viewer made easy (for me) - constructive feedback for further improvement is welcome! :slight_smile:

What it uses:

  • Node-RED
  • Loki
  • Grafana
1 Like

Could it use some of the ideas from here? Could they use any of your ideas?

1 Like

@IOT7712 Thank you for sharing MQTT explorer app. It is like built-in MQTT client, just on steroids! :slight_smile:

I have learnt from it that it is better to share the projects as an app and not as bunch of modules+instructions.

So here we go:

MQTT Logger and browser

Logs every MQTT message seen by your Home Assistant broker into Loki, then gives you a Grafana dashboard to see which devices are online and to search the raw message history - filterable by device and topic.

Installing

Add repository to Home Assistant

  1. Click the button above (opens your own Home Assistant instance and pre-fills the repository URL), or add it manually: Settings → Add-ons/Apps → Add-on/App Store → ⋮ → Repositories → paste https://github.com/igrowing/HA_MQTT_Logger.
  2. Find MQTT Logger in the store and install it.
  3. Before starting it: install the official Mosquitto broker app/add-on if you don’t already have one, and create a dedicated MQTT user for this app under Settings → People → Users (don’t reuse your own admin account).
  4. Open MQTT Logger’s Configuration tab, set mqtt_username / mqtt_password to that user, and adjust retention_days / filter_regex if you want (defaults: 30 days, no extra filtering beyond the built-in HA-discovery/system-topic noise filters).
  5. Return to MQTT Logger’s Info tab and assert:
  • “Show in sidebar” - for ease of access to the app;
  • “Watchdog” - for restert of the app if crashes (not likely but safe!)
  • “Auto update” - optionally.
  1. Start the app. MQTT Logger appears in the sidebar with the dashboard ready - no separate Grafana login, no manual Node-RED flow import, no Loki setup.