r/Zigbee2MQTT

Exposure in HA

So, we have in the home screen the stats displayed Devices, Online, Router and End Device... Can we get those exposed into HA somehow? I would like to have on a main status dashboard the total devices and the online devices so I can see when I need to look at a dropped device.

reddit.com
u/SERichard1974 — 2 days ago

I built an MCP server for Zigbee2MQTT - v0.7.0, 24 tools for mesh diagnostics and admin

I've been working on an open-source MCP (Model Context Protocol) server for Zigbee2MQTT, and it's now at v0.7.0.

The idea isn't device control - Home Assistant already handles that well. It's the admin and diagnostic side that normally means opening the Z2M frontend and clicking around: checking link quality and mesh topology, finding weak routes or devices that have gone stale, spotting low batteries, inspecting groups and bindings, setting up reporting, managing pairing, and checking OTA availability.

It talks straight to Z2M's MQTT bridge API, so it doesn't depend on Home Assistant at all - just your broker.

What's changed since the early version I first posted about:

  • 24 tools, split across read-only / safe-write / full-write modes
  • Destructive operations (device removal, Touchlink, bridge settings) are opt-in and need explicit confirmation
  • Binding and reporting support, with endpoint payload handling fixed and verified against real hardware in v0.7.0
  • Proper request correlation, reconnect handling and timeouts
  • Broker credentials are redacted from logs
  • 215 tests and 42/42 mutation checks

Runs as a plain stdio process, no database or extra daemon:

npx zigbee2mqtt-mcp

Works with Claude Desktop, VS Code / Copilot, or any other MCP client.

Fair warning that it's still early: I've only been able to test it against Z2M 2.12.x on an EmberZNet coordinator with ~50 devices. I'd really like to know how it behaves on other adapters (CC2652, ConBee, etc.) and on bigger meshes - if you try it, mentioning your coordinator and Z2M version would help a lot.

Happy to answer questions, and issues/PRs are welcome.

u/Short_Ad5978 — 10 days ago
▲ 33 r/Zigbee2MQTT+1 crossposts

You too can have Zigbee2MQTT with Prometheus metrics

A while back I posted about observing my Home Assistant setup, and mentioned I'd added native Prometheus instrumentation to Zigbee2MQTT. Those PRs are still open upstream, and a few people have expressed interest in trying it themselves, so I've packaged the branches up as an add-on repository you can just install: https://github.com/tomwilkie/zigbee2mqtt-prometheus

Add it the usual way - under Settings > Add-ons > Add-on store > Repositories, install "Zigbee2MQTT (Prometheus)", and you get metrics on port 9142. It's built from Zigbee2MQTT 2.13.0, and I'll do my best to build new versions every time theres an update upstream.

Grafana dashboards for it are here, an overview with per device drilldown plus a coordinator view:

https://preview.redd.it/5tlfe2t1f0hh1.png?width=2628&format=png&auto=webp&s=75a07ea327cee7066fa2ed8f60b757c883fba79c

All of this goes away then the PRs land. Until then the repo (warning: lots of claude) also has the runbook for rebasing the forks onto each new Zigbee2MQTT release, so it can keep up. PRs, if you want to nudge them along ;-)

reddit.com
u/netingle — 9 days ago