Brightness slider lightcard mqtt devices

For some reason the brightness slider is not returning to zero when i turn off the light. This is only in the light card and only with mqtt devices. Other devices it works.
image

I dont know if this is by desgin or not ? I want the slider to go back to zero when i turn off the light.

What is the MQTT brightness state topic reporting? This will simply follow that state…and is useful to know what the brightness will be when you turn the light back on.

If you want it to be off, set the brightness_value_template to follow the state.

# Assuming the brightness state topic is reporting the brightness, 
# report a brightness of 0 when the light is off. Else, report the normal
# brightness. 
# Might have to tweak the {{ value_json }} template to parse the real state value. 
brightness_value_template: >-
  {% if is_state('light.this_light_entity_id', 'off') %}
    0
  {% else %}
    {{ value_json }}
  {% endif %}

This of course assumes you’ve defined this MQTT Light and it’s not some auto integrated device.

Its auto discovered device. If i open the lightcard the brightness slider (when turned off) is at zero.