Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 39fc24e

Browse files
authored
Clarify that zero mqtt light brightness are ignored and that the range starts at 1 (home-assistant#40646)
1 parent 60b0530 commit 39fc24e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

source/_integrations/light.mqtt.markdown

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ brightness_scale:
105105
type: integer
106106
default: 255
107107
brightness_state_topic:
108-
description: The MQTT topic subscribed to receive brightness state updates.
108+
description: The MQTT topic subscribed to receive brightness state updates. Zero brightness values are ignored.
109109
required: false
110110
type: string
111111
brightness_value_template:
@@ -765,7 +765,7 @@ schema:
765765
type: string
766766
default: basic
767767
state_topic:
768-
description: 'The MQTT topic subscribed to receive state updates in a JSON-format. The JSON payload may contain the elements: `"state"`: `"ON"` the light is on, `"OFF"` the light is off, `null` the state is `unknown`; `"color_mode"`: one of the `supported_color_modes`; `"color"`: A dict with the color attributes*; `"brightness"`: The brightness; `"color_temp"`: The color temperature; `"effect"`: The effect of the light.'
768+
description: 'The MQTT topic subscribed to receive state updates in a JSON-format. The JSON payload may contain the elements: `"state"`: `"ON"` the light is on, `"OFF"` the light is off, `null` the state is `unknown`; `"color_mode"`: one of the `supported_color_modes`; `"color"`: A dict with the color attributes*; `"brightness"`: The brightness; `"color_temp"`: The color temperature; `"effect"`: The effect of the light. Zero brightness values are ignored.'
769769
required: false
770770
type: string
771771
supported_color_modes:
@@ -939,7 +939,7 @@ mqtt:
939939

940940
- [ESPHome](https://esphome.io) implements the JSON schema for MQTT based installs and supports [MQTT discovery](/integrations/mqtt/#mqtt-discovery).
941941

942-
- [AiLight](https://github.com/stelgenhof/AiLight) is a custom firmware for the Ai-Thinker (and equivalent) RGBW WiFi light bulbs that has an ESP8266 onboard and controlled by the MY9291 LED driver. It implements the [MQTT JSON light](/integrations/light.mqtt) platform and supports ON/OFF, RGBW colours, brightness, color temperature, flashing and transitions. Also it includes [MQTT Auto Discovery](/integrations/mqtt/#mqtt-discovery)) and the MQTT Last Will and Testament is enabled as well.
942+
- [AiLight](https://github.com/stelgenhof/AiLight) is a custom firmware for the Ai-Thinker (and equivalent) RGBW WiFi light bulbs that has an ESP8266 onboard and controlled by the MY9291 LED driver. It implements the [MQTT JSON light](/integrations/light.mqtt) platform and supports ON/OFF, RGBW colours, brightness, color temperature, flashing and transitions. Also it includes [MQTT Auto Discovery](/integrations/mqtt/#mqtt-discovery) and the MQTT Last Will and Testament is enabled as well.
943943

944944
- [h801-mqtt-json](https://github.com/starkillerOG/h801-mqtt-json) is a custom firmware for the H801 LED dimmer, a 5 channel (RGBWWCW) WiFi LED strip controller for 12V LED strips. The firmware is meant to control the 5 channels of the H801 to simultaneously control an RGB and a Warm-white/Cold-white LED strip such as a 5050 RGB LED strip and a 5025 Dual White strip. It implements the [MQTT JSON light](/integrations/light.mqtt) platform and supports ON/OFF, RGBW colours (RGB strip), brightness, color temperature (CW/WW strip) and transitions.
945945

@@ -1015,7 +1015,7 @@ blue_template:
10151015
required: false
10161016
type: template
10171017
brightness_template:
1018-
description: "[Template](/docs/configuration/templating/#using-value-templates-with-mqtt) to extract brightness from the state payload value. Expected result of the template is an integer from 0-255 range."
1018+
description: "[Template](/docs/configuration/templating/#using-value-templates-with-mqtt) to extract brightness from the state payload value. Expected result of the template is an integer from 1-255 range."
10191019
required: false
10201020
type: template
10211021
color_temp_kelvin:
@@ -1266,7 +1266,7 @@ mqtt:
12661266

12671267
This example comes from a configuration of Shelly RGBW Bulb working in White mode.
12681268
`max_mireds` and `min_mireds` set color temperature boundaries to 3000K - 6500K. Notice the same limits are applied in `command_on_template`, but in kelvin units this time. It's due to conversion from mired to kelvin which causes exceeding boundary values accepted by the device.
1269-
The code also ensures bi-directional conversion of brightness scale between 0-100 (required by the device) and 0-255 (required by Home Assistant).
1269+
The code also ensures bi-directional conversion of brightness scale between 1-100 (required by the device) and 1-255 (required by Home Assistant). Note that Home Assistant ignores a zero brightness value. So when the light is off, it should publish an off state instead.
12701270
Add the following to your {% term "`configuration.yaml`" %} file:
12711271

12721272
{% raw %}
@@ -1299,7 +1299,7 @@ mqtt:
12991299
min_mireds: 153
13001300
qos: 1
13011301
retain: false
1302-
optimistic: false
1302+
optimistic: false
13031303
```
13041304

13051305
{% endraw %}

0 commit comments

Comments
 (0)