Use of postfixes

Hi all,

First of all thanks to @koenk and the whole team for this great project !

I recently added zigbee2mqtt and my first zigbee device (GLEDOPTO RGB+CCT Led controller) to my home system, and all without any (major) problems !

However I find that integrating it in my “HomeControl” (node-red with mqtt, Google, Ikea Tradfri, tasmota,…) is not as easy as it could be. The main problem herein is the inconsistent use of a ‘postfix’.

Some explanation on my “HomeControl” (Trying to be as short as possible ;-)):

Since I am a professional software engineer, I make heavily use of function nodes in node-red, and modified the node-red configuration in such a way that I can import my own library functions for use in the node-red function nodes.
To be able to use a ‘generic’ function library I convert all incoming messages to my own ‘standard’ message format, process the data and than convert the result back to the required output format (mostly by library functions too.)

Until now this worked flawlessly for all protocols, but with zigbee2mqtt I run into some major problems.
This is because to convert messages to my own message format I decompose/analyse the ‘topic’, but I found that with zigbee2mqtt the topic is inconsistent and hard to analyze/convert because it sometimes uses a postfix, but not always or even has the postfix not as last.

i.e. you have:
“zigbee2mqtt/[FRIENDLY_NAME]/set
“zigbee2mqtt/[FRIENDLY_NAME]/get
but also:
"zigbee2mqtt/[FRIENDLY_NAME] (no postfix !)
or even:
zigbee2mqtt/[FRIENDLY_NAME]/set/state (a value name following the postfix !)

Maybe take a look at tasmota, which always uses a prefix or a postfix if configured that way.
(standardizing is a good thing if done well).

Looking for this problem on the internet I also ran into this issue on github: If (by accident) use a ‘postfix’ which seems to be related to the same problem.

If someone on the project is willing to look into this they can contact me for more information and (if I can find the time) I’m willing to contribute to a solution.

p.s. An option to configure zigbee2mqtt to use ‘prefix’ instead of ‘postfix’ would be nice too.