Coder Social home page Coder Social logo

MQTT states retained about esp32-mqtt-room HOT 3 CLOSED

jptrsn avatar jptrsn commented on August 23, 2024
MQTT states retained

from esp32-mqtt-room.

Comments (3)

jptrsn avatar jptrsn commented on August 23, 2024

Only the connection messages are retained - this is by design. When connected over MQTT, the module will set its LWT message. Your MQTT server should see the ESP32 has disconnected and publish the "DISCONNECTED" payload itself. If you're not seeing this happen, the problem likely lies in your MQTT server rather than in the module itself.

The purpose of retaining the message is to ensure that Home Assistant is aware of the connectivity state after a reset. There are no periodic publish events of connectivity - only on connect or disconnect. Thus, retention of the message payload is required in order for Home Assistant to understand the correct state at time of boot.

I am not able to reproduce this issue in my Home Assistant instance.

from esp32-mqtt-room.

emouawad avatar emouawad commented on August 23, 2024

Maybe what happened is that the mqtt server went down before those ESPs -
Later mqtt restarted and ESPs were still down

Can you confirm that in that case retained states no longer reflect the state of the ESPs

from esp32-mqtt-room.

jptrsn avatar jptrsn commented on August 23, 2024

You're correct, if the MQTT server goes down, the LWT message information will likely be lost. At that point, the retained states will not reflect the connectivity state of the ESPs. You'd need to reset them by publishing a null or empty payload with the retain flag.

from esp32-mqtt-room.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.