From 555b6c6750b39f64020465c0d826d010b693feed Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Mon, 11 Sep 2023 19:53:05 +0200 Subject: [PATCH] Fix: HASS exp_aft should be based on reachable threshold and poll interval --- src/MqttHandleHass.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MqttHandleHass.cpp b/src/MqttHandleHass.cpp index a2f38f0ea..9578daf55 100644 --- a/src/MqttHandleHass.cpp +++ b/src/MqttHandleHass.cpp @@ -134,7 +134,7 @@ void MqttHandleHassClass::publishField(std::shared_ptr inv, Ch createDeviceInfo(deviceObj, inv); if (Configuration.get().Mqtt_Hass_Expire) { - root["exp_aft"] = Hoymiles.getNumInverters() * Configuration.get().Mqtt_PublishInterval * 3; + root["exp_aft"] = Hoymiles.getNumInverters() * max(Hoymiles.PollInterval(), Configuration.get().Mqtt_PublishInterval) * inv->getReachableThreshold(); } if (devCls != 0) { root["dev_cla"] = devCls;