mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
system entities moved to "diagnostic" category in HA
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user