mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
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:
parent
1b80c3f697
commit
33be3e532f
@ -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"
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user