MQTT birth and will messages are published by default (#13931)

This commit is contained in:
Erik Montnemery 2020-07-14 17:15:59 +02:00 committed by GitHub
parent e158eaed8b
commit 9e5236ffda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,9 +4,11 @@ description: "Instructions on how to setup MQTT birth and last will messages wit
logo: mqtt.png logo: 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. 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 Asisstant shutting down) and in case of an unclean (e.g. Home Assistant crashing or losing its network connection) disconnect.
To integrate MQTT Birth and Last Will messages into Home Assistant, add the following section to your `configuration.yaml` file: 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:
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
@ -26,12 +28,14 @@ birth_message:
type: list type: list
keys: keys:
topic: topic:
description: The MQTT topic to publish the message. description: The MQTT topic to publish the message. Set to the empty string, `""`, to disable publishing a birth message.
required: true required: false
default: homeassistant/status
type: string type: string
payload: payload:
description: The message content. description: The message content.
required: true required: false
default: online
type: string type: string
qos: qos:
description: The maximum QoS level of the topic. description: The maximum QoS level of the topic.
@ -44,17 +48,19 @@ birth_message:
default: false default: false
type: boolean type: boolean
will_message: will_message:
description: Will Message description: Will Message. Set to the empty string, `""`, to disable publishing a will message.
required: false required: false
type: list type: list
keys: keys:
topic: topic:
description: The MQTT topic to publish the message. description: The MQTT topic to publish the message.
required: true required: false
default: homeassistant/status
type: string type: string
payload: payload:
description: The message content. description: The message content.
required: true required: false
default: offline
type: string type: string
qos: qos:
description: The maximum QoS level of the topic. description: The maximum QoS level of the topic.