MQTT Light problems with Dimmer devices

I’m trying to add my Zwave devices to HA by using ZwaveToMqtt. That works fine for most of the basics devices, for example switches. I encounter some difficulties with the (Fibaro) dimmer devices.

I used the following help page:

-The mqtt light component required a command_topic but the Fibaro device has no switch entity. I must control the light by posting the value to the Level topic. Now I used a not existing topic in the config section but probably there’s a better solution to this. The problem is that HA displays an On/off switch in the top right but I can’t use that because of the not existing topic.

Problem 2:
-When I use the bar to set the level to the dimmer the state of the dimmer is very strange. Most of the steps are good. For example 50% level displays an orange bulb, 100% a yellow bulb. But when I set the level to 0% the state goes to On. The bulb become yellow, and I see that ON is posted to the command topic (that doesn’t exist really). So HA displays an ON state but the bulb is off.
Link to screen capture

The config looks like this:

I also tried the setting:
on_command_type: 'brightness'

but I didn’t notice any difference behavior. Anyone suggestions how to fix this?

I have run into the same problem, my GE zwave dimmer now doesn’t have an on/off slider like it did when using the built in zwave.

Meanwhile I got an workaround for this problem, but that’s not ideal. With this I can switch the Dimmer but can’t dim the device.

  - platform: mqtt
    name: "zwave2mqtt_fibaro_dimmer2_zolder_werkkamer_Level"
    command_topic: "zwave2mqtt/28/38/1/0/set"
    brightness_state_topic: "zwave2mqtt/28/38/1/0"
    brightness_command_topic: "zwave2mqtt/28/38/1/0/set"
    brightness_scale: 99
    payload_on: 99
    payload_off: 0
    optimistic: true

The ‘payload_on’ and ‘payload_off’ ensures that HA not set ON of OFF but a Level value to that command topic. This is the output when I control the On/off of the dimmer device in HA:

zwave2mqtt/18/38/1/0/set 99
zwave2mqtt/18/38/1/0 99
zwave2mqtt/18/38/1/0/set 0
zwave2mqtt/18/38/1/0 0

The only problem is that controlling the level of got this behavior in HA.

zwave2mqtt/18/38/1/0/set 58
zwave2mqtt/18/38/1/0/set 99
zwave2mqtt/18/38/1/0 58
zwave2mqtt/18/38/1/0 99

So HA sends value 58 to the command topic, but directly after that sends 99. So that ensures that the light always between 0 and 100%.

Anyone any suggestions?

If you turn the switch on and off from the physical switch, does it show in the HA UI?

Currently mine doesn’t update and still shows off in the UI when I turn the light on from the physical switch. Maybe the solution is to get that to update so HA will see an On/Off state.

Maybe set the payload of 0 to be off and anything 1 or higher to show as on OFF in the UI.

1 Like

I’ve a solution for the level problem. The right configuration for sending 0 or 99 when switching AND sending 45 for example when level is set to 45.

  - platform: mqtt
    name: "zwave2mqtt_fibaro_dimmer2_gamekamer_Level"
    on_command_type: "brightness"
    command_topic: "zwave2mqtt/31/38/1/0/set"
    state_topic: "zwave2mqtt/31/38/1/0"
    brightness_command_topic: "zwave2mqtt/31/38/1/0/set"
    brightness_scale: 99
    payload_on: 99
    payload_off: 0
    optimistic: true 
    retain: true

I will test your question tonight because I’m currently not at home. I think that my HA status is not updated when using the physical button.

I was also looking at the light template to see if that would work.

Try the solution here: Mqtt value template