From 0effe8246bdde095aff7294115454b6357c6790d Mon Sep 17 00:00:00 2001 From: jbouwh Date: Thu, 17 Jul 2025 06:19:51 +0000 Subject: [PATCH] Explain how mqtt sensors are influenced with `expire_after` option when a retained payload was used --- source/_integrations/binary_sensor.mqtt.markdown | 2 +- source/_integrations/sensor.mqtt.markdown | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/_integrations/binary_sensor.mqtt.markdown b/source/_integrations/binary_sensor.mqtt.markdown index 658c06c9db8..437e77bc2cd 100644 --- a/source/_integrations/binary_sensor.mqtt.markdown +++ b/source/_integrations/binary_sensor.mqtt.markdown @@ -145,7 +145,7 @@ entity_picture: required: false type: string expire_after: - description: If set, it defines the number of seconds after the sensor's state expires, if it's not updated. After expiry, the sensor's state becomes `unavailable`. Default the sensors state never expires. + description: If set, it defines the number of seconds after the sensor's state expires, if it's not updated. After expiry, the sensor's state becomes `unavailable`. Default the sensors state never expires. Note that when a sensor's value was sent retained to the MQTT broker, the last value sent will be replayed by the MQTT broker when Home Assistant restarts or is reloaded. As this could cause the sensor become available with an expired state it is not recommended to retain sensor's state payload at the MQTT broker. Home Assistant will store and restore the sensor's state for you and calculate the remaining time to retain the sensor's state before it becomes unavailable. required: false type: integer force_update: diff --git a/source/_integrations/sensor.mqtt.markdown b/source/_integrations/sensor.mqtt.markdown index 557883df6ae..064f639dc57 100644 --- a/source/_integrations/sensor.mqtt.markdown +++ b/source/_integrations/sensor.mqtt.markdown @@ -138,7 +138,7 @@ entity_picture: required: false type: string expire_after: - description: If set, it defines the number of seconds after the sensor's state expires, if it's not updated. After expiry, the sensor's state becomes `unavailable`. Default the sensors state never expires. + description: If set, it defines the number of seconds after the sensor's state expires, if it's not updated. After expiry, the sensor's state becomes `unavailable`. Default the sensors state never expires. Note that when a sensor's value was sent retained to the MQTT broker, the last value sent will be replayed by the MQTT broker when Home Assistant restarts or is reloaded. As this could cause the sensor become available with an expired state it is not recommended to retain sensor's state payload at the MQTT broker. Home Assistant will store and restore the sensor's state for you and calculate the remaining time to retain the sensor's state before it becomes unavailable. required: false type: integer default: 0