🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    [MQTT-Core] Support for RETAIN

    Features Wish List
    4
    6
    10.5k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      marcvl
      last edited by

      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.

      1 Reply Last reply Reply Quote 4
      • M
        marcvl
        last edited by

        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.

        1 Reply Last reply Reply Quote 1
        • world101W
          world101
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • world101W
            world101
            last edited by

            https://community.m5stack.com/topic/1595/mqtt-subscribes-on-uiflow

            1 Reply Last reply Reply Quote 1
            • S
              saiaman01
              last edited by

              I need it too, in UIFlow.

              1 Reply Last reply Reply Quote 3
              • F
                falbriard
                last edited by

                The MQTT Adafruit forum told me: "An automatic process in order to synchronize the subscriber without any data loss?
                You can - please see this documentation about retained values here:
                [https://io.adafruit.com/api/docs/mqtt.html#retained-values](link url) “

                Checking the Github I've found an open issue about support of the MQTT retain Flag in M5 UIFlow code. See: [https://github.com/m5stack/UIFlow-Code/issues/1](link url)

                My PAHO subscriber client currently displays a zero value in the retain flag returned from the M5 publisher and Adafruit broker. Do you know the status of this issue?

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post