add back obj_id for HA test

This commit is contained in:
MichaelDvP
2025-10-14 08:30:52 +02:00
parent 12b06aa657
commit 9d04058984
6 changed files with 41 additions and 32 deletions

View File

@@ -205,8 +205,9 @@ void Shower::create_ha_discovery() {
} else {
snprintf(str, sizeof(str), "shower_active"); // v3.4 compatible
}
doc["uniq_id"] = str;
doc["default_entity_id"] = (std::string) "binary_sensor." + str;
doc["uniq_id"] = str;
doc["obj_id"] = str;
doc["def_ent_id"] = (std::string) "binary_sensor." + str;
snprintf(stat_t, sizeof(stat_t), "%s/shower_active", Mqtt::base().c_str());
doc["stat_t"] = stat_t;
@@ -223,8 +224,9 @@ void Shower::create_ha_discovery() {
snprintf(str, sizeof(str), "%s_shower_duration", Mqtt::basename().c_str());
doc["uniq_id"] = str;
doc["default_entity_id"] = (std::string) "sensor." + str;
doc["uniq_id"] = str;
doc["obj_id"] = str;
doc["def_ent_id"] = (std::string) "sensor." + str;
snprintf(stat_t, sizeof(stat_t), "%s/shower_data", Mqtt::base().c_str());
doc["stat_t"] = stat_t;