diff --git a/tasmota/xdrv_23_zigbee_2_devices.ino b/tasmota/xdrv_23_zigbee_2_devices.ino index 9bdd512d3..a7bd2adee 100644 --- a/tasmota/xdrv_23_zigbee_2_devices.ino +++ b/tasmota/xdrv_23_zigbee_2_devices.ino @@ -818,8 +818,8 @@ void CopyJsonVariant(JsonObject &to, const String &key, const JsonVariant &val) to.remove(key); // force remove to have metadata like LinkQuality at the end if (val.is()) { - String sval = val.as(); // force a copy of the String value, avoiding crash - to.set(key, sval); + const char * sval = val.as(); // using char* forces a copy, and also captures 'null' values + to.set(key, (char*) sval); } else if (val.is()) { JsonArray &nested_arr = to.createNestedArray(key); CopyJsonArray(nested_arr, val.as()); // deep copy