sync sensors and status to same entitiy in path, uniq_id, objdect_id

This commit is contained in:
MichaelDvP
2022-12-05 14:13:25 +01:00
parent 6f27253441
commit 739c007c95
3 changed files with 7 additions and 5 deletions

View File

@@ -451,7 +451,7 @@ void AnalogSensor::publish_values(const bool force) {
}
config["val_tpl"] = str;
snprintf(str, sizeof(str), "%s_analog_sensor_%s", Mqtt::basename().c_str(), sensor.name().c_str());
snprintf(str, sizeof(str), "%s_analogsensor_%d", Mqtt::basename().c_str(), sensor.gpio());
config["object_id"] = str;
config["uniq_id"] = str; // same as object_id