a-bali/janitor

How to setup MQTT-connection?

Closed this issue · 3 comments

Hello,
Thank you for this very clean app; great programming.

Just a question regarding connecting to my MQTT-server for HomeAssistant.

I have HA and Janitor up and running; evrything works fine with Wifi and Ping but the MQTT-flow doesn't show anything.
Can you complete the example at the HomeAssistant-side to get all the necessary info (espacially: "/sensors/#" and "/stats/#".

I presume that this is done in the configuration.yaml off HA? Via MQTT-stream?
I found a link here: https://www.home-assistant.io/integrations/mqtt_statestream/

Thnx again!

I'm not sure I fully understand the question.

You will need to run an MQTT broker (e.g. Mosquitto) to handle MQTT traffic. You can install this in a standalone way or as part of HA (see here for details).

Then you will need devices publishing data to the MQTT broker (e.g. Zigbee2MQTT for relaying data from Zigbee devices to MQTT, or OpenMQTTGateway for BLE devices, but there are numerous solutions; even HA can publish MQTT messages about state changes with the integration you linked).

What Janitor does is to subscribe to the topics you define on the broker and check whether the messages keep coming (in the example configuration provided: /sensors/# and /stats/#, but this is fully dependant on your setup and how the topics you want to monitor are named; if you want to monitor HA state changes, you will need to subscribe to the topic you configured in HA for mqtt_statestream integration by the base_topic variable).

I found how to connect to the MQTT-server; problem was I didn't knew the published topics from HA.
This piece of software showed me the topics and... it works like a charm now!
MQTT-explorer: https://mqtt-explorer.com/
Thank you again!

Good to hear. You could also just subscribe to all topics in Janitor with /# (which is a wildcard), and then it will show and monitor all topics that receive traffic.