[MQTT-Core] Support for RETAIN



  • RETAIN is an essential feature of any MQTT implementation. Without RETAIN, device information can get lost when a service like Home Assistant who uses MQTT subscription to get device info, has an issue. For instance, when Core sends out an MQTT discovery message (essential for Home Assistant auto-discovery) the RETAIN flag ensures that the device is still available after Home Assistant reboots.



  • Hi: Is there an update to this request? It seems to me that this would be very easy fix ... just adding the 'retain flag' parameter to mqtt messages. This is a very essential feature for mqtt auto-discovery with remote clients (such as Home Assistant). Without retain, Home Assistant loses all the configuration details about the M5Stack device after every HA reboot. The M5stack becomes 'unavailable' to HA and it's only after rebooting M5Stack that the device becomes available again.



  • What all have you tried and are you using uiFlow or Arduino?

    I'm pretty sure they implemented it a while back, as I originally requested it more than a year ago. I haven't tested it recently, but I believe it was working before. Let me do some digging and I'll see what I can come up with.