Hi steef84,
Perhaps you can read my last post in this thread: https://community.home-assistant.io/t/help-with-mqtt-templating-from-domoticz/8375/35
The HA name declared is based on the domoticz one and finally HA will “slugify” this name, this final name can be used in automations, so it’s “name” based.
For example if you have a switch “My Switch” it’s displayed “My Switch (dz)” in HA (I’ve add (dz) but this can be changed) and the final switch name will be switch.my_switch_dz