mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-24 01:37:23 +00:00
MQTT button config to integration key (#22816)
This commit is contained in:
parent
029d32f982
commit
6f72a91d0b
@ -14,11 +14,30 @@ The `mqtt` button platform lets you send an MQTT message when the button is pres
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# Example configuration.yaml entry
|
# Example configuration.yaml entry
|
||||||
|
mqtt:
|
||||||
|
button:
|
||||||
|
- command_topic: "home/bedroom/switch1/reboot"
|
||||||
|
```
|
||||||
|
|
||||||
|
<a id='new_format'></a>
|
||||||
|
|
||||||
|
{% details "Previous configuration format" %}
|
||||||
|
|
||||||
|
The configuration format of manual configured MQTT items has changed.
|
||||||
|
The old format that places configurations under the `button` platform key
|
||||||
|
should no longer be used and is deprecated.
|
||||||
|
|
||||||
|
The above example shows the new and modern way,
|
||||||
|
this is the previous/old example:
|
||||||
|
|
||||||
|
```yaml
|
||||||
button:
|
button:
|
||||||
- platform: mqtt
|
- platform: mqtt
|
||||||
command_topic: "home/bedroom/switch1/reboot"
|
command_topic: "home/bedroom/switch1/reboot"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% enddetails %}
|
||||||
|
|
||||||
{% configuration %}
|
{% configuration %}
|
||||||
availability:
|
availability:
|
||||||
description: A list of MQTT topics subscribed to receive availability (online/offline) updates. Must not be used together with `availability_topic`.
|
description: A list of MQTT topics subscribed to receive availability (online/offline) updates. Must not be used together with `availability_topic`.
|
||||||
@ -193,16 +212,16 @@ The example below shows a full configuration for a button.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# Example configuration.yaml entry
|
# Example configuration.yaml entry
|
||||||
button:
|
mqtt:
|
||||||
- platform: mqtt
|
button:
|
||||||
unique_id: bedroom_switch_reboot_btn
|
- unique_id: bedroom_switch_reboot_btn
|
||||||
name: "Restart Bedroom Switch"
|
name: "Restart Bedroom Switch"
|
||||||
command_topic: "home/bedroom/switch1/commands"
|
command_topic: "home/bedroom/switch1/commands"
|
||||||
payload_press: "restart"
|
payload_press: "restart"
|
||||||
availability:
|
availability:
|
||||||
- topic: "home/bedroom/switch1/available"
|
- topic: "home/bedroom/switch1/available"
|
||||||
qos: 0
|
qos: 0
|
||||||
retain: false
|
retain: false
|
||||||
entity_category: "config"
|
entity_category: "config"
|
||||||
device_class: "restart"
|
device_class: "restart"
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user