MQTT Light configuration to Z-Way MQTT plugin

I have a raspberry pi with a RaZberry connected, and a plugin which sends mqtt messges..

I am trying to configure Home Assistant to correctly communicate with it using MQTT Light, but I cant get it to work. I have tried a lot of different configurations. The Z-Way plugin accepts both numbers and on/off, but always responds with a number. When sending on, it automatically restores the level it had before 0/off was received.

My problems:

  • There is no available on_command_type that only sends my payload_on, which would be best.
  • Home assistant does not send anything when toggling the on/off-switch to off
  • Home Assistant does not understand current on/off state probably because it never receives the on/off payload, only numbers.

My configuration:

platform: mqtt
name: "Bedroom Ceiling Dimmer"
state_topic: "Fredriksberg/Indoor/GroundFloor/Bedroom/CeilingLight/Dimmer"
command_topic: "Fredriksberg/Indoor/GroundFloor/Bedroom/CeilingLight/Dimmer/Set"
payload_off: "0"
payload_on: "on"
brightness_state_topic: "Fredriksberg/Indoor/GroundFloor/Bedroom/CeilingLight/Dimmer"
brightness_command_topic: "Fredriksberg/Indoor/GroundFloor/Bedroom/CeilingLight/Dimmer/Set"
on_command_type: "last"
brightness_scale: 99
optimistic: false

Just found out Home-Assistant seems to not send the payload_off if command_topic and brightness_command_topic are the same? This is probably a bug.

Your MQTT Light configuration is very similar to mine.

Based on what I’ve experienced, payload_on and payload_off represent what is received and what Home Assistant will transmit. In my case, both are numeric (0=off, 1=on).

I have on_command_topic set to brightness. Initially, I used the default value (last) but discovered I could not use the brightness slider to turn off the light (something about the order of the published messages caused the light to turn off and then immediately back on).

What does it send? Nothing at all?


Sample from my lights.yaml file:

  - platform: mqtt
    name: "Mantle"
    state_topic: "premise/home/mantlelight/powerstate"
    command_topic: "premise/command/home/mantlelight/powerstate"
    payload_on: "1" 
    payload_off: "0"
    brightness_scale: 100
    brightness_state_topic: "premise/home/mantlelight/brightness"
    brightness_command_topic: "premise/command/home/mantlelight/brightness"
    on_command_type: 'brightness'