Zigbee2MQTT and rollershutter

Hi,

I am moving from openhab 2 to openhab 4. During this change, I replaced all my rollershutter modules working on enocean to the same model but on zigbee.
I planned to used the homeassistant compatibility from zigbee2mqtt and openhab for easy setup.
I fact, it does not work out of the box because things are always offline.
Anotehr issue (for me) is that MQTT topics are using the IEEE address of the module. I prefer to use the friendly name of course (also because I use several other zigbee devices that can be replaced/moved, like bulbs or sensors).

I tried to use the MQTT thing directly, with partial success. Thing definition is like this :

UID: mqtt:topic:mosquitto:volet_cuisine
label: Volet Cuisine
thingTypeUID: mqtt:topic
configuration:
  payloadNotAvailable: '{"state":"offline"}'
  availabilityTopic: zigbee2mqtt/volet_cuisine/availability
  payloadAvailable: '{"state":"online"}'
bridgeUID: mqtt:broker:mosquitto
channels:
  - id: volet_cuisine_position
    channelTypeUID: mqtt:rollershutter
    label: Volet Cuisine Position
    configuration:
      commandTopic: zigbee2mqtt/volet_cuisine/set/position
      stop: STOP
      stateTopic: zigbee2mqtt/volet_cuisine/position
      off: "100.0"
      on: "0.0"

Why partial success ? Because the STOP command cannot be handled through the position topic.

So I edited the thing definition :

UID: mqtt:topic:mosquitto:volet_cuisine
label: Volet Cuisine
thingTypeUID: mqtt:topic
configuration:
  payloadNotAvailable: '{"state":"offline"}'
  availabilityTopic: zigbee2mqtt/volet_cuisine/availability
  payloadAvailable: '{"state":"online"}'
bridgeUID: mqtt:broker:mosquitto
channels:
  - id: volet_cuisine_position
    channelTypeUID: mqtt:rollershutter
    label: Volet Cuisine Position
    configuration:
      commandTopic: zigbee2mqtt/volet_cuisine/set/position_proxy
      stop: STOP
      stateTopic: zigbee2mqtt/volet_cuisine/position
      off: "100.0"
      on: "0.0"

Then I use NodeRED to convert the command if it catches a “STOP” and send to correct topic.

Easy, but this setup relies on 4 pieces of software : OpenHAB, Mosquitto, Z2M and NodeRED

It works, but do you think I can avoid the NodeRED part ?
I already tried formatBeforePublish, but it is not supported on rollershutter.

You could create an OH Rule to do this interception part. But because it’s a different topic for the STOP you won’t be able to configure this all in the one Thing Channel.

Another alternative is to create a separate Channel and Item for STOP.