Skip to content

Bug: MQTT messages are not sent with retain flag although HASS.agent is set to do so #128

Closed

Description

@TarcisioMenezes

Describe the bug
Although I have marked the option "retain flag" for MQTT, it seems it doesn't work. Checked with some MQTT clients and I don't see the sensor messages being sent as retained.
I can confirm that If I restart my Home Assistant server, all the sensors from Hass.agent will change to "Unknown" until the MQTT broker gets another updated message. (Occurs for both Hass.agent and Satellite Service sensors)

Expected behavior
I was expecting the #/state topic messages to be sent with a retain flag then Home Assistant would show the last sensors states after restart.

For instance, if I inspect the topic "homeassistant/sensor/WINDOWS_10/WINDOWS_10_lastboot/state" there is not retain flag, therefore the state of the entity inside Home Assistant will be "unknown" until I either restart Hass.agent, Windows or the entity changes its state (which can take days for some entities. E.g. Last boot entity).

Screenshots
image

image

image

Misc info (please complete the following information):

  • Windows build (ideally screenshot/info of winver.exe output): Windows 10 Version 21H2 (OS Build 19044.1826)
  • Windows' UI language: English
  • HASS.Agent version: 2022.12.0

Please check what's applicable (multiple answers possible):

  • Installed via installer
  • Installed manually
  • Problem occurs in HASS.Agent
  • Problem occurs in Satellite Service

Activity

  1. LAB02-Admin commented on Aug 1, 2022

    @LAB02-Admin
    Member

    Thanks for the extensive report, I'll look into it!

    [hassagent-128]

  2. changed the title [-]MQTT messages are not sent with retain flag although HASS.agent is set to do so. [/-] [+]Bug: MQTT messages are not sent with retain flag although HASS.agent is set to do so[/+] on Aug 1, 2022
  3. self-assigned this
    on Aug 1, 2022
  4. LAB02-Admin commented on Aug 12, 2022

    @LAB02-Admin
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions