MQTT Light sends alway "on" command on brightness change

Hi,

i have configure a MQTT-Light

- platform: mqtt
  name: "MyMQTTLightTest"
  state_topic: "/LD382A/MyMQTTLightTest/"
  command_topic: "/LD382A/MyMQTTLightTest/set"
  brightness_state_topic: "/LD382A/MyMQTTLightTest/brightness"
  brightness_command_topic: "/LD382A/MyMQTTLightTest/brightness/set"
  brightness_scale: "100"
  payload_on: "on"
  payload_off: "off"
  optimistic: false
  qos: 0

When i set “on” in HASS
MQTT.fx output:

/LD382A/MyMQTTLightTest/set → on

That’s ok

When i set brightness in HASS to e.g. 39
MQTT.fx output:

/LD382A/MyMQTTLightTest/brightness/set → 39
AND
/LD382A/MyMQTTLightTest/set → on

Why send HASS always the on command? This is for me not practical. I need seperate commands.

What can I do to make this happen?

Thanks in advance

2 Likes

I too would like to know this and be able to prevent the on command following the brightness one.

I’m just setting up a simple light via MQTT that only has a brightness, so on = 100, off = 0.
The payload for on is the same as setting the brightness to 100.
This is a problem, since setting brightness to, say, 50 is followed by on, which sets it to 100.

1 Like

Were you able to figure this out I’m having the same issue

1 Like

Bump. Same problem here with my IR-controlled RGBWW lights.

It is not a problem but a feature: GitHub Issue 2161 and GitHub Issue 1864.

However why is the on-command sent AFTER the brightness command? This is illogical.

Here is an explanation. Brightness is more important than on/off.

FYI I think part of this is fixed. See the PR #9829 for details. You can set the light to output just the brightness now (or change when the on command is sent).

However, I’m still having issues with this behavior in that I can’t get any of the 3 MQTT lights (regular, JSON, and template) to accept the just brightness back as the state (see Issue 7810 if you’re interested).