mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-19 07:17:14 +00:00
MQTT switch config to integration key (#22837)
This commit is contained in:
parent
fee352d834
commit
5a600d7ec0
@ -22,11 +22,30 @@ To enable this switch in your installation, add the following to your `configura
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
mqtt:
|
||||
switch:
|
||||
- command_topic: "home/bedroom/switch1/set"
|
||||
```
|
||||
|
||||
<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 `switch` 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
|
||||
switch:
|
||||
- platform: mqtt
|
||||
command_topic: "home/bedroom/switch1/set"
|
||||
```
|
||||
|
||||
{% enddetails %}
|
||||
|
||||
{% configuration %}
|
||||
availability:
|
||||
description: A list of MQTT topics subscribed to receive availability (online/offline) updates. Must not be used together with `availability_topic`.
|
||||
@ -225,9 +244,9 @@ The example below shows a full configuration for a switch.
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
switch:
|
||||
- platform: mqtt
|
||||
unique_id: bedroom_switch
|
||||
mqtt:
|
||||
switch:
|
||||
- unique_id: bedroom_switch
|
||||
name: "Bedroom Switch"
|
||||
state_topic: "home/bedroom/switch1"
|
||||
command_topic: "home/bedroom/switch1/set"
|
||||
@ -262,9 +281,9 @@ The configuration will look like the example below:
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
switch:
|
||||
- platform: mqtt
|
||||
name: bathroom
|
||||
mqtt:
|
||||
switch:
|
||||
- name: bathroom
|
||||
state_topic: "home/bathroom/gpio/13"
|
||||
command_topic: "home/bathroom/gpio/13"
|
||||
payload_on: "1"
|
||||
|
Loading…
x
Reference in New Issue
Block a user