Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions source/_components/light.mqtt_json.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ brightness:
required: false
type: boolean
default: false
brightness_scale:
description: "Defines the maximum brightness value (i.e. 100%) of the MQTT device."
required: false
type: integer
default: 255
color_temp:
description: Flag that defines if the light supports color temperature.
required: false
Expand Down Expand Up @@ -191,6 +196,29 @@ light:
brightness: true
```

### {% linkable_title Brightness Scaled %}

To enable a light using a brightness scale other than 8bit the `brightness_scale` option may be added to denote the "fully on" value:
```yaml
# Example configuration.yaml entry
light:
- platform: mqtt_json
name: mqtt_json_light_1
state_topic: "home/light"
command_topic: "home/light/set"
brightness: true
brightness_scale: 4095
```

Home Assistant will then convert its 8bit value in the message to and from the device:

```json
{
"brightness": 4095,
"state": "ON",
}
```

### {% linkable_title Implementations %}

- A full example of custom lighting using this platform and an ESP8266 microcontroller can be found [here](https://github.com/corbanmailloux/esp-mqtt-rgb-led). It supports on/off, brightness, transitions, RGB colors, and flashing.
Expand Down