diff --git a/main/gatewayRTL_433.cpp b/main/gatewayRTL_433.cpp index f85eacd..97d37e2 100644 --- a/main/gatewayRTL_433.cpp +++ b/main/gatewayRTL_433.cpp @@ -303,6 +303,7 @@ void rtl_433_Callback(char* message) { } String topic = subjectRTL_433toMQTT; String model = RFrtl_433_ESPdata["model"]; + model.replace("/", "_"); // Some rtl_devices have / in the model string String type = RFrtl_433_ESPdata["type"]; String uniqueid; @@ -310,10 +311,15 @@ void rtl_433_Callback(char* message) { size_t numRows = sizeof(naming_keys) / sizeof(naming_keys[0]); for (int i = 0; i < numRows; i++) { if (RFrtl_433_ESPdata.containsKey(naming_keys[i])) { + String namingValue = RFrtl_433_ESPdata[naming_keys[i]].as(); + if (strcmp(naming_keys[i], "model") == 0) + namingValue = model; + else if (strcmp(naming_keys[i], "type") == 0) + namingValue = type; if (uniqueid == 0) { - uniqueid = RFrtl_433_ESPdata[naming_keys[i]].as(); // Start of the unique id with the first key + uniqueid = namingValue; // Start of the unique id with the first key } else { - uniqueid = uniqueid + "/" + RFrtl_433_ESPdata[naming_keys[i]].as(); // Following keys + uniqueid = uniqueid + "/" + namingValue; // Following keys } } } diff --git a/platformio.ini b/platformio.ini index e34e7a7..a7ed10d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -156,7 +156,7 @@ smartrc-cc1101-driver-lib = https://github.com/LSatan/SmartRC-CC1101-Driver-Lib/ stl = https://github.com/mike-matera/ArduinoSTL/archive/7411816.zip shtc3 = https://github.com/sparkfun/SparkFun_SHTC3_Arduino_Library/archive/671ef7e.zip somfy_remote=Somfy_Remote_Lib@0.3.0 -rtl_433_ESP = https://github.com/NorthernMan54/rtl_433_ESP/archive/v0.6.1.zip +rtl_433_ESP = https://github.com/NorthernMan54/rtl_433_ESP/archive/v0.6.2.zip emodbus = miq19/eModbus@1.0.0 gfSunInverter = https://github.com/BlackSmith/GFSunInverter/archive/v1.0.1.zip decoder = https://github.com/theengs/decoder/archive/development.zip