diff --git a/tasmota/tasmota_xsns_sensor/xsns_05_ds18x20.ino b/tasmota/tasmota_xsns_sensor/xsns_05_ds18x20.ino index d26e48ad8ea8..9302381d6900 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_05_ds18x20.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_05_ds18x20.ino @@ -483,6 +483,7 @@ void Ds18x20Name(uint8_t sensor) { } snprintf_P(DS18X20Data.name, sizeof(DS18X20Data.name), PSTR("%s%c%s"), DS18X20Data.name, IndexSeparator(), address); #elif defined(DS18x20_USE_ID_ALIAS) + sensor = ds18x20_sensor[sensor].index; if (ds18x20_sensor[sensor].alias[0] != '0') { if (isdigit(ds18x20_sensor[sensor].alias[0])) { snprintf_P(DS18X20Data.name, sizeof(DS18X20Data.name), PSTR("DS18Sens%c%d"), IndexSeparator(), atoi(ds18x20_sensor[sensor].alias)); diff --git a/tasmota/tasmota_xsns_sensor/xsns_05_esp32_ds18x20.ino b/tasmota/tasmota_xsns_sensor/xsns_05_esp32_ds18x20.ino index d7c0b6f5f3f8..d4b226ccdd77 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_05_esp32_ds18x20.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_05_esp32_ds18x20.ino @@ -227,6 +227,7 @@ void Ds18x20Name(uint8_t sensor) { } snprintf_P(DS18X20Data.name, sizeof(DS18X20Data.name), PSTR("%s%c%s"), DS18X20Data.name, IndexSeparator(), address); #elif defined(DS18x20_USE_ID_ALIAS) + sensor = ds18x20_sensor[sensor].index; if (ds18x20_sensor[sensor].alias[0] != '0') { if (isdigit(ds18x20_sensor[sensor].alias[0])) { snprintf_P(DS18X20Data.name, sizeof(DS18X20Data.name), PSTR("DS18Sens%c%d"), IndexSeparator(), atoi(ds18x20_sensor[sensor].alias));