Update MQTT cover example to avoid confusion with discovery prefix (#39142)

This commit is contained in:
Jan Bouwhuis 2025-05-22 09:31:32 +02:00 committed by GitHub
parent 6155850fa9
commit c69bb33ec0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -33,7 +33,7 @@ To use your MQTT cover in your installation, add the following to your {% term "
# Example configuration.yaml entry # Example configuration.yaml entry
mqtt: mqtt:
- cover: - cover:
command_topic: "home-assistant/cover/set" command_topic: "living-room-cover/set"
``` ```
{% configuration %} {% configuration %}
@ -350,10 +350,10 @@ The example below shows a full configuration for a cover without tilt with state
mqtt: mqtt:
- cover: - cover:
name: "MQTT Cover" name: "MQTT Cover"
command_topic: "home-assistant/cover/set" command_topic: "living-room-cover/set"
state_topic: "home-assistant/cover/state" state_topic: "living-room-cover/state"
availability: availability:
- topic: "home-assistant/cover/availability" - topic: "living-room-cover/availability"
qos: 0 qos: 0
retain: true retain: true
payload_open: "OPEN" payload_open: "OPEN"
@ -382,11 +382,11 @@ The example below shows a full configuration for a cover without tilt with posit
mqtt: mqtt:
- cover: - cover:
name: "MQTT Cover" name: "MQTT Cover"
command_topic: "home-assistant/cover/set" command_topic: "living-room-cover/set"
position_topic: "home-assistant/cover/position" position_topic: "living-room-cover/position"
availability: availability:
- topic: "home-assistant/cover/availability" - topic: "living-room-cover/availability"
set_position_topic: "home-assistant/cover/set_position" set_position_topic: "living-room-cover/set_position"
qos: 0 qos: 0
retain: true retain: true
payload_open: "OPEN" payload_open: "OPEN"
@ -413,11 +413,11 @@ The example below shows a full configuration for a cover with position, state &
mqtt: mqtt:
- cover: - cover:
name: "MQTT Cover" name: "MQTT Cover"
command_topic: "home-assistant/cover/set" command_topic: "living-room-cover/set"
state_topic: "home-assistant/cover/state" state_topic: "living-room-cover/state"
position_topic: "home-assistant/cover/position" position_topic: "living-room-cover/position"
availability: availability:
- topic: "home-assistant/cover/availability" - topic: "living-room-cover/availability"
qos: 0 qos: 0
retain: true retain: true
payload_open: "OPEN" payload_open: "OPEN"
@ -432,8 +432,8 @@ mqtt:
optimistic: false optimistic: false
value_template: "{{ value.x }}" value_template: "{{ value.x }}"
position_template: "{{ value.y }}" position_template: "{{ value.y }}"
tilt_command_topic: "home-assistant/cover/tilt" tilt_command_topic: "living-room-cover/tilt"
tilt_status_topic: "home-assistant/cover/tilt-state" tilt_status_topic: "living-room-cover/tilt-state"
tilt_status_template: "{{ value_json["PWM"]["PWM1"] }}" tilt_status_template: "{{ value_json["PWM"]["PWM1"] }}"
tilt_min: 0 tilt_min: 0
tilt_max: 180 tilt_max: 180
@ -454,11 +454,11 @@ The example below shows a full configuration for a cover using stopped state.
mqtt: mqtt:
- cover: - cover:
name: "MQTT Cover" name: "MQTT Cover"
command_topic: "home-assistant/cover/set" command_topic: "living-room-cover/set"
state_topic: "home-assistant/cover/state" state_topic: "living-room-cover/state"
position_topic: "home-assistant/cover/position" position_topic: "living-room-cover/position"
availability: availability:
- topic: "home-assistant/cover/availability" - topic: "living-room-cover/availability"
qos: 0 qos: 0
retain: true retain: true
payload_open: "OPEN" payload_open: "OPEN"
@ -523,10 +523,10 @@ The example below shows an example of how to correct the state of the blind depe
mqtt: mqtt:
- cover: - cover:
name: "MQTT Cover" name: "MQTT Cover"
command_topic: "home-assistant/cover/set" command_topic: "living-room-cover/set"
state_topic: "home-assistant/cover/state" state_topic: "living-room-cover/state"
position_topic: "home-assistant/cover/position" position_topic: "living-room-cover/position"
set_position_topic: "home-assistant/cover/position/set" set_position_topic: "living-room-cover/position/set"
payload_open: "open" payload_open: "open"
payload_close: "close" payload_close: "close"
payload_stop: "stop" payload_stop: "stop"
@ -569,11 +569,11 @@ Following variable might be used in `position_template`, `set_position_template`
mqtt: mqtt:
- cover: - cover:
name: "MQTT Cover" name: "MQTT Cover"
command_topic: "home-assistant/cover/set" command_topic: "living-room-cover/set"
state_topic: "home-assistant/cover/state" state_topic: "living-room-cover/state"
position_topic: "home-assistant/cover/position" position_topic: "living-room-cover/position"
set_position_topic: "home-assistant/cover/position/set" set_position_topic: "living-room-cover/position/set"
tilt_command_topic: "home-assistant/cover/position/set" # same as `set_position_topic` tilt_command_topic: "living-room-cover/position/set" # same as `set_position_topic`
qos: 1 qos: 1
retain: false retain: false
payload_open: "open" payload_open: "open"
@ -625,5 +625,5 @@ mqtt:
To test, you can use the command line tool `mosquitto_pub` shipped with `mosquitto` or the `mosquitto-clients` package to send MQTT messages. This allows you to operate your cover manually: To test, you can use the command line tool `mosquitto_pub` shipped with `mosquitto` or the `mosquitto-clients` package to send MQTT messages. This allows you to operate your cover manually:
```bash ```bash
mosquitto_pub -h 127.0.0.1 -t home-assistant/cover/set -m "CLOSE" mosquitto_pub -h 127.0.0.1 -t living-room-cover/set -m "CLOSE"
``` ```