Fix mosquitto_pub tool syntax in mqtt examples (#33305)

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Jan Bouwhuis 2024-06-17 21:20:29 +02:00 committed by GitHub
parent 1b80c3f697
commit 33be3e532f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -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"

View File

@ -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.