HASS.Agent icon indicating copy to clipboard operation
HASS.Agent copied to clipboard

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

Open TarcisioMenezes opened this issue 3 years ago • 1 comments

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):

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

TarcisioMenezes avatar Jul 25 '22 05:07 TarcisioMenezes

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

[hassagent-128]

LAB02-Admin avatar Aug 01 '22 12:08 LAB02-Admin

(hopefully) fixed in the latest beta: https://github.com/LAB02-Research/HASS.Agent/releases/tag/2022.13.0-beta2

LAB02-Admin avatar Aug 12 '22 15:08 LAB02-Admin