Thank you for your all answers. I have made some tests and even if I don't have results for the moment, the best solution for me seems using (in accordance with @bgunnarb): MY_MQTT_PUBLISH_TOPIC_PREFIX ESP-topic/ESP-number Yes, it's can be a good idea @mfalkvidd