Separating the LWT state from the alarm state is needed to allow simple integration with home-assistant, as HA requires a constant string for representing "online" availability.
Separating the LWT to a separate topic also allows making the LWT messages Retained. This approach is consistent with the Tasmota devices' behavior. More specifically, it allows the alarm to announce its Online state when it starts, and even when HA is restarted after the alarm announced that it is online, it would still know about the correct state. An alternative approach can be to notify about the "online" state periodically.
Separating the LWT state from the alarm state is needed to allow simple integration with home-assistant, as HA requires a constant string for representing "online" availability.
Separating the LWT to a separate topic also allows making the LWT messages Retained. This approach is consistent with the Tasmota devices' behavior. More specifically, it allows the alarm to announce its Online state when it starts, and even when HA is restarted after the alarm announced that it is online, it would still know about the correct state. An alternative approach can be to notify about the "online" state periodically.