MQTT Birth and Last will
Home Assistant’s MQTT integration supports so-called Birth and Last Will and Testament (LWT) messages. The former is used to send a message after the service has started, and the latter is used to notify other clients about a disconnected client. Please note that the LWT message will be sent both in case of a clean (e.g. Home Assistant shutting down) and in case of an unclean (e.g. Home Assistant crashing or losing its network connection) disconnect.
By default, Home Assistant sends online
and offline
to homeassistant/status
.
To customize the MQTT Birth and Last Will messages, add the following section to your configuration.yaml
file:
# Example configuration.yaml entry
mqtt:
birth_message:
topic: 'hass/status'
payload: 'online'
will_message:
topic: 'hass/status'
payload: 'offline'