This commit is contained in:
Fabian Affolter 2016-08-27 12:38:41 +02:00
parent 617281a938
commit 901f85cc18
No known key found for this signature in database
GPG Key ID: DDF3D6F44AAB1336

View File

@ -9,34 +9,24 @@ sharing: true
footer: true footer: true
logo: mqtt.png logo: mqtt.png
ha_category: Cover ha_category: Cover
ha_release: 0.18
--- ---
The `mqtt` cover platform enables the possibility to control an MQTT cover. The device state will be updated only after receiving the a new
state from `state_topic`. If these messages are published with `RETAIN` flag, the MQTT device will receive an instant state update after subscription and will start with correct state. Otherwise, the initial state will be `unknown`.
The `mqtt` cover platform enables the possibility to control an MQTT There is a state attribute that stores the relative position of the device, where 0 means the device is `closed` and all other intermediate positions means the device is `open`.
cover. The device state will be updated only after receiving the a new
state from `state_topic`. If these messages are published with RETAIN flag, the
MQTT device will receive an instant state update after subscription and will
start with correct state. Otherwise, the initial state will be `unknown`.
There is a state attribute that stores the relative position of the device, When a state topic is not available, the cover will work in optimistic mode. In this mode, the cover will immediately change state after every command. Otherwise, the cover will wait for state confirmation from device (message from `state_topic`).
where 0 means the device is `closed` and all other intermediate positions
means the device is `open`.
When a state topic is not available, the switch will work in optimistic mode. Optimistic mode can be forced, even if `state_topic` is available. Try to enable it, if experiencing incorrect cover operation.
In this mode, the switch will immediately change state after every command.
Otherwise, the switch will wait for state confirmation from device (message
from `state_topic`).
Optimistic mode can be forced, even if state topic is available. Try to enable To use your MQTT cover in your installation, add the following to your `configuration.yaml` file:
it, if experiencing incorrect switch operation.
To use your MQTT binary sensor in your installation, add the following to your
`configuration.yaml` file:
```yaml ```yaml
# Example configuration.yml entry # Example configuration.yml entry
cover: cover:
platform: mqtt - platform: mqtt
state_topic: "home-assistant/cover" state_topic: "home-assistant/cover"
command_topic: "home-assistant/cover/set" command_topic: "home-assistant/cover/set"
name: "MQTT Sensor" name: "MQTT Sensor"
@ -53,12 +43,12 @@ cover:
Configuration variables: Configuration variables:
- **state_topic** (*Required*): The MQTT topic subscribed to receive sensor values. - **state_topic** (*Required*): The MQTT topic subscribed to receive sensor values.
- **name** (*Optional*): The name of the sensor. Default is 'MQTT Sensor'. - **name** (*Optional*): The name of the sensor. Default is "MQTT Sensor".
- **state_open** (*Optional*): The payload that represents open state. Default is"STATE_OPEN" - **state_open** (*Optional*): The payload that represents open state. Default is"STATE_OPEN"
- **state_closed** (*Optional*): The payload that represents closed state. Default is "STATE_CLOSED" - **state_closed** (*Optional*): The payload that represents closed state. Default is "STATE_CLOSED"
- **service_open** (*Optional*): The payload that represents open state in service mode. Default is"SERVICE_OPEN" - **service_open** (*Optional*): The payload that represents open state in service mode. Default is"SERVICE_OPEN"
- **service_close** (*Optional*): The payload that represents closed state in service mode. Default is "SERVICE_CLOSE" - **service_close** (*Optional*): The payload that represents closed state in service mode. Default is "SERVICE_CLOSE"
- **optimistic** (*Optional*): Flag that defines if switch works in optimistic mode. Default is true if no state topic defined, else false. - **optimistic** (*Optional*): Flag that defines if switch works in optimistic mode. Default is `true` if no state topic defined, else `false`.
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages. - **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages.
- **retain** (*Optional*): If the published message should have the retain flag on or not. - **retain** (*Optional*): If the published message should have the retain flag on or not.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload. - **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.