Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. General Discussion
  3. [SOLVED] Strange behavior on MQTT Gateway Reset

[SOLVED] Strange behavior on MQTT Gateway Reset

Scheduled Pinned Locked Moved General Discussion
13 Posts 4 Posters 1.7k Views 4 Watching
  • 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.
  • X Offline
    X Offline
    xefil
    wrote on last edited by
    #4

    Hello @electrik and @Yveaux ; thanks for the answers.
    It's still not totally clear who is retaining those messages.
    It's a mosquitto issue, an issue from the Controller (OpenHAB2 or HomeAssistant) or a driver issue from MySensors?
    BTW, the last case, having updated the MQTT Mysensors gateway as well as the affected sensor leaf, I would discard this last option.
    I need to understand as well how to read the debug messages from mosquitto. It doesn't contain the message value and have no idea if the retain flag is set or not :-) I know that's a little off topic :-)
    Any further help is appreciated!

    Happy Holidays!!

    Simon

    YveauxY 1 Reply Last reply
    0
    • X xefil

      Hello @electrik and @Yveaux ; thanks for the answers.
      It's still not totally clear who is retaining those messages.
      It's a mosquitto issue, an issue from the Controller (OpenHAB2 or HomeAssistant) or a driver issue from MySensors?
      BTW, the last case, having updated the MQTT Mysensors gateway as well as the affected sensor leaf, I would discard this last option.
      I need to understand as well how to read the debug messages from mosquitto. It doesn't contain the message value and have no idea if the retain flag is set or not :-) I know that's a little off topic :-)
      Any further help is appreciated!

      Happy Holidays!!

      Simon

      YveauxY Offline
      YveauxY Offline
      Yveaux
      Mod
      wrote on last edited by
      #5

      @xefil said in Strange behavior on MQTT Gateway Reset:

      driver issue from MySensors

      MySensors Sensors, Repeaters and Gateways do not remember or cache any messages.
      If messages are retained somehow, this is certainly not caused by the MySensors network.

      http://yveaux.blogspot.nl

      1 Reply Last reply
      0
      • electrikE Offline
        electrikE Offline
        electrik
        wrote on last edited by
        #6

        it is not an issue, it is a feature in MQTT.
        This retain flag is set by the sender, to allow devices that become online after a device has changed status, obtain the latest status.
        So probably that can be set in openHab or HomeAssistant

        1 Reply Last reply
        0
        • mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by
          #7

          MySensors does set the retain message on I_BATTERY_LEVEL messages (but no other messages). Such messages are not present in the above debug log, but I thought I'd add a note here for completeness.

          Discussion on extending the retain flag to more message types: https://github.com/mysensors/MySensors/issues/1026

          electrikE 1 Reply Last reply
          0
          • X Offline
            X Offline
            xefil
            wrote on last edited by
            #8

            Ok, thanks all. Maybe it's a flag I've set on HomeAssistant on some variables and to delete them, it's not sufficient, reading the doc, to restart the mosquitto service. I'll look how delete message AND retain flag.
            Thanks all!

            Simon

            1 Reply Last reply
            1
            • mfalkviddM mfalkvidd

              MySensors does set the retain message on I_BATTERY_LEVEL messages (but no other messages). Such messages are not present in the above debug log, but I thought I'd add a note here for completeness.

              Discussion on extending the retain flag to more message types: https://github.com/mysensors/MySensors/issues/1026

              electrikE Offline
              electrikE Offline
              electrik
              wrote on last edited by
              #9

              @mfalkvidd said in Strange behavior on MQTT Gateway Reset:

              MySensors does set the retain message on I_BATTERY_LEVEL messages (but no other messages)

              If the define MY_MQTT_CLIENT_PUBLISH_RETAIN is used, all messages are retained. But that is not active by default, so probably not used in this case. Just to be complete ;-)

              X 1 Reply Last reply
              1
              • electrikE electrik

                @mfalkvidd said in Strange behavior on MQTT Gateway Reset:

                MySensors does set the retain message on I_BATTERY_LEVEL messages (but no other messages)

                If the define MY_MQTT_CLIENT_PUBLISH_RETAIN is used, all messages are retained. But that is not active by default, so probably not used in this case. Just to be complete ;-)

                X Offline
                X Offline
                xefil
                wrote on last edited by
                #10

                @electrik said in Strange behavior on MQTT Gateway Reset:

                @mfalkvidd said in Strange behavior on MQTT Gateway Reset:

                MySensors does set the retain message on I_BATTERY_LEVEL messages (but no other messages)

                If the define MY_MQTT_CLIENT_PUBLISH_RETAIN is used, all messages are retained. But that is not active by default, so probably not used in this case. Just to be complete ;-)

                Thanks!
                Well, I've succesfully deleted the retained messages via cli using mosquitto command:

                mosquitto_pub -t <my_retained_topic> -r -n

                Maybe it was set by the controller, then removed, but mqtt was retaining it.

                Simon

                1 Reply Last reply
                1
                • electrikE Offline
                  electrikE Offline
                  electrik
                  wrote on last edited by
                  #11

                  Great thanks for your feedback!

                  X 1 Reply Last reply
                  0
                  • electrikE electrik

                    Great thanks for your feedback!

                    X Offline
                    X Offline
                    xefil
                    wrote on last edited by
                    #12

                    @electrik said in Strange behavior on MQTT Gateway Reset:

                    Great thanks for your feedback!

                    Thanks to you for the support and hints ;-)

                    I wish you a happy new year!

                    Simon

                    electrikE 1 Reply Last reply
                    0
                    • X xefil

                      @electrik said in Strange behavior on MQTT Gateway Reset:

                      Great thanks for your feedback!

                      Thanks to you for the support and hints ;-)

                      I wish you a happy new year!

                      Simon

                      electrikE Offline
                      electrikE Offline
                      electrik
                      wrote on last edited by
                      #13

                      @xefil thank you, happy new year!

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      23

                      Online

                      11.7k

                      Users

                      11.2k

                      Topics

                      113.1k

                      Posts


                      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • MySensors
                      • OpenHardware.io
                      • Categories
                      • Recent
                      • Tags
                      • Popular