From 33be3e532ff954596136536622389e7ee911fb98 Mon Sep 17 00:00:00 2001 From: Jan Bouwhuis Date: Mon, 17 Jun 2024 21:20:29 +0200 Subject: [PATCH] Fix mosquitto_pub tool syntax in mqtt examples (#33305) Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- source/_integrations/mqtt.markdown | 2 +- source/_integrations/sensor.mqtt.markdown | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/_integrations/mqtt.markdown b/source/_integrations/mqtt.markdown index 11bee3cbaa6..dc038056424 100644 --- a/source/_integrations/mqtt.markdown +++ b/source/_integrations/mqtt.markdown @@ -217,7 +217,7 @@ MQTT Birth and Last Will messages can be customized or disabled from the UI. To ## Testing your setup -The `mosquitto` broker package ships commandline tools (often as `*-clients` package) to send and receive MQTT messages. For sending test messages to a broker running on `localhost` check the example below: +The `mosquitto` broker package ships command line tools (often as `*-clients` package) to send and receive MQTT messages. For sending test messages to a broker running on `localhost`, to can use [`mosquitto_pub`](https://mosquitto.org/man/mosquitto_pub-1.html), check the example below: ```bash mosquitto_pub -h 127.0.0.1 -t homeassistant/switch/1/on -m "Switch is ON" diff --git a/source/_integrations/sensor.mqtt.markdown b/source/_integrations/sensor.mqtt.markdown index d7efb8ebddc..e8b9a637cce 100644 --- a/source/_integrations/sensor.mqtt.markdown +++ b/source/_integrations/sensor.mqtt.markdown @@ -263,7 +263,7 @@ Payload: `1707294116` To set the state of the sensor manually: ```bash -mosquitto_pub -h 127.0.0.1 -u username -p some_password -t pump/timestamp_on -m '1707294116' +mosquitto_pub -h 127.0.0.1 -p 1883 -u username -P some_password -t pump/timestamp_on -m '1707294116' ``` Make sure the IP address of your MQTT broker is used and that user credentials have been set up correctly.