From 6c17d61bafecc8ebf07c09f75c9d2efcd8a34f3b Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Fri, 3 Nov 2023 20:00:16 +0100 Subject: [PATCH] set energy entities to HA-category diagnostic (metioned on discord) --- src/mqtt.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mqtt.cpp b/src/mqtt.cpp index 52331824f..d700f4f32 100644 --- a/src/mqtt.cpp +++ b/src/mqtt.cpp @@ -881,7 +881,6 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev break; case DeviceValueType::STRING: snprintf(topic, sizeof(topic), "text/%s", config_topic); // e.g. set_datetime, set_holiday, set_wwswitchtime - set_ha_classes = true; break; default: // plain old sensor @@ -1130,7 +1129,7 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev // add category "diagnostic" for system entities // config for writeable entities, like switches. diagnostic for read only sensors. - doc["ent_cat"] = (has_cmd) ? "config" : "diagnostic"; + doc["ent_cat"] = (has_cmd && !set_ha_classes) ? "config" : "diagnostic"; // add the dev json object to the end doc["dev"] = dev_json;