BREAKING CHANGE: Home Assistant Auto Discovery to new naming scheme
Please Upgrade to HASS 2023.8 or greater. Thanks to @LennartF22 for the first implementation
This commit is contained in:
parent
17e92fc5eb
commit
71d1b3b846
@ -115,9 +115,9 @@ void MqttHandleHassClass::publishField(std::shared_ptr<InverterAbstract> inv, Ch
|
|||||||
|
|
||||||
String name;
|
String name;
|
||||||
if (type != TYPE_DC) {
|
if (type != TYPE_DC) {
|
||||||
name = String(inv->name()) + " " + fieldName;
|
name = fieldName;
|
||||||
} else {
|
} else {
|
||||||
name = String(inv->name()) + " CH" + chanNum + " " + fieldName;
|
name = "CH" + chanNum + " " + fieldName;
|
||||||
}
|
}
|
||||||
|
|
||||||
DynamicJsonDocument root(1024);
|
DynamicJsonDocument root(1024);
|
||||||
@ -166,7 +166,7 @@ void MqttHandleHassClass::publishInverterButton(std::shared_ptr<InverterAbstract
|
|||||||
String cmdTopic = MqttSettings.getPrefix() + serial + "/" + subTopic;
|
String cmdTopic = MqttSettings.getPrefix() + serial + "/" + subTopic;
|
||||||
|
|
||||||
DynamicJsonDocument root(1024);
|
DynamicJsonDocument root(1024);
|
||||||
root["name"] = String(inv->name()) + " " + caption;
|
root["name"] = caption;
|
||||||
root["uniq_id"] = serial + "_" + buttonId;
|
root["uniq_id"] = serial + "_" + buttonId;
|
||||||
if (strcmp(icon, "")) {
|
if (strcmp(icon, "")) {
|
||||||
root["ic"] = icon;
|
root["ic"] = icon;
|
||||||
@ -205,7 +205,7 @@ void MqttHandleHassClass::publishInverterNumber(
|
|||||||
String statTopic = MqttSettings.getPrefix() + serial + "/" + stateTopic;
|
String statTopic = MqttSettings.getPrefix() + serial + "/" + stateTopic;
|
||||||
|
|
||||||
DynamicJsonDocument root(1024);
|
DynamicJsonDocument root(1024);
|
||||||
root["name"] = String(inv->name()) + " " + caption;
|
root["name"] = caption;
|
||||||
root["uniq_id"] = serial + "_" + buttonId;
|
root["uniq_id"] = serial + "_" + buttonId;
|
||||||
if (strcmp(icon, "")) {
|
if (strcmp(icon, "")) {
|
||||||
root["ic"] = icon;
|
root["ic"] = icon;
|
||||||
@ -240,7 +240,7 @@ void MqttHandleHassClass::publishInverterBinarySensor(std::shared_ptr<InverterAb
|
|||||||
String statTopic = MqttSettings.getPrefix() + serial + "/" + subTopic;
|
String statTopic = MqttSettings.getPrefix() + serial + "/" + subTopic;
|
||||||
|
|
||||||
DynamicJsonDocument root(1024);
|
DynamicJsonDocument root(1024);
|
||||||
root["name"] = String(inv->name()) + " " + caption;
|
root["name"] = caption;
|
||||||
root["uniq_id"] = serial + "_" + sensorId;
|
root["uniq_id"] = serial + "_" + sensorId;
|
||||||
root["stat_t"] = statTopic;
|
root["stat_t"] = statTopic;
|
||||||
root["pl_on"] = payload_on;
|
root["pl_on"] = payload_on;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user