home-assistant.io/source/_docs/mqtt/birth_will.markdown
Alok Saboo 1aca7b08cf Misc fixes: e.g. -> e.g., and proper case for Home Assistant (#4942)
* e.g. to e.g., and proper case for Home Assistant

* Instructions how to -> Instructions on how to
2018-03-17 20:20:37 +01:00

1.5 KiB

layout, title, description, date, sidebar, comments, sharing, footer, logo
layout title description date sidebar comments sharing footer logo
page MQTT Birth and Last will Instructions on how to setup MQTT birth and last will messages within Home Assistant. 2015-08-07 18:00 true false true true mqtt.png

MQTT 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 an ungracefully disconnected client.

To integrate MQTT Birth and Last Will messages into Home Assistant, 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'

Configuration variables:

  • birth_message (Optional):
    • topic (Required): The MQTT topic to publish the message.
    • payload (Required): The message content.
    • qos (Optional): The maximum QoS level of the topic. Default is 0.
    • retain (Optional): If the published message should have the retain flag on or not. Defaults to True.
  • will_message (Optional):
    • topic (Required): The MQTT topic to publish the message.
    • payload (Required): The message content.
    • qos (Optional): The maximum QoS level of the topic. Default is 0.
    • retain (Optional): If the published message should have the retain flag on or not. Defaults to True.