MQTT light custom brightness command payload

Hi there!

I want to combine my switch and smart bulb so: The on/off command is send to the switch, and the brightness is send to the bulb.

Whay i’ve got right now:

  - platform: mqtt
    name: Eetkamer Test
    command_topic: "zigbee2mqtt/Eetkamer Schakelaar/l1/set"
    state_topic: "zigbee2mqtt/Eetkamer Schakelaar"
    state_value_template: "{{ value_json.state_l1 }}"
    brightness_command_topic: "zigbee2mqtt/Eetkamer/set"

The on/off works great, but brightness isn’t working. This because home assistant will send zigbee2mqtt/Eetkamer/set with payload the brightness value. But it has to be {"brightness": VALUE}

does anyone has any idea how i can set the brightness command payload?

I’ve made a PR to support this: Mqtt light cmd template by rubenverhoef · Pull Request #63361 · home-assistant/core · GitHub

1 Like