Fix: HASS exp_aft should be based on reachable threshold and poll interval

This commit is contained in:
Thomas Basler 2023-09-11 19:53:05 +02:00
parent 55e98bc068
commit 555b6c6750

View File

@ -134,7 +134,7 @@ void MqttHandleHassClass::publishField(std::shared_ptr<InverterAbstract> 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<uint32_t>(Hoymiles.PollInterval(), Configuration.get().Mqtt_PublishInterval) * inv->getReachableThreshold();
}
if (devCls != 0) {
root["dev_cla"] = devCls;