mirror of
https://github.com/tbnobody/OpenDTU.git
synced 2026-01-06 04:44:50 +01:00
Fix #589: MQTT channel assignment in homeassistant config [unique_id and name] was wrong
This commit is contained in:
@@ -117,13 +117,13 @@ void MqttHandleHassClass::publishField(std::shared_ptr<InverterAbstract> inv, Ch
|
||||
if (type != TYPE_DC) {
|
||||
name = String(inv->name()) + " " + fieldName;
|
||||
} else {
|
||||
name = String(inv->name()) + " CH" + String(channel) + " " + fieldName;
|
||||
name = String(inv->name()) + " CH" + chanNum + " " + fieldName;
|
||||
}
|
||||
|
||||
DynamicJsonDocument root(1024);
|
||||
root[F("name")] = name;
|
||||
root[F("stat_t")] = stateTopic;
|
||||
root[F("uniq_id")] = serial + "_ch" + String(channel) + "_" + fieldName;
|
||||
root[F("uniq_id")] = serial + "_ch" + chanNum + "_" + fieldName;
|
||||
|
||||
String unit_of_measure = inv->Statistics()->getChannelFieldUnit(type, channel, fieldType.fieldId);
|
||||
if (unit_of_measure != "") {
|
||||
|
||||
Reference in New Issue
Block a user