'brightness_state_topic' not working for Tasmota MQTT light

Hello everyone,

I’ve now spend about 2 hours with this problem and still can’t solve it. I have a Tasmota-based RGBW led stripe that’s using MQTT to talk to Home Assistant. While On/Off state and commands work very well, the brightness state is not working correctly. I’ve configured everything according to the official Tasmota documentation.

Here is my configuration section:

    - name: "Badezimmer LED Stripe"
      state_topic: "tele/badezimmer/farbe/STATE"
      command_topic: "cmnd/badezimmer/farbe/POWER"
      state_value_template: "{{ value_json.POWER }}"
      payload_on: "ON"
      payload_off: "OFF"
      payload_available: "Online"
      payload_not_available: "Offline"
      availability_topic: "tele/badezimmer/farbe/LWT"
      brightness_command_topic: "cmnd/badezimmer/farbe/Dimmer"
      brightness_state_topic: "tele/badezimmer/farbe/STATE"
      brightness_scale: 100
      brightness_value_template: "{{ value_json.Dimmer }}"
      on_command_type: "brightness"

Setting the brightness via Home Assistant works. However when I turn on the light, the brightness value is always 0. And when I change the brightness (via the device’s web ui), the change is not picked up. HA can’t read/process the brightness changes at all.

Here’s an example MQTT message:

{"Time":"2023-02-18T14:02:32","Uptime":"0T02:10:11","UptimeSec":7811,"Heap":25,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":99,"MqttCount":1,"POWER":"ON","Dimmer":83,"Color":"0000009340","HSBColor":"30,12,0","White":83,"CT":258,"Channel":[0,0,0,58,25],"Scheme":0,"Fade":"OFF","Speed":5,"LedTable":"ON","Wifi":{"AP":1,"SSId":"BoxyMcBoxFace","BSSId":"7C:FF:4D:E5:C6:B6","Channel":11,"Mode":"11n","RSSI":72,"Signal":-64,"LinkCount":1,"Downtime":"0T00:00:06"}}

Here’s a snippet from my debug HA log file:

2023-02-18 14:02:33.837 DEBUG (MainThread) [homeassistant.components.mqtt.models] Rendering incoming payload '{"Time":"2023-02-18T14:02:32","Uptime":"0T02:10:11","UptimeSec":7811,"Heap":25,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":99,"MqttCount":1,"POWER":"ON","Dimmer":83,"Color":"0000009340","HSBColor":"30,12,0","White":83,"CT":258,"Channel":[0,0,0,58,25],"Scheme":0,"Fade":"OFF","Speed":5,"LedTable":"ON","Wifi":{"AP":1,"SSId":"BoxyMcBoxFace","BSSId":"7C:FF:4D:E5:C6:B6","Channel":11,"Mode":"11n","RSSI":72,"Signal":-64,"LinkCount":1,"Downtime":"0T00:00:06"}}' with variables {'entity_id': 'light.badezimmer_led_stripe', 'name': 'Badezimmer LED Stripe', 'this': <template TemplateStateFromEntityId(light.badezimmer_led_stripe)>} with default value 'default' and Template("{{ value_json.Dimmer }}")

Any ideas what the reason might be?

Is there a reason why you are configuring the light manually as opposed to using the Tasmota integration (which automatically discovers Tasmotized devices)?

No particular reason other than “when I started this, it did not exist, yet”. I will give it a try. I’d still be interested to find the mistake in my manual configuration, though.

OK. The Tasmota integration was added in October 2020, in version 0.117, so I assume your configuration must have been created over 2 years ago. Has it been working well but only recently developed a problem?

Yes, you’re correct. There are no other problems with my config. All other lights work fine. I only recently added this new RGBW LED Stripe which creates these problems. All other lights work well (though there are no other lights with adjustable brightness).