Customize MQTT topics

  • Hi:

    Is there a way to customize the topics that Shelly devices subscribe to or listen to? I have 2 shelly devices, one acting as a switch, and one acting as a relay. I'd like for them to communicate over MQTT without having to write an automation script or using any other 3rd party software (other than Mosquitto)

    Thanks,
    Marc

  • Yes, you can always accomplish this with calling the API directly, but I'm trying to avoid that. I want to standardize all device communication (not just between Shellies, but also with others like Sonoff) on MQTT.

    After more research I think the best way to accomplish device to device communication over MQTT, is to flash the Shelly devices with ESPHome and then configure MQTT topics in YAML.

  • Just to close this topic. I did flash my Shelly devices with ESPHome and I've been very happy with the MQTT support. The Shelly devices are auto-discovered by HA (without the need for any special script), and you have full control over the topic structure through your ESPHome YAML configuration.