mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-25 02:07:15 +00:00
MQTT lock config to integration key (#22830)
This commit is contained in:
parent
fadd48786e
commit
512a074493
@ -24,11 +24,30 @@ To enable MQTT locks in your installation, add the following to your `configurat
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# Example configuration.yaml entry
|
# Example configuration.yaml entry
|
||||||
|
mqtt:
|
||||||
|
lock:
|
||||||
|
- command_topic: "home/frontdoor/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 `lock` 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
|
||||||
lock:
|
lock:
|
||||||
- platform: mqtt
|
- platform: mqtt
|
||||||
command_topic: "home/frontdoor/set"
|
command_topic: "home/frontdoor/set"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% 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`.
|
||||||
@ -229,19 +248,19 @@ The example below shows a full configuration for a MQTT lock.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# Example configuration.yaml entry
|
# Example configuration.yaml entry
|
||||||
lock:
|
mqtt:
|
||||||
- platform: mqtt
|
lock:
|
||||||
name: Frontdoor
|
- name: Frontdoor
|
||||||
state_topic: "home-assistant/frontdoor/"
|
state_topic: "home-assistant/frontdoor/"
|
||||||
command_topic: "home-assistant/frontdoor/set"
|
command_topic: "home-assistant/frontdoor/set"
|
||||||
payload_lock: "LOCK"
|
payload_lock: "LOCK"
|
||||||
payload_unlock: "UNLOCK"
|
payload_unlock: "UNLOCK"
|
||||||
state_locked: "LOCK"
|
state_locked: "LOCK"
|
||||||
state_unlocked: "UNLOCK"
|
state_unlocked: "UNLOCK"
|
||||||
optimistic: false
|
optimistic: false
|
||||||
qos: 1
|
qos: 1
|
||||||
retain: true
|
retain: true
|
||||||
value_template: "{{ value.x }}"
|
value_template: "{{ value.x }}"
|
||||||
```
|
```
|
||||||
|
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user