MQTT Lights brightness not working

Hello all, since I’ve updated to 0.87.0 I have a problem with my MQTT Lights. It keeps saying “brightness” is an invalid option for mqtt.light. But in the documentation it is exactly as my configuration.yaml.

My configuration:

light:
- platform: mqtt
schema: json
name: "Led Strip"
state_topic: state/topic"
command_topic: "command/topic"
brightness: true
brightness_scale: 255
rgb: true
optimistic: false

The error it is giving:

Invalid config for [light.mqtt]: [brightness] is an invalid option for [light.mqtt]. Check: light.mqtt->brightness. (See ?, line ?). Please check the docs at https://home-assistant.io/components/light.mqtt/

Is this just a bug or do I need to change something? Thanks a lot!

I’m running into a similar issue, but with the transition and color_temp_value_template settings. It looks like v0.87 made some changes to JSON lights, so some properties are now invalid. However, I’m stuck at how to fix it without just removing the property altogether.

Here’s a sample of some of my yaml that’s causing problems:

  - platform: mqtt
    schema: json
    name: "Kitchen Garden"
    state_topic: "kitchen/rgb2"
    command_topic: "kitchen/rgb2/set"
    brightness: true
    rgb: true
    color_temp: true
    color_temp_value_template: "{{ value_json.color_temp }}"

I believe a change is required, but I’m not sure what that change needs to be. Little documentation to help us manage the changes introduced. Would love to see some better documentation around these breaking changes (e.g. a migration guide would help for sure).

What did this do in earlier versions?

brightness: true

Did it instruct the platform to exclusively use brightness levels to turn the device on and off?

According to the documentation, the on_command_type parameter is used to specify this kind of behavior.

on_command_type: brightness

Using brightness will only send brightness commands instead of the payload_on to turn the light on.

@123 It previously indicated that the given light supported brightness commands.

This is no longer a valid configuration option. It should be removed.

I was also affected by this in multiple spots.

The change as of 0.87:

  • MQTT platforms will now flag mistyped configs from configuration.yaml correctly as invalid, instead of just ignoring them. (@emontnemery - #20562) (mqtt docs) (breaking change)

It looks like the documentation is now wrong, as the default schema (the one which I’m using) doesn’t contain the brightness/rgb/color temp/ boolean options, but the json schema does. If you’re using schema:json and it’s still rejecting the brightness, then that’s a documentation issue

Thanks for the clarification. You’re right, the documentation for an MQTT Light using JSON schema does indicate that brightness is a valid option. So either the documentation is incorrect or there’s a bug in 0.87 that fails to consider this is the json schema version and wrongly flags the brightness option as an error.

I think it’s a bug in 0.87.0. I changed the order a bit and now it works fine without error. Don’t know what caused the error in the first place.

Is it solved in 0.87.1(nothing said on the release notes)?? I’m having the same issue, my mqtt driven lights don’t work with brightness option but if I delete it, my lights won’t work properly either.