The mosquitto
broker package ships commandline tools (often as *-clients
package) to send and receive MQTT messages. As an alternative have a look at hbmqtt_pub and hbmqtt_sub which are provided by HBMQTT. For sending test messages to a broker running on localhost check the example below:
Another way to send MQTT messages manually is to use the “MQTT” Integration in the frontend. Choose the “Configuration” tab, click “Integrations” and click the “Configure” option under the “MQTT” integration. Enter something similar to the example below into the “topic” field under “Publish a packet*.
and in the Payload field
In the “Listen to a topic” field, type # to see everything, or “home-assistant/switch/#” to just follow the published topic. Press “Start Listening” and then press “Publish”. The result should appear similar to the text below
For reading all messages sent on the topic home-assistant
to a broker running on localhost:
Suggest an edit to this page, or provide/view feedback for this page.
Source: MQTT Testing – Home Assistant