Updated MQTT light docs for new option (#3595)

* Updated MQTT light docs for new option

* Changed brightness options to lower case

* Update the format

* Update according code
This commit is contained in:
Ted Drain 2017-10-31 12:02:44 -07:00 committed by Fabian Affolter
parent c071ed3144
commit 2839ea9369

View File

@ -42,6 +42,7 @@ Configuration variables:
- **effect_value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the effect value.
- **effect_list** (*Optional*): The list of effects the light supports.
- **name** (*Optional*): The name of the switch. Default is 'MQTT Switch'.
- **on_command_type** (*Optional*): Defines when on the payload_on is sent. Using `last` (the default) will send any style (brightness, color, etc) topics first and then a `payload_on` to the `command_topic`. Using `first` will send the `payload_on` and then any style topics. Using `brightness` will only send brightness commands instead of the `payload_on` to turn the light on.
- **optimistic** (*Optional*): Flag that defines if switch works in optimistic mode. Default is true if no state topic defined, else false.
- **payload_off** (*Optional*): The payload that represents disabled state. Default is "OFF".
- **payload_on** (*Optional*): The payload that represents enabled state. Default is "ON".
@ -128,6 +129,24 @@ light:
optimistic: false
```
### {% linkable_title Brightness without on commands %}
To enable a light that sends only brightness topics to turn it on, add the following to your `configuration.yaml` file. The `command_topic` is only used to send an off command in this case:
```yaml
# Example configuration.yml entry
light:
- platform: mqtt
name: "Brightness light"
state_topic: "office/light/status"
command_topic: "office/light/switch"
payload_off: "OFF"
brightness_state_topic: 'office/rgb1/light/brightness'
brightness_command_topic: 'office/rgb1/light/brightness/set'
on_command_type: 'brightness'
```
### {% linkable_title Implementations %}
- A [basic example](https://github.com/mertenats/open-home-automation/tree/master/ha_mqtt_light) using a nodeMCU board (ESP8266) to control its built-in LED (on/off).