system entities moved to "diagnostic" category in HA

This commit is contained in:
pswid
2023-01-30 19:37:50 +01:00
parent b18da9064b
commit 997ced3938

View File

@@ -619,6 +619,7 @@ void Mqtt::ha_status() {
doc["pl_off"] = "offline"; doc["pl_off"] = "offline";
doc["stat_cla"] = "measurement"; doc["stat_cla"] = "measurement";
doc["dev_cla"] = "connectivity"; doc["dev_cla"] = "connectivity";
doc["ent_cat"] = "diagnostic";
// doc["avty_t"] = "~/status"; // commented out, as it causes errors in HA sometimes // doc["avty_t"] = "~/status"; // commented out, as it causes errors in HA sometimes
// doc["json_attr_t"] = "~/heartbeat"; // store also as HA attributes // doc["json_attr_t"] = "~/heartbeat"; // store also as HA attributes
@@ -1275,6 +1276,11 @@ void Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
} }
} }
// add category "diagnostic" for system entities
if (device_type == EMSdevice::DeviceType::SYSTEM) {
doc["ent_cat"] = "diagnostic";
}
// add the dev json object to the end // add the dev json object to the end
doc["dev"] = dev_json; doc["dev"] = dev_json;