logo elektroda
logo elektroda
X
logo elektroda

openBeken MQTT: Configuration option to get persistent messages on broker available

maxen0815 2349 5
ADVERTISEMENT
  • #1 20628779
    maxen0815
    Level 3  

    I'm using a TUYA-BK7231N/CBU Wi-Fi door sensor like here: https://www.elektroda.com/rtvforum/topic3982902.html#20611799

    Flashed openBeken and configured all settings for Wi-Fi & MQTT - Data publish works fine.
    BUT, since my subscribing client is not always online I'd like to set the QoS to 1 and some flat lie "retain" or "cleansession" to get the data stored on my MQTT broker until the subscriber comes online again.

    Any ideas how to do this on openBeken firmware?

    Thanks in advance
  • ADVERTISEMENT
  • #2 20629499
    p.kaczmarek2
    Moderator Smart Home

    Hello, are you using it with Home Assistant?

    If you are using it with Home Assistant, then the recommended solution is to disable the availability topic so the state of the door is retained:
    openBeken MQTT: Configuration option to get persistent messages on broker available
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20629545
    maxen0815
    Level 3  
    Thanks for your reply!

    No I'm not using Home Assistant.
    The openbeken device just sends an MQTT message to a mosquito broker. The client is running on a smartphone which is not always online.
    So I'd like to store the messages on the broker until my client comes online to collect them.

    Best regards
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #5 20629996
    maxen0815
    Level 3  

    Thanks for this hint - brings me at least one step further!
    With setting this flag, at least the last message stays on the broker side, even if the client goes offline. So I can't see the whole history, but at least the latest message. šŸ‘
  • #6 21352944
    daherbst85
    Level 4  
    I had the same issue.
    (Mosquitto broker on separate server HA)

    Setting the retain flag removing any availability flags in the HA yaml (both together!) fixed it.
ADVERTISEMENT