MQTT Last Will and Testament not honoring the retain flag for online status

  • I am using various Shelly devices in my motor home that are AC powered off of the house inverter. I have one device that controls charging of the house battery bank off of a shore power input.

    For the firmware I have: 20200827-070450/v1.8.3@4a8bc427 which is reported to be the current version.

    Using MQTT I subscribe to the online flag and receive the following message when the device comes online:

    {"topic":"shellies/AcFeed-120V/online","payload":"true","qos":2,"retain":false,"_msgid":"f130e164.f3a0e"}

    However when the device is disconnected from shore power I receive the Last Will and Testament message of:

    {"topic":"shellies/AcFeed-120V/online","payload":"false","qos":0,"retain":false,"_msgid":"468fdf00.0e854"}

    In the configuration for MQTT I have the following settings:

    pasted-from-clipboard.png

    As you can see from the above detail the online status message is not retained by the MQTT broker. Which leads to confusion in determining if the device is online, as the last voltage and power setting values are retained, even though the device is offline.

    You have latest version of your device!

  • This is still an issue on Shelly 2.5 version 20210115-103025/v1.9.4@e2732e05.

    The 'online' payload is not being sent with the retain flag when it certainly should be in all cases, but particularly when retain is selected.