From 2839ea93698d0705eb9e8d07d283291cd64dd954 Mon Sep 17 00:00:00 2001 From: Ted Drain Date: Tue, 31 Oct 2017 12:02:44 -0700 Subject: [PATCH] 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 --- source/_components/light.mqtt.markdown | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/source/_components/light.mqtt.markdown b/source/_components/light.mqtt.markdown index 26496730b0a..99a1746623c 100644 --- a/source/_components/light.mqtt.markdown +++ b/source/_components/light.mqtt.markdown @@ -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).