From 944aa861f88d05ab881eebbe02182e5dba0157b8 Mon Sep 17 00:00:00 2001 From: pswid <78219494+pswid@users.noreply.github.com> Date: Sun, 12 Mar 2023 21:24:03 +0100 Subject: [PATCH] make 'eco+ switch_off' enity unique in v.3.4 format HA ignores characters '+' in uniq_id/obj_id, so to make the entity 'eco+ switch_off' different from 'eco switch_off', it will be renamed to 'eco2 switch_off'. --- src/mqtt.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mqtt.cpp b/src/mqtt.cpp index 65f47d54d..22356b6da 100644 --- a/src/mqtt.cpp +++ b/src/mqtt.cpp @@ -1010,6 +1010,7 @@ void Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev char uniq_s[60]; strlcpy(uniq_s, en_name, sizeof(uniq_s)); Helpers::replace_char(uniq_s, ' ', '_'); + Helpers::replace_char(uniq_s, '+', '2'); //changes 'eco+_switch_off' to 'eco2_switch_off' (HA ignores '+') if (has_tag) { snprintf(uniq_id, sizeof(uniq_id), "%s_%s_%s", device_name, DeviceValue::DeviceValueTAG_s[tag][0], Helpers::toLower(uniq_s).c_str()); } else {