diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter
index ac6dc5a..a801aac 100644
--- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter
+++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter
@@ -759,6 +759,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -815,10 +819,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** Commands to trigger a Node to allow a new Administrator to commission it. */
@@ -2390,8 +2406,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter
index 93807b6..1f165ee 100644
--- a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter
+++ b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter
@@ -712,6 +712,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -768,10 +772,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2103,8 +2119,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
index 044a512..0e24f10 100644
--- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
+++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
@@ -1697,6 +1697,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1753,10 +1757,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -7380,12 +7396,14 @@
     callback attribute acceptedCommandList;
     callback attribute eventList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
     handle command TimeSnapshotResponse;
+    handle command PayloadTestRequest;
+    handle command PayloadTestResponse;
   }
 
   server cluster SoftwareDiagnostics {
diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
index 87d3e85..cb3e8ec 100644
--- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
+++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
@@ -2863,6 +2863,22 @@
               "source": "server",
               "isIncoming": 0,
               "isEnabled": 1
+            },
+            {
+              "name": "PayloadTestRequest",
+              "code": 3,
+              "mfgCode": null,
+              "source": "client",
+              "isIncoming": 1,
+              "isEnabled": 1
+            },
+            {
+              "name": "PayloadTestResponse",
+              "code": 4,
+              "mfgCode": null,
+              "source": "server",
+              "isIncoming": 0,
+              "isEnabled": 1
             }
           ],
           "attributes": [
diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
index 7794726..69c7e8d 100644
--- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
+++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
@@ -1577,6 +1577,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1633,10 +1637,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -6071,12 +6087,14 @@
     callback attribute acceptedCommandList;
     callback attribute eventList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
     handle command TimeSnapshotResponse;
+    handle command PayloadTestRequest;
+    handle command PayloadTestResponse;
   }
 
   server cluster SoftwareDiagnostics {
diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap
index 2f7a83e..2d64015 100644
--- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap
+++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap
@@ -2464,6 +2464,22 @@
               "source": "server",
               "isIncoming": 0,
               "isEnabled": 1
+            },
+            {
+              "name": "PayloadTestRequest",
+              "code": 3,
+              "mfgCode": null,
+              "source": "client",
+              "isIncoming": 1,
+              "isEnabled": 1
+            },
+            {
+              "name": "PayloadTestResponse",
+              "code": 4,
+              "mfgCode": null,
+              "source": "server",
+              "isIncoming": 0,
+              "isEnabled": 1
             }
           ],
           "attributes": [
diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter
index 55712fe..a8b3e69 100644
--- a/examples/bridge-app/bridge-common/bridge-app.matter
+++ b/examples/bridge-app/bridge-common/bridge-app.matter
@@ -1162,6 +1162,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1218,10 +1222,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2049,8 +2065,8 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter
index bb412cc..2dce5e8 100644
--- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter
+++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter
@@ -935,6 +935,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -991,10 +995,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1753,8 +1769,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter
index d263483..554cdfa 100644
--- a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter
+++ b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter
@@ -759,6 +759,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -815,10 +819,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1443,8 +1459,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter
index a06d523..734ed03 100644
--- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter
+++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter
@@ -682,6 +682,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -738,10 +742,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** Commands to trigger a Node to allow a new Administrator to commission it. */
@@ -2298,8 +2314,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter
index ebfb6e5..00938a4 100644
--- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter
+++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter
@@ -820,6 +820,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -876,10 +880,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1965,8 +1981,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter
index c2c74d4..c5c71d5 100644
--- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter
+++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter
@@ -842,6 +842,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -898,10 +902,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1992,8 +2008,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter
index dfb0d2c..8bdb018 100644
--- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter
+++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter
@@ -1033,6 +1033,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1089,10 +1093,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1834,8 +1850,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter
index 51dec4b..a578cc0 100644
--- a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter
+++ b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter
@@ -1018,6 +1018,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1074,10 +1078,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2020,8 +2036,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter
index 65e16fc..f49d0a1 100644
--- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter
+++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter
@@ -918,6 +918,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -974,10 +978,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1450,8 +1466,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter
index 76e54a5..2878ac5 100644
--- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter
+++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter
@@ -1115,6 +1115,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1171,10 +1175,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1673,8 +1689,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter
index 2803433..69c30f0 100644
--- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter
+++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter
@@ -645,6 +645,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -701,10 +705,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1269,8 +1285,8 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter
index 99b8356..5819641 100644
--- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter
+++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter
@@ -918,6 +918,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -974,10 +978,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2084,8 +2100,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter
index 062f3d8..9f4fdb2 100644
--- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter
+++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter
@@ -1115,6 +1115,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1171,10 +1175,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1950,8 +1966,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter
index af69726..71d511a 100644
--- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter
+++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter
@@ -897,6 +897,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -953,10 +957,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1495,8 +1511,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter
index 798bbaf..0b312b4 100644
--- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter
+++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter
@@ -918,6 +918,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -974,10 +978,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1449,8 +1465,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter
index d343385..8e2d016 100644
--- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter
+++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter
@@ -605,6 +605,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -661,10 +665,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** This cluster exposes interactions with a switch device, for the purpose of using those interactions by other devices.
@@ -1089,8 +1105,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter
index bf73232..d1aee2e 100644
--- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter
+++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter
@@ -1115,6 +1115,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1171,10 +1175,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2083,8 +2099,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter
index 6453623..5dc16ab 100644
--- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter
+++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter
@@ -918,6 +918,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -974,10 +978,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1449,8 +1465,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter
index 372b79a..b9c7cc8 100644
--- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter
+++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter
@@ -645,6 +645,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -701,10 +705,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1269,8 +1285,8 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter
index 71923d2..9990e62 100644
--- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter
+++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter
@@ -918,6 +918,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -974,10 +978,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1455,8 +1471,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter
index 73e4c3c..bb7f987 100644
--- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter
+++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter
@@ -918,6 +918,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -974,10 +978,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1474,8 +1490,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter
index 098de3b..0dc109e 100644
--- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter
+++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter
@@ -1115,6 +1115,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1171,10 +1175,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1630,8 +1646,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.matter b/examples/chef/devices/rootnode_onofflight_samplemei.matter
index 792908d..d4bbc6d 100644
--- a/examples/chef/devices/rootnode_onofflight_samplemei.matter
+++ b/examples/chef/devices/rootnode_onofflight_samplemei.matter
@@ -1115,6 +1115,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1171,10 +1175,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1662,8 +1678,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter
index aa6867d..255cd7f 100644
--- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter
+++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter
@@ -1062,6 +1062,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1118,10 +1122,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1577,8 +1593,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter
index a1ef7be..969cfb0 100644
--- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter
+++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter
@@ -990,6 +990,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1046,10 +1050,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1505,8 +1521,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter
index 6a64f87..c3c6219 100644
--- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter
+++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter
@@ -918,6 +918,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -974,10 +978,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1476,8 +1492,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.matter b/examples/chef/devices/rootnode_pump_5f904818cc.matter
index 2d0689d..bf325a7 100644
--- a/examples/chef/devices/rootnode_pump_5f904818cc.matter
+++ b/examples/chef/devices/rootnode_pump_5f904818cc.matter
@@ -717,6 +717,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -773,10 +777,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** Commands to trigger a Node to allow a new Administrator to commission it. */
@@ -1346,8 +1362,8 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.matter b/examples/chef/devices/rootnode_pump_a811bb33a0.matter
index 4c2184d..1b80123 100644
--- a/examples/chef/devices/rootnode_pump_a811bb33a0.matter
+++ b/examples/chef/devices/rootnode_pump_a811bb33a0.matter
@@ -717,6 +717,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -773,10 +777,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** Commands to trigger a Node to allow a new Administrator to commission it. */
@@ -1289,8 +1305,8 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter
index aa021d9..9564a21 100644
--- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter
+++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter
@@ -645,6 +645,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -701,10 +705,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1235,8 +1251,8 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter
index dc190ad..f2ab0c3 100644
--- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter
+++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter
@@ -682,6 +682,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -738,10 +742,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** Commands to trigger a Node to allow a new Administrator to commission it. */
@@ -1289,8 +1305,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter
index c41e4fc..de4a1c9 100644
--- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter
+++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter
@@ -754,6 +754,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -810,10 +814,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** Commands to trigger a Node to allow a new Administrator to commission it. */
@@ -1670,8 +1686,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter
index af7c3a3..49b97d5 100644
--- a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter
+++ b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter
@@ -941,6 +941,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -997,10 +1001,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** Commands to trigger a Node to allow a new Administrator to commission it. */
@@ -1482,8 +1498,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter
index 2862703..dbe6c0a 100644
--- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter
+++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter
@@ -1038,6 +1038,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1094,10 +1098,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1553,8 +1569,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter
index 6993a6f..c7b567c 100644
--- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter
+++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter
@@ -918,6 +918,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -974,10 +978,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1449,8 +1465,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter
index 4ab01b3..fdefbfc 100644
--- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter
+++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter
@@ -918,6 +918,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -974,10 +978,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1993,8 +2009,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter
index 20fa873..a4f8f2d 100644
--- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter
+++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter
@@ -918,6 +918,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -974,10 +978,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1586,8 +1602,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter
index 4372e56..64e96b4 100644
--- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter
+++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter
@@ -897,6 +897,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -953,10 +957,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1790,8 +1806,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter
index 3359107..6c52cbc 100644
--- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter
+++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter
@@ -743,6 +743,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -799,10 +803,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1384,8 +1400,8 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.matter b/examples/energy-management-app/energy-management-common/energy-management-app.matter
index bb8d99f..f593b52 100644
--- a/examples/energy-management-app/energy-management-common/energy-management-app.matter
+++ b/examples/energy-management-app/energy-management-common/energy-management-app.matter
@@ -645,6 +645,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -701,10 +705,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** Commands to trigger a Node to allow a new Administrator to commission it. */
@@ -1771,8 +1787,8 @@
     callback attribute acceptedCommandList;
     callback attribute eventList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 1;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter
index 89af61e..90e6058 100644
--- a/examples/light-switch-app/light-switch-common/light-switch-app.matter
+++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter
@@ -1040,6 +1040,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1096,10 +1100,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2621,8 +2637,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/light-switch-app/qpg/zap/switch.matter b/examples/light-switch-app/qpg/zap/switch.matter
index 035913b..b7f217d 100644
--- a/examples/light-switch-app/qpg/zap/switch.matter
+++ b/examples/light-switch-app/qpg/zap/switch.matter
@@ -1104,6 +1104,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1160,10 +1164,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2430,8 +2446,8 @@
     callback attribute acceptedCommandList;
     callback attribute eventList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 2;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
   }
diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter
index ad6f111..626d1bc 100644
--- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter
+++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter
@@ -1094,6 +1094,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1150,10 +1154,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1983,8 +1999,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter
index 78048d0..392e08c 100644
--- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter
+++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter
@@ -1094,6 +1094,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1150,10 +1154,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2116,8 +2132,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter
index 5b77ecb..4bc0736 100644
--- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter
+++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter
@@ -1094,6 +1094,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1150,10 +1154,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2027,8 +2043,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter
index f8996d1..f43bdcb 100644
--- a/examples/lighting-app/lighting-common/lighting-app.matter
+++ b/examples/lighting-app/lighting-common/lighting-app.matter
@@ -1094,6 +1094,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1150,10 +1154,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2480,8 +2496,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter
index 048b8f4..9f4e9c5 100644
--- a/examples/lighting-app/nxp/zap/lighting-on-off.matter
+++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter
@@ -986,6 +986,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1042,10 +1046,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1612,8 +1628,8 @@
     callback attribute rebootCount;
     callback attribute upTime;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter
index bef4849..fb5dcbb 100644
--- a/examples/lighting-app/qpg/zap/light.matter
+++ b/examples/lighting-app/qpg/zap/light.matter
@@ -1033,6 +1033,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1089,10 +1093,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2062,8 +2078,8 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter
index 8140792..6803904 100644
--- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter
+++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter
@@ -1353,6 +1353,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1409,10 +1413,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2517,8 +2533,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter
index 206679a..9008359 100644
--- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter
+++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter
@@ -1353,6 +1353,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1409,10 +1413,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2427,8 +2443,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter
index 17d36e2..9089068 100644
--- a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter
+++ b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter
@@ -738,6 +738,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -794,10 +798,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */
@@ -1608,8 +1624,8 @@
     callback attribute acceptedCommandList;
     callback attribute eventList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 2;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter
index 6a3aad2..f07b85c 100644
--- a/examples/lock-app/lock-common/lock-app.matter
+++ b/examples/lock-app/lock-common/lock-app.matter
@@ -1061,6 +1061,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1117,10 +1121,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2663,8 +2679,8 @@
     callback attribute acceptedCommandList;
     callback attribute eventList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter
index add41c8..9c3fb96 100644
--- a/examples/lock-app/nxp/zap/lock-app.matter
+++ b/examples/lock-app/nxp/zap/lock-app.matter
@@ -558,6 +558,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -614,10 +618,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1820,8 +1836,8 @@
     callback attribute rebootCount;
     callback attribute upTime;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter
index e554652..91ff769 100644
--- a/examples/lock-app/qpg/zap/lock.matter
+++ b/examples/lock-app/qpg/zap/lock.matter
@@ -836,6 +836,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -892,10 +896,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2281,8 +2297,8 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter
index eada9b1..133ee49 100644
--- a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter
+++ b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter
@@ -602,6 +602,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -658,10 +662,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1276,8 +1292,8 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/network-manager-app/network-manager-common/network-manager-app.matter b/examples/network-manager-app/network-manager-common/network-manager-app.matter
index fdc906d..15a4efb 100644
--- a/examples/network-manager-app/network-manager-common/network-manager-app.matter
+++ b/examples/network-manager-app/network-manager-common/network-manager-app.matter
@@ -558,6 +558,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -614,10 +618,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */
@@ -1284,8 +1300,8 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter
index 9f8d704..7daeffe 100644
--- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter
+++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter
@@ -720,6 +720,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -776,10 +780,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** Commands to trigger a Node to allow a new Administrator to commission it. */
@@ -1209,8 +1225,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter
index aa72684..da7faa2 100644
--- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter
+++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter
@@ -922,6 +922,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -978,10 +982,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** Commands to trigger a Node to allow a new Administrator to commission it. */
@@ -1411,8 +1427,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter
index 935a665..9474cd6 100644
--- a/examples/placeholder/linux/apps/app1/config.matter
+++ b/examples/placeholder/linux/apps/app1/config.matter
@@ -1714,6 +1714,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1770,10 +1774,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -8364,8 +8380,8 @@
     callback attribute acceptedCommandList;
     callback attribute eventList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter
index 83657fd..4941531 100644
--- a/examples/placeholder/linux/apps/app2/config.matter
+++ b/examples/placeholder/linux/apps/app2/config.matter
@@ -1671,6 +1671,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1727,10 +1731,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -8322,8 +8338,8 @@
     callback attribute acceptedCommandList;
     callback attribute eventList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter
index b944766..a639858 100644
--- a/examples/pump-app/pump-common/pump-app.matter
+++ b/examples/pump-app/pump-common/pump-app.matter
@@ -930,6 +930,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -986,10 +990,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */
@@ -1767,8 +1783,8 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.matter b/examples/pump-app/silabs/data_model/pump-thread-app.matter
index 43dcac8..a819a67 100644
--- a/examples/pump-app/silabs/data_model/pump-thread-app.matter
+++ b/examples/pump-app/silabs/data_model/pump-thread-app.matter
@@ -930,6 +930,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -986,10 +990,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */
@@ -1767,8 +1783,8 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.matter b/examples/pump-app/silabs/data_model/pump-wifi-app.matter
index 43dcac8..a819a67 100644
--- a/examples/pump-app/silabs/data_model/pump-wifi-app.matter
+++ b/examples/pump-app/silabs/data_model/pump-wifi-app.matter
@@ -930,6 +930,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -986,10 +990,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */
@@ -1767,8 +1783,8 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter
index 6995c31..ba19fac 100644
--- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter
+++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter
@@ -805,6 +805,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -861,10 +865,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */
@@ -1601,8 +1617,8 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter
index d8f04c2..296b4b6 100644
--- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter
+++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter
@@ -595,6 +595,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -651,10 +655,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1175,8 +1191,8 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/rvc-app/rvc-common/rvc-app.matter b/examples/rvc-app/rvc-common/rvc-app.matter
index 6ed9387..937e342 100644
--- a/examples/rvc-app/rvc-common/rvc-app.matter
+++ b/examples/rvc-app/rvc-common/rvc-app.matter
@@ -605,6 +605,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -661,10 +665,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** Commands to trigger a Node to allow a new Administrator to commission it. */
@@ -1212,8 +1228,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter
index 4fee2b9..6c1938c 100644
--- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter
+++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter
@@ -1156,6 +1156,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1212,10 +1216,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2043,8 +2059,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter
index fbd355a..e10100b 100644
--- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter
+++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter
@@ -796,6 +796,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -852,10 +856,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1474,8 +1490,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter
index e554c32..12441ff 100644
--- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter
+++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter
@@ -1206,6 +1206,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1262,10 +1266,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */
@@ -2394,8 +2410,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter
index 43b0901..ff712e7 100644
--- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter
+++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter
@@ -1206,6 +1206,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1262,10 +1266,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2305,8 +2321,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter
index 7139234..776cef1 100644
--- a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter
+++ b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter
@@ -933,6 +933,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -989,10 +993,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2043,8 +2059,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter
index 537a6c6..301dbf6 100644
--- a/examples/thermostat/thermostat-common/thermostat.matter
+++ b/examples/thermostat/thermostat-common/thermostat.matter
@@ -994,6 +994,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1050,10 +1054,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2237,8 +2253,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter
index e2db627..a2a6a08 100644
--- a/examples/tv-app/tv-common/tv-app.matter
+++ b/examples/tv-app/tv-common/tv-app.matter
@@ -1206,6 +1206,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1262,10 +1266,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -3306,8 +3322,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter
index 50cf171..2b488ca 100644
--- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter
+++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter
@@ -994,6 +994,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1050,10 +1054,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2746,8 +2762,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter
index 9e4c439..e9e7fee 100644
--- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter
+++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter
@@ -1197,6 +1197,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1253,10 +1257,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -3144,8 +3160,8 @@
     callback attribute activeRadioFaults;
     callback attribute activeNetworkFaults;
     callback attribute testEventTriggersEnabled default = false;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter
index 6247de6..7e0053f 100644
--- a/examples/window-app/common/window-app.matter
+++ b/examples/window-app/common/window-app.matter
@@ -1135,6 +1135,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1191,10 +1195,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -2244,8 +2260,8 @@
     callback attribute acceptedCommandList;
     callback attribute eventList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
-    ram      attribute clusterRevision default = 0x0002;
+    callback attribute featureMap;
+    callback attribute clusterRevision;
 
     handle command TestEventTrigger;
     handle command TimeSnapshot;
diff --git a/scripts/py_matter_idl/matter_idl/generators/java/ChipClusters_java.jinja b/scripts/py_matter_idl/matter_idl/generators/java/ChipClusters_java.jinja
index 45621c7..ba0abf5 100644
--- a/scripts/py_matter_idl/matter_idl/generators/java/ChipClusters_java.jinja
+++ b/scripts/py_matter_idl/matter_idl/generators/java/ChipClusters_java.jinja
@@ -238,7 +238,6 @@
 
     @Deprecated
     public void deleteCluster(long chipClusterPtr) {}
-    
     @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
       super.finalize();
@@ -415,7 +414,7 @@
       elements.add(new StructElement({{field.name | lowfirst_except_acronym}}FieldID, {{field.name | lowfirst_except_acronym}}tlvValue));
 {% endfor -%}
 {%- endif %}
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -456,7 +455,7 @@
 {%- else %}
           callback.onSuccess();
 {%- endif %}
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 {% endfor %}
 {%- set already_handled_command = [] -%}
diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ChipClusters.java b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ChipClusters.java
index 94d8415..9b6287a 100644
--- a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ChipClusters.java
+++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ChipClusters.java
@@ -161,7 +161,6 @@
 
     @Deprecated
     public void deleteCluster(long chipClusterPtr) {}
-    
     @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
       super.finalize();
diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h
index bf16ebb..6985b44 100644
--- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h
+++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h
@@ -521,9 +521,9 @@
             { ZAP_EMPTY_DEFAULT(), 0x00000007, 0, ZAP_TYPE(ARRAY),                                                                 \
               ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* ActiveNetworkFaults */                                                    \
             { ZAP_EMPTY_DEFAULT(), 0x00000008, 1, ZAP_TYPE(BOOLEAN),                                                               \
-              ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) },                        /* TestEventTriggersEnabled */                        \
-            { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */                                      \
-            { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 },   /* ClusterRevision */                                 \
+              ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* TestEventTriggersEnabled */                                               \
+            { ZAP_EMPTY_DEFAULT(), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* FeatureMap */     \
+            { ZAP_EMPTY_DEFAULT(), 0x0000FFFD, 2, ZAP_TYPE(INT16U), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* ClusterRevision */  \
                                                                                                                                    \
             /* Endpoint: 0, Cluster: Software Diagnostics (server) */                                                              \
             { ZAP_EMPTY_DEFAULT(), 0x00000000, 0, ZAP_TYPE(ARRAY), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) },  /* ThreadMetrics */    \
@@ -2162,7 +2162,7 @@
       .clusterId = 0x00000033, \
       .attributes = ZAP_ATTRIBUTE_INDEX(91), \
       .attributeCount = 11, \
-      .clusterSize = 6, \
+      .clusterSize = 0, \
       .mask = ZAP_CLUSTER_MASK(SERVER), \
       .functions = NULL, \
       .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 40 ), \
@@ -3011,7 +3011,7 @@
 // This is an array of EmberAfEndpointType structures.
 #define GENERATED_ENDPOINT_TYPES                                                                                                   \
     {                                                                                                                              \
-        { ZAP_CLUSTER_INDEX(0), 27, 341 }, { ZAP_CLUSTER_INDEX(27), 44, 3686 }, { ZAP_CLUSTER_INDEX(71), 7, 116 },                 \
+        { ZAP_CLUSTER_INDEX(0), 27, 335 }, { ZAP_CLUSTER_INDEX(27), 44, 3686 }, { ZAP_CLUSTER_INDEX(71), 7, 116 },                 \
             { ZAP_CLUSTER_INDEX(78), 2, 0 },                                                                                       \
     }
 
@@ -3024,7 +3024,7 @@
 #define ATTRIBUTE_SINGLETONS_SIZE (37)
 
 // Total size of attribute storage
-#define ATTRIBUTE_MAX_SIZE (4143)
+#define ATTRIBUTE_MAX_SIZE (4137)
 
 // Number of fixed endpoints
 #define FIXED_ENDPOINT_COUNT (4)
diff --git a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h
index 89b62b8..46990da 100644
--- a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h
+++ b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h
@@ -220,9 +220,9 @@
             { ZAP_EMPTY_DEFAULT(), 0x00000007, 0, ZAP_TYPE(ARRAY),                                                                 \
               ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* ActiveNetworkFaults */                                                    \
             { ZAP_EMPTY_DEFAULT(), 0x00000008, 1, ZAP_TYPE(BOOLEAN),                                                               \
-              ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) },                        /* TestEventTriggersEnabled */                        \
-            { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */                                      \
-            { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 },   /* ClusterRevision */                                 \
+              ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* TestEventTriggersEnabled */                                               \
+            { ZAP_EMPTY_DEFAULT(), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* FeatureMap */     \
+            { ZAP_EMPTY_DEFAULT(), 0x0000FFFD, 2, ZAP_TYPE(INT16U), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* ClusterRevision */  \
                                                                                                                                    \
             /* Endpoint: 0, Cluster: Software Diagnostics (server) */                                                              \
             { ZAP_EMPTY_DEFAULT(), 0x00000000, 0, ZAP_TYPE(ARRAY), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) },  /* ThreadMetrics */    \
@@ -912,7 +912,7 @@
       .clusterId = 0x00000033, \
       .attributes = ZAP_ATTRIBUTE_INDEX(72), \
       .attributeCount = 11, \
-      .clusterSize = 6, \
+      .clusterSize = 0, \
       .mask = ZAP_CLUSTER_MASK(SERVER), \
       .functions = NULL, \
       .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 37 ), \
@@ -1150,7 +1150,7 @@
 // This is an array of EmberAfEndpointType structures.
 #define GENERATED_ENDPOINT_TYPES                                                                                                   \
     {                                                                                                                              \
-        { ZAP_CLUSTER_INDEX(0), 22, 235 }, { ZAP_CLUSTER_INDEX(22), 7, 105 },                                                      \
+        { ZAP_CLUSTER_INDEX(0), 22, 229 }, { ZAP_CLUSTER_INDEX(22), 7, 105 },                                                      \
     }
 
 // Largest attribute size is needed for various buffers
@@ -1162,7 +1162,7 @@
 #define ATTRIBUTE_SINGLETONS_SIZE (37)
 
 // Total size of attribute storage
-#define ATTRIBUTE_MAX_SIZE (340)
+#define ATTRIBUTE_MAX_SIZE (334)
 
 // Number of fixed endpoints
 #define FIXED_ENDPOINT_COUNT (2)
diff --git a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp
index c392c96..0bd3fe0 100644
--- a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp
+++ b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp
@@ -17,6 +17,9 @@
 
 #include "general-diagnostics-server.h"
 
+#include <stdint.h>
+#include <string.h>
+
 #include <app/util/config.h>
 
 #include "app/server/Server.h"
@@ -28,6 +31,7 @@
 #include <app/EventLogging.h>
 #include <app/reporting/reporting.h>
 #include <app/util/attribute-storage.h>
+#include <lib/support/ScopedBuffer.h>
 #include <platform/ConnectivityManager.h>
 #include <platform/DiagnosticDataProvider.h>
 
@@ -44,6 +48,8 @@
 
 namespace {
 
+constexpr uint8_t kCurrentClusterRevision = 2;
+
 bool IsTestEventTriggerEnabled()
 {
     auto * triggerDelegate = chip::Server::GetInstance().GetTestEventTriggerDelegate();
@@ -209,10 +215,24 @@
         bool isTestEventTriggersEnabled = IsTestEventTriggerEnabled();
         return aEncoder.Encode(isTestEventTriggersEnabled);
     }
-    // Note: Attribute ID 0x0009 was removed (#30002).
-    default: {
-        break;
+        // Note: Attribute ID 0x0009 was removed (#30002).
+
+    case FeatureMap::Id: {
+        uint32_t features = 0;
+
+#if CHIP_CONFIG_MAX_PATHS_PER_INVOKE > 1
+        features |= to_underlying(Clusters::GeneralDiagnostics::Feature::kDataModelTest);
+#endif // CHIP_CONFIG_MAX_PATHS_PER_INVOKE > 1
+
+        return aEncoder.Encode(features);
     }
+
+    case ClusterRevision::Id: {
+        return aEncoder.Encode(kCurrentClusterRevision);
+    }
+
+    default:
+        break;
     }
     return CHIP_NO_ERROR;
 }
@@ -352,29 +372,37 @@
 } // namespace app
 } // namespace chip
 
-bool emberAfGeneralDiagnosticsClusterTestEventTriggerCallback(CommandHandler * commandObj, const ConcreteCommandPath & commandPath,
-                                                              const Commands::TestEventTrigger::DecodableType & commandData)
-{
+namespace {
 
-    if (commandData.enableKey.size() != TestEventTriggerDelegate::kEnableKeyLength)
+TestEventTriggerDelegate * GetTriggerDelegateOnMatchingKey(ByteSpan enableKey)
+{
+    if (enableKey.size() != TestEventTriggerDelegate::kEnableKeyLength)
     {
-        commandObj->AddStatus(commandPath, Status::ConstraintError);
-        return true;
+        return nullptr;
     }
 
-    if (IsByteSpanAllZeros(commandData.enableKey))
+    if (IsByteSpanAllZeros(enableKey))
     {
-        commandObj->AddStatus(commandPath, Status::ConstraintError);
-        return true;
+        return nullptr;
     }
 
     auto * triggerDelegate = chip::Server::GetInstance().GetTestEventTriggerDelegate();
 
-    // Spec says "EnableKeyMismatch" but this never existed prior to 1.0 SVE2 and mismatches
-    // test plans as well. ConstraintError is specified for most other errors, so
-    // we keep the behavior as close as possible, except for EnableKeyMismatch which
-    // is going to be a ConstraintError.
-    if (triggerDelegate == nullptr || !triggerDelegate->DoesEnableKeyMatch(commandData.enableKey))
+    if (triggerDelegate == nullptr || !triggerDelegate->DoesEnableKeyMatch(enableKey))
+    {
+        return nullptr;
+    }
+
+    return triggerDelegate;
+}
+
+} // namespace
+
+bool emberAfGeneralDiagnosticsClusterTestEventTriggerCallback(CommandHandler * commandObj, const ConcreteCommandPath & commandPath,
+                                                              const Commands::TestEventTrigger::DecodableType & commandData)
+{
+    auto * triggerDelegate = GetTriggerDelegateOnMatchingKey(commandData.enableKey);
+    if (triggerDelegate == nullptr)
     {
         commandObj->AddStatus(commandPath, Status::ConstraintError);
         return true;
@@ -420,6 +448,44 @@
     return true;
 }
 
+bool emberAfGeneralDiagnosticsClusterPayloadTestRequestCallback(CommandHandler * commandObj,
+                                                                const ConcreteCommandPath & commandPath,
+                                                                const Commands::PayloadTestRequest::DecodableType & commandData)
+{
+    // Max allowed is 2048.
+    if (commandData.count > 2048)
+    {
+        commandObj->AddStatus(commandPath, Status::ConstraintError);
+        return true;
+    }
+
+    // Ensure Test Event triggers are enabled and key matches.
+    auto * triggerDelegate = GetTriggerDelegateOnMatchingKey(commandData.enableKey);
+    if (triggerDelegate == nullptr)
+    {
+        commandObj->AddStatus(commandPath, Status::ConstraintError);
+        return true;
+    }
+
+    Commands::PayloadTestResponse::Type response;
+    Platform::ScopedMemoryBufferWithSize<uint8_t> payload;
+    if (!payload.Calloc(commandData.count))
+    {
+        commandObj->AddStatus(commandPath, Status::ResourceExhausted);
+        return true;
+    }
+
+    memset(payload.Get(), commandData.value, payload.AllocatedSize());
+    response.payload = ByteSpan{ payload.Get(), payload.AllocatedSize() };
+
+    if (commandObj->AddResponseData(commandPath, response) != CHIP_NO_ERROR)
+    {
+        commandObj->AddStatus(commandPath, Status::ResourceExhausted);
+    }
+
+    return true;
+}
+
 void MatterGeneralDiagnosticsPluginServerInitCallback()
 {
     BootReasonEnum bootReason;
diff --git a/src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml
index 7342101..fc10b3d 100644
--- a/src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml
+++ b/src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml
@@ -43,7 +43,6 @@
       command: "readAttribute"
       attribute: "FeatureMap"
       response:
-          value: 0
           constraints:
               type: bitmap32
 
@@ -178,6 +177,6 @@
       command: "readAttribute"
       attribute: "GeneratedCommandList"
       response:
-          value: [2]
           constraints:
               type: list
+              contains: [2]
diff --git a/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml
index 5e1ec18..26e1400 100644
--- a/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml
+++ b/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml
@@ -16,6 +16,12 @@
 -->
 <configurator>
   <domain name="CHIP"/>
+
+  <bitmap name="Feature" type="bitmap32">
+    <cluster code="0x0033"/>
+    <field name="DataModelTest" mask="0x1"/>
+  </bitmap>
+
   <enum name="HardwareFaultEnum" type="enum8">
     <cluster code="0x0033"/>
     <item name="Unspecified" value="0x00"/>
@@ -122,6 +128,18 @@
       <arg name="PosixTimeMs" type="posix_ms" isNullable="true" optional="false"/>
     </command>
 
+    <command source="client" code="0x03" name="PayloadTestRequest" response="PayloadTestResponse" optional="true" apiMaturity="provisional">
+      <description>Request a variable length payload response.</description>
+      <arg name="EnableKey" type="octet_string" length="16"/>
+      <arg name="Value" type="int8u"/>
+      <arg name="Count" type="int16u" max="2048"/>
+    </command>
+
+    <command source="server" code="0x04" name="PayloadTestResponse" optional="true" apiMaturity="provisional">
+      <description>Response for the PayloadTestRequest command.</description>
+      <arg name="Payload" type="octet_string" max="2048" optional="false"/>
+    </command>
+
     <event side="server" code="0x00" name="HardwareFaultChange" priority="critical" optional="true">
       <description>Indicate a change in the set of hardware faults currently detected by the Node.</description>
       <field id="0" name="Current" type="HardwareFaultEnum" array="true"/>
diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json
index ebf466e..2800e14 100644
--- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json
+++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json
@@ -252,7 +252,9 @@
             "RebootCount",
             "UpTime",
             "TotalOperationalHours",
-            "BootReason"
+            "BootReason",
+            "FeatureMap",
+            "ClusterRevision"
         ],
         "Group Key Management": [
             "ClusterRevision",
diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json
index d18e7e1..b9e0142 100644
--- a/src/app/zap-templates/zcl/zcl.json
+++ b/src/app/zap-templates/zcl/zcl.json
@@ -250,7 +250,9 @@
             "RebootCount",
             "UpTime",
             "TotalOperationalHours",
-            "BootReason"
+            "BootReason",
+            "FeatureMap",
+            "ClusterRevision"
         ],
         "Group Key Management": [
             "ClusterRevision",
diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter
index 20344db..0fa33ae 100644
--- a/src/controller/data_model/controller-clusters.matter
+++ b/src/controller/data_model/controller-clusters.matter
@@ -1637,6 +1637,10 @@
     kEthernetFault = 6;
   }
 
+  bitmap Feature : bitmap32 {
+    kDataModelTest = 0x1;
+  }
+
   struct NetworkInterface {
     char_string<32> name = 0;
     boolean isOperational = 1;
@@ -1693,10 +1697,22 @@
     nullable posix_ms posixTimeMs = 1;
   }
 
+  request struct PayloadTestRequestRequest {
+    octet_string<16> enableKey = 0;
+    int8u value = 1;
+    int16u count = 2;
+  }
+
+  response struct PayloadTestResponse = 4 {
+    octet_string payload = 0;
+  }
+
   /** Provide a means for certification tests to trigger some test-plan-specific events */
   command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
   /** Take a snapshot of system time and epoch time. */
   command TimeSnapshot(): TimeSnapshotResponse = 1;
+  /** Request a variable length payload response. */
+  command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
 }
 
 /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java
index 66a4320..6e479c5 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java
@@ -161,7 +161,6 @@
 
     @Deprecated
     public void deleteCluster(long chipClusterPtr) {}
-    
     @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
       super.finalize();
@@ -316,12 +315,12 @@
       BaseTLVType identifyTimetlvValue = new UIntType(identifyTime);
       elements.add(new StructElement(identifyTimeFieldID, identifyTimetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void triggerEffect(DefaultClusterCallback callback, Integer effectIdentifier, Integer effectVariant) {
@@ -340,12 +339,12 @@
       BaseTLVType effectVarianttlvValue = new UIntType(effectVariant);
       elements.add(new StructElement(effectVariantFieldID, effectVarianttlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback {
@@ -611,7 +610,7 @@
       BaseTLVType groupNametlvValue = new StringType(groupName);
       elements.add(new StructElement(groupNameFieldID, groupNametlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -633,7 +632,7 @@
             }
           }
           callback.onSuccess(status, groupID);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void viewGroup(ViewGroupResponseCallback callback, Integer groupID) {
@@ -648,7 +647,7 @@
       BaseTLVType groupIDtlvValue = new UIntType(groupID);
       elements.add(new StructElement(groupIDFieldID, groupIDtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -677,7 +676,7 @@
             }
           }
           callback.onSuccess(status, groupID, groupName);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void getGroupMembership(GetGroupMembershipResponseCallback callback, ArrayList<Integer> groupList) {
@@ -692,7 +691,7 @@
       BaseTLVType groupListtlvValue = ArrayType.generateArrayType(groupList, (elementgroupList) -> new UIntType(elementgroupList));
       elements.add(new StructElement(groupListFieldID, groupListtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -714,7 +713,7 @@
             }
           }
           callback.onSuccess(capacity, groupList);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void removeGroup(RemoveGroupResponseCallback callback, Integer groupID) {
@@ -729,7 +728,7 @@
       BaseTLVType groupIDtlvValue = new UIntType(groupID);
       elements.add(new StructElement(groupIDFieldID, groupIDtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -751,7 +750,7 @@
             }
           }
           callback.onSuccess(status, groupID);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void removeAllGroups(DefaultClusterCallback callback) {
@@ -762,12 +761,12 @@
       final long commandId = 4L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void addGroupIfIdentifying(DefaultClusterCallback callback, Integer groupID, String groupName) {
@@ -786,12 +785,12 @@
       BaseTLVType groupNametlvValue = new StringType(groupName);
       elements.add(new StructElement(groupNameFieldID, groupNametlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface AddGroupResponseCallback extends BaseClusterCallback {
@@ -1035,12 +1034,12 @@
       final long commandId = 0L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void on(DefaultClusterCallback callback) {
@@ -1051,12 +1050,12 @@
       final long commandId = 1L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void toggle(DefaultClusterCallback callback) {
@@ -1067,12 +1066,12 @@
       final long commandId = 2L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void offWithEffect(DefaultClusterCallback callback, Integer effectIdentifier, Integer effectVariant) {
@@ -1091,12 +1090,12 @@
       BaseTLVType effectVarianttlvValue = new UIntType(effectVariant);
       elements.add(new StructElement(effectVariantFieldID, effectVarianttlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void onWithRecallGlobalScene(DefaultClusterCallback callback) {
@@ -1107,12 +1106,12 @@
       final long commandId = 65L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void onWithTimedOff(DefaultClusterCallback callback, Integer onOffControl, Integer onTime, Integer offWaitTime) {
@@ -1135,12 +1134,12 @@
       BaseTLVType offWaitTimetlvValue = new UIntType(offWaitTime);
       elements.add(new StructElement(offWaitTimeFieldID, offWaitTimetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface StartUpOnOffAttributeCallback extends BaseAttributeCallback {
@@ -1772,12 +1771,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void move(DefaultClusterCallback callback, Integer moveMode, @Nullable Integer rate, Integer optionsMask, Integer optionsOverride) {
@@ -1804,12 +1803,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void step(DefaultClusterCallback callback, Integer stepMode, Integer stepSize, @Nullable Integer transitionTime, Integer optionsMask, Integer optionsOverride) {
@@ -1840,12 +1839,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void stop(DefaultClusterCallback callback, Integer optionsMask, Integer optionsOverride) {
@@ -1864,12 +1863,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void moveToLevelWithOnOff(DefaultClusterCallback callback, Integer level, @Nullable Integer transitionTime, Integer optionsMask, Integer optionsOverride) {
@@ -1896,12 +1895,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void moveWithOnOff(DefaultClusterCallback callback, Integer moveMode, @Nullable Integer rate, Integer optionsMask, Integer optionsOverride) {
@@ -1928,12 +1927,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void stepWithOnOff(DefaultClusterCallback callback, Integer stepMode, Integer stepSize, @Nullable Integer transitionTime, Integer optionsMask, Integer optionsOverride) {
@@ -1964,12 +1963,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void stopWithOnOff(DefaultClusterCallback callback, Integer optionsMask, Integer optionsOverride) {
@@ -1988,12 +1987,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void moveToClosestFrequency(DefaultClusterCallback callback, Integer frequency) {
@@ -2008,12 +2007,12 @@
       BaseTLVType frequencytlvValue = new UIntType(frequency);
       elements.add(new StructElement(frequencyFieldID, frequencytlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface CurrentLevelAttributeCallback extends BaseAttributeCallback {
@@ -4242,12 +4241,12 @@
       BaseTLVType invokeIDtlvValue = invokeID.<BaseTLVType>map((nonOptionalinvokeID) -> new UIntType(nonOptionalinvokeID)).orElse(new EmptyType());
       elements.add(new StructElement(invokeIDFieldID, invokeIDtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void instantActionWithTransition(DefaultClusterCallback callback, Integer actionID, Optional<Long> invokeID, Integer transitionTime) {
@@ -4270,12 +4269,12 @@
       BaseTLVType transitionTimetlvValue = new UIntType(transitionTime);
       elements.add(new StructElement(transitionTimeFieldID, transitionTimetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void startAction(DefaultClusterCallback callback, Integer actionID, Optional<Long> invokeID) {
@@ -4294,12 +4293,12 @@
       BaseTLVType invokeIDtlvValue = invokeID.<BaseTLVType>map((nonOptionalinvokeID) -> new UIntType(nonOptionalinvokeID)).orElse(new EmptyType());
       elements.add(new StructElement(invokeIDFieldID, invokeIDtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void startActionWithDuration(DefaultClusterCallback callback, Integer actionID, Optional<Long> invokeID, Long duration) {
@@ -4322,12 +4321,12 @@
       BaseTLVType durationtlvValue = new UIntType(duration);
       elements.add(new StructElement(durationFieldID, durationtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void stopAction(DefaultClusterCallback callback, Integer actionID, Optional<Long> invokeID) {
@@ -4346,12 +4345,12 @@
       BaseTLVType invokeIDtlvValue = invokeID.<BaseTLVType>map((nonOptionalinvokeID) -> new UIntType(nonOptionalinvokeID)).orElse(new EmptyType());
       elements.add(new StructElement(invokeIDFieldID, invokeIDtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void pauseAction(DefaultClusterCallback callback, Integer actionID, Optional<Long> invokeID) {
@@ -4370,12 +4369,12 @@
       BaseTLVType invokeIDtlvValue = invokeID.<BaseTLVType>map((nonOptionalinvokeID) -> new UIntType(nonOptionalinvokeID)).orElse(new EmptyType());
       elements.add(new StructElement(invokeIDFieldID, invokeIDtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void pauseActionWithDuration(DefaultClusterCallback callback, Integer actionID, Optional<Long> invokeID, Long duration) {
@@ -4398,12 +4397,12 @@
       BaseTLVType durationtlvValue = new UIntType(duration);
       elements.add(new StructElement(durationFieldID, durationtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void resumeAction(DefaultClusterCallback callback, Integer actionID, Optional<Long> invokeID) {
@@ -4422,12 +4421,12 @@
       BaseTLVType invokeIDtlvValue = invokeID.<BaseTLVType>map((nonOptionalinvokeID) -> new UIntType(nonOptionalinvokeID)).orElse(new EmptyType());
       elements.add(new StructElement(invokeIDFieldID, invokeIDtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void enableAction(DefaultClusterCallback callback, Integer actionID, Optional<Long> invokeID) {
@@ -4446,12 +4445,12 @@
       BaseTLVType invokeIDtlvValue = invokeID.<BaseTLVType>map((nonOptionalinvokeID) -> new UIntType(nonOptionalinvokeID)).orElse(new EmptyType());
       elements.add(new StructElement(invokeIDFieldID, invokeIDtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void enableActionWithDuration(DefaultClusterCallback callback, Integer actionID, Optional<Long> invokeID, Long duration) {
@@ -4474,12 +4473,12 @@
       BaseTLVType durationtlvValue = new UIntType(duration);
       elements.add(new StructElement(durationFieldID, durationtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void disableAction(DefaultClusterCallback callback, Integer actionID, Optional<Long> invokeID) {
@@ -4498,12 +4497,12 @@
       BaseTLVType invokeIDtlvValue = invokeID.<BaseTLVType>map((nonOptionalinvokeID) -> new UIntType(nonOptionalinvokeID)).orElse(new EmptyType());
       elements.add(new StructElement(invokeIDFieldID, invokeIDtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void disableActionWithDuration(DefaultClusterCallback callback, Integer actionID, Optional<Long> invokeID, Long duration) {
@@ -4526,12 +4525,12 @@
       BaseTLVType durationtlvValue = new UIntType(duration);
       elements.add(new StructElement(durationFieldID, durationtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface ActionListAttributeCallback extends BaseAttributeCallback {
@@ -4835,12 +4834,12 @@
       final long commandId = 0L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface CapabilityMinimaAttributeCallback extends BaseAttributeCallback {
@@ -5680,7 +5679,7 @@
       BaseTLVType metadataForProvidertlvValue = metadataForProvider.<BaseTLVType>map((nonOptionalmetadataForProvider) -> new ByteArrayType(nonOptionalmetadataForProvider)).orElse(new EmptyType());
       elements.add(new StructElement(metadataForProviderFieldID, metadataForProvidertlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -5744,7 +5743,7 @@
             }
           }
           callback.onSuccess(status, delayedActionTime, imageURI, softwareVersion, softwareVersionString, updateToken, userConsentNeeded, metadataForRequestor);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void applyUpdateRequest(ApplyUpdateResponseCallback callback, byte[] updateToken, Long newVersion) {
@@ -5763,7 +5762,7 @@
       BaseTLVType newVersiontlvValue = new UIntType(newVersion);
       elements.add(new StructElement(newVersionFieldID, newVersiontlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -5785,7 +5784,7 @@
             }
           }
           callback.onSuccess(action, delayedActionTime);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void notifyUpdateApplied(DefaultClusterCallback callback, byte[] updateToken, Long softwareVersion) {
@@ -5804,12 +5803,12 @@
       BaseTLVType softwareVersiontlvValue = new UIntType(softwareVersion);
       elements.add(new StructElement(softwareVersionFieldID, softwareVersiontlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface QueryImageResponseCallback extends BaseClusterCallback {
@@ -6039,12 +6038,12 @@
       BaseTLVType endpointtlvValue = new UIntType(endpoint);
       elements.add(new StructElement(endpointFieldID, endpointtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface DefaultOTAProvidersAttributeCallback extends BaseAttributeCallback {
@@ -8422,7 +8421,7 @@
       BaseTLVType breadcrumbtlvValue = new UIntType(breadcrumb);
       elements.add(new StructElement(breadcrumbFieldID, breadcrumbtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -8444,7 +8443,7 @@
             }
           }
           callback.onSuccess(errorCode, debugText);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void setRegulatoryConfig(SetRegulatoryConfigResponseCallback callback, Integer newRegulatoryConfig, String countryCode, Long breadcrumb) {
@@ -8467,7 +8466,7 @@
       BaseTLVType breadcrumbtlvValue = new UIntType(breadcrumb);
       elements.add(new StructElement(breadcrumbFieldID, breadcrumbtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -8489,7 +8488,7 @@
             }
           }
           callback.onSuccess(errorCode, debugText);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void commissioningComplete(CommissioningCompleteResponseCallback callback) {
@@ -8500,7 +8499,7 @@
       final long commandId = 4L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -8522,7 +8521,7 @@
             }
           }
           callback.onSuccess(errorCode, debugText);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface ArmFailSafeResponseCallback extends BaseClusterCallback {
@@ -8889,7 +8888,7 @@
       BaseTLVType breadcrumbtlvValue = breadcrumb.<BaseTLVType>map((nonOptionalbreadcrumb) -> new UIntType(nonOptionalbreadcrumb)).orElse(new EmptyType());
       elements.add(new StructElement(breadcrumbFieldID, breadcrumbtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -8925,7 +8924,7 @@
             }
           }
           callback.onSuccess(networkingStatus, debugText, wiFiScanResults, threadScanResults);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void addOrUpdateWiFiNetwork(NetworkConfigResponseCallback callback, byte[] ssid, byte[] credentials, Optional<Long> breadcrumb, Optional<byte[]> networkIdentity, Optional<byte[]> clientIdentifier, Optional<byte[]> possessionNonce) {
@@ -8960,7 +8959,7 @@
       BaseTLVType possessionNoncetlvValue = possessionNonce.<BaseTLVType>map((nonOptionalpossessionNonce) -> new ByteArrayType(nonOptionalpossessionNonce)).orElse(new EmptyType());
       elements.add(new StructElement(possessionNonceFieldID, possessionNoncetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -9003,7 +9002,7 @@
             }
           }
           callback.onSuccess(networkingStatus, debugText, networkIndex, clientIdentity, possessionSignature);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void addOrUpdateThreadNetwork(NetworkConfigResponseCallback callback, byte[] operationalDataset, Optional<Long> breadcrumb) {
@@ -9022,7 +9021,7 @@
       BaseTLVType breadcrumbtlvValue = breadcrumb.<BaseTLVType>map((nonOptionalbreadcrumb) -> new UIntType(nonOptionalbreadcrumb)).orElse(new EmptyType());
       elements.add(new StructElement(breadcrumbFieldID, breadcrumbtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -9065,7 +9064,7 @@
             }
           }
           callback.onSuccess(networkingStatus, debugText, networkIndex, clientIdentity, possessionSignature);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void removeNetwork(NetworkConfigResponseCallback callback, byte[] networkID, Optional<Long> breadcrumb) {
@@ -9084,7 +9083,7 @@
       BaseTLVType breadcrumbtlvValue = breadcrumb.<BaseTLVType>map((nonOptionalbreadcrumb) -> new UIntType(nonOptionalbreadcrumb)).orElse(new EmptyType());
       elements.add(new StructElement(breadcrumbFieldID, breadcrumbtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -9127,7 +9126,7 @@
             }
           }
           callback.onSuccess(networkingStatus, debugText, networkIndex, clientIdentity, possessionSignature);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void connectNetwork(ConnectNetworkResponseCallback callback, byte[] networkID, Optional<Long> breadcrumb) {
@@ -9146,7 +9145,7 @@
       BaseTLVType breadcrumbtlvValue = breadcrumb.<BaseTLVType>map((nonOptionalbreadcrumb) -> new UIntType(nonOptionalbreadcrumb)).orElse(new EmptyType());
       elements.add(new StructElement(breadcrumbFieldID, breadcrumbtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -9175,7 +9174,7 @@
             }
           }
           callback.onSuccess(networkingStatus, debugText, errorValue);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void reorderNetwork(NetworkConfigResponseCallback callback, byte[] networkID, Integer networkIndex, Optional<Long> breadcrumb) {
@@ -9198,7 +9197,7 @@
       BaseTLVType breadcrumbtlvValue = breadcrumb.<BaseTLVType>map((nonOptionalbreadcrumb) -> new UIntType(nonOptionalbreadcrumb)).orElse(new EmptyType());
       elements.add(new StructElement(breadcrumbFieldID, breadcrumbtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -9241,7 +9240,7 @@
             }
           }
           callback.onSuccess(networkingStatus, debugText, networkIndex, clientIdentity, possessionSignature);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void queryIdentity(QueryIdentityResponseCallback callback, byte[] keyIdentifier, Optional<byte[]> possessionNonce) {
@@ -9260,7 +9259,7 @@
       BaseTLVType possessionNoncetlvValue = possessionNonce.<BaseTLVType>map((nonOptionalpossessionNonce) -> new ByteArrayType(nonOptionalpossessionNonce)).orElse(new EmptyType());
       elements.add(new StructElement(possessionNonceFieldID, possessionNoncetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -9282,7 +9281,7 @@
             }
           }
           callback.onSuccess(identity, possessionSignature);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface ScanNetworksResponseCallback extends BaseClusterCallback {
@@ -9812,7 +9811,7 @@
       BaseTLVType transferFileDesignatortlvValue = transferFileDesignator.<BaseTLVType>map((nonOptionaltransferFileDesignator) -> new StringType(nonOptionaltransferFileDesignator)).orElse(new EmptyType());
       elements.add(new StructElement(transferFileDesignatorFieldID, transferFileDesignatortlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -9848,7 +9847,7 @@
             }
           }
           callback.onSuccess(status, logContent, UTCTimeStamp, timeSinceBoot);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface RetrieveLogsResponseCallback extends BaseClusterCallback {
@@ -10067,12 +10066,12 @@
       BaseTLVType eventTriggertlvValue = new UIntType(eventTrigger);
       elements.add(new StructElement(eventTriggerFieldID, eventTriggertlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void timeSnapshot(TimeSnapshotResponseCallback callback) {
@@ -10083,7 +10082,7 @@
       final long commandId = 1L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -10105,13 +10104,55 @@
             }
           }
           callback.onSuccess(systemTimeMs, posixTimeMs);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
+    }
+
+    public void payloadTestRequest(PayloadTestResponseCallback callback, byte[] enableKey, Integer value, Integer count) {
+      payloadTestRequest(callback, enableKey, value, count, 0);
+    }
+
+    public void payloadTestRequest(PayloadTestResponseCallback callback, byte[] enableKey, Integer value, Integer count, int timedInvokeTimeoutMs) {
+      final long commandId = 3L;
+
+      ArrayList<StructElement> elements = new ArrayList<>();
+      final long enableKeyFieldID = 0L;
+      BaseTLVType enableKeytlvValue = new ByteArrayType(enableKey);
+      elements.add(new StructElement(enableKeyFieldID, enableKeytlvValue));
+
+      final long valueFieldID = 1L;
+      BaseTLVType valuetlvValue = new UIntType(value);
+      elements.add(new StructElement(valueFieldID, valuetlvValue));
+
+      final long countFieldID = 2L;
+      BaseTLVType counttlvValue = new UIntType(count);
+      elements.add(new StructElement(countFieldID, counttlvValue));
+
+      StructType commandArgs = new StructType(elements);
+      invoke(new InvokeCallbackImpl(callback) {
+          @Override
+          public void onResponse(StructType invokeStructValue) {
+          final long payloadFieldID = 0L;
+          byte[] payload = null;
+          for (StructElement element: invokeStructValue.value()) {
+            if (element.contextTagNum() == payloadFieldID) {
+              if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) {
+                ByteArrayType castingValue = element.value(ByteArrayType.class);
+                payload = castingValue.value(byte[].class);
+              }
+            }
+          }
+          callback.onSuccess(payload);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface TimeSnapshotResponseCallback extends BaseClusterCallback {
       void onSuccess(Long systemTimeMs, @Nullable Long posixTimeMs);
     }
 
+    public interface PayloadTestResponseCallback extends BaseClusterCallback {
+      void onSuccess(byte[] payload);
+    }
+
     public interface NetworkInterfacesAttributeCallback extends BaseAttributeCallback {
       void onSuccess(List<ChipStructs.GeneralDiagnosticsClusterNetworkInterface> value);
     }
@@ -10552,12 +10593,12 @@
       final long commandId = 0L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface ThreadMetricsAttributeCallback extends BaseAttributeCallback {
@@ -10922,12 +10963,12 @@
       final long commandId = 0L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface ChannelAttributeCallback extends BaseAttributeCallback {
@@ -12793,12 +12834,12 @@
       final long commandId = 0L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface BssidAttributeCallback extends BaseAttributeCallback {
@@ -13382,12 +13423,12 @@
       final long commandId = 0L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface PHYRateAttributeCallback extends BaseAttributeCallback {
@@ -13847,12 +13888,12 @@
       BaseTLVType timeSourcetlvValue = timeSource.<BaseTLVType>map((nonOptionaltimeSource) -> new UIntType(nonOptionaltimeSource)).orElse(new EmptyType());
       elements.add(new StructElement(timeSourceFieldID, timeSourcetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void setTrustedTimeSource(DefaultClusterCallback callback, @Nullable ChipStructs.TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct trustedTimeSource) {
@@ -13867,12 +13908,12 @@
       BaseTLVType trustedTimeSourcetlvValue = trustedTimeSource != null ? trustedTimeSource.encodeTlv() : new NullType();
       elements.add(new StructElement(trustedTimeSourceFieldID, trustedTimeSourcetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void setTimeZone(SetTimeZoneResponseCallback callback, ArrayList<ChipStructs.TimeSynchronizationClusterTimeZoneStruct> timeZone) {
@@ -13887,7 +13928,7 @@
       BaseTLVType timeZonetlvValue = ArrayType.generateArrayType(timeZone, (elementtimeZone) -> elementtimeZone.encodeTlv());
       elements.add(new StructElement(timeZoneFieldID, timeZonetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -13902,7 +13943,7 @@
             }
           }
           callback.onSuccess(DSTOffsetRequired);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void setDSTOffset(DefaultClusterCallback callback, ArrayList<ChipStructs.TimeSynchronizationClusterDSTOffsetStruct> DSTOffset) {
@@ -13917,12 +13958,12 @@
       BaseTLVType DSTOffsettlvValue = ArrayType.generateArrayType(DSTOffset, (elementDSTOffset) -> elementDSTOffset.encodeTlv());
       elements.add(new StructElement(DSTOffsetFieldID, DSTOffsettlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void setDefaultNTP(DefaultClusterCallback callback, @Nullable String defaultNTP) {
@@ -13937,12 +13978,12 @@
       BaseTLVType defaultNTPtlvValue = defaultNTP != null ? new StringType(defaultNTP) : new NullType();
       elements.add(new StructElement(defaultNTPFieldID, defaultNTPtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface SetTimeZoneResponseCallback extends BaseClusterCallback {
@@ -15394,12 +15435,12 @@
       BaseTLVType salttlvValue = new ByteArrayType(salt);
       elements.add(new StructElement(saltFieldID, salttlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -15411,12 +15452,12 @@
       BaseTLVType commissioningTimeouttlvValue = new UIntType(commissioningTimeout);
       elements.add(new StructElement(commissioningTimeoutFieldID, commissioningTimeouttlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -15424,12 +15465,12 @@
       final long commandId = 2L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface AdminFabricIndexAttributeCallback extends BaseAttributeCallback {
@@ -15720,7 +15761,7 @@
       BaseTLVType attestationNoncetlvValue = new ByteArrayType(attestationNonce);
       elements.add(new StructElement(attestationNonceFieldID, attestationNoncetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -15742,7 +15783,7 @@
             }
           }
           callback.onSuccess(attestationElements, attestationSignature);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void certificateChainRequest(CertificateChainResponseCallback callback, Integer certificateType) {
@@ -15757,7 +15798,7 @@
       BaseTLVType certificateTypetlvValue = new UIntType(certificateType);
       elements.add(new StructElement(certificateTypeFieldID, certificateTypetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -15772,7 +15813,7 @@
             }
           }
           callback.onSuccess(certificate);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void CSRRequest(CSRResponseCallback callback, byte[] CSRNonce, Optional<Boolean> isForUpdateNOC) {
@@ -15791,7 +15832,7 @@
       BaseTLVType isForUpdateNOCtlvValue = isForUpdateNOC.<BaseTLVType>map((nonOptionalisForUpdateNOC) -> new BooleanType(nonOptionalisForUpdateNOC)).orElse(new EmptyType());
       elements.add(new StructElement(isForUpdateNOCFieldID, isForUpdateNOCtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -15813,7 +15854,7 @@
             }
           }
           callback.onSuccess(NOCSRElements, attestationSignature);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void addNOC(NOCResponseCallback callback, byte[] NOCValue, Optional<byte[]> ICACValue, byte[] IPKValue, Long caseAdminSubject, Integer adminVendorId) {
@@ -15844,7 +15885,7 @@
       BaseTLVType adminVendorIdtlvValue = new UIntType(adminVendorId);
       elements.add(new StructElement(adminVendorIdFieldID, adminVendorIdtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -15873,7 +15914,7 @@
             }
           }
           callback.onSuccess(statusCode, fabricIndex, debugText);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void updateNOC(NOCResponseCallback callback, byte[] NOCValue, Optional<byte[]> ICACValue) {
@@ -15892,7 +15933,7 @@
       BaseTLVType ICACValuetlvValue = ICACValue.<BaseTLVType>map((nonOptionalICACValue) -> new ByteArrayType(nonOptionalICACValue)).orElse(new EmptyType());
       elements.add(new StructElement(ICACValueFieldID, ICACValuetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -15921,7 +15962,7 @@
             }
           }
           callback.onSuccess(statusCode, fabricIndex, debugText);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void updateFabricLabel(NOCResponseCallback callback, String label) {
@@ -15936,7 +15977,7 @@
       BaseTLVType labeltlvValue = new StringType(label);
       elements.add(new StructElement(labelFieldID, labeltlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -15965,7 +16006,7 @@
             }
           }
           callback.onSuccess(statusCode, fabricIndex, debugText);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void removeFabric(NOCResponseCallback callback, Integer fabricIndex) {
@@ -15980,7 +16021,7 @@
       BaseTLVType fabricIndextlvValue = new UIntType(fabricIndex);
       elements.add(new StructElement(fabricIndexFieldID, fabricIndextlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -16009,7 +16050,7 @@
             }
           }
           callback.onSuccess(statusCode, fabricIndex, debugText);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void addTrustedRootCertificate(DefaultClusterCallback callback, byte[] rootCACertificate) {
@@ -16024,12 +16065,12 @@
       BaseTLVType rootCACertificatetlvValue = new ByteArrayType(rootCACertificate);
       elements.add(new StructElement(rootCACertificateFieldID, rootCACertificatetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface AttestationResponseCallback extends BaseClusterCallback {
@@ -16423,12 +16464,12 @@
       BaseTLVType groupKeySettlvValue = groupKeySet.encodeTlv();
       elements.add(new StructElement(groupKeySetFieldID, groupKeySettlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void keySetRead(KeySetReadResponseCallback callback, Integer groupKeySetID) {
@@ -16443,7 +16484,7 @@
       BaseTLVType groupKeySetIDtlvValue = new UIntType(groupKeySetID);
       elements.add(new StructElement(groupKeySetIDFieldID, groupKeySetIDtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -16458,7 +16499,7 @@
             }
           }
           callback.onSuccess(groupKeySet);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void keySetRemove(DefaultClusterCallback callback, Integer groupKeySetID) {
@@ -16473,12 +16514,12 @@
       BaseTLVType groupKeySetIDtlvValue = new UIntType(groupKeySetID);
       elements.add(new StructElement(groupKeySetIDFieldID, groupKeySetIDtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void keySetReadAllIndices(KeySetReadAllIndicesResponseCallback callback) {
@@ -16489,7 +16530,7 @@
       final long commandId = 4L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -16504,7 +16545,7 @@
             }
           }
           callback.onSuccess(groupKeySetIDs);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface KeySetReadResponseCallback extends BaseClusterCallback {
@@ -18079,7 +18120,7 @@
       BaseTLVType verificationKeytlvValue = verificationKey.<BaseTLVType>map((nonOptionalverificationKey) -> new ByteArrayType(nonOptionalverificationKey)).orElse(new EmptyType());
       elements.add(new StructElement(verificationKeyFieldID, verificationKeytlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -18094,7 +18135,7 @@
             }
           }
           callback.onSuccess(ICDCounter);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void unregisterClient(DefaultClusterCallback callback, Long checkInNodeID, Optional<byte[]> verificationKey) {
@@ -18113,12 +18154,12 @@
       BaseTLVType verificationKeytlvValue = verificationKey.<BaseTLVType>map((nonOptionalverificationKey) -> new ByteArrayType(nonOptionalverificationKey)).orElse(new EmptyType());
       elements.add(new StructElement(verificationKeyFieldID, verificationKeytlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void stayActiveRequest(StayActiveResponseCallback callback) {
@@ -18129,7 +18170,7 @@
       final long commandId = 3L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -18144,7 +18185,7 @@
             }
           }
           callback.onSuccess(promisedActiveDuration);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface RegisterClientResponseCallback extends BaseClusterCallback {
@@ -18591,12 +18632,12 @@
       BaseTLVType newTimetlvValue = new UIntType(newTime);
       elements.add(new StructElement(newTimeFieldID, newTimetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void resetTimer(DefaultClusterCallback callback) {
@@ -18607,12 +18648,12 @@
       final long commandId = 1L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void addTime(DefaultClusterCallback callback, Long additionalTime) {
@@ -18627,12 +18668,12 @@
       BaseTLVType additionalTimetlvValue = new UIntType(additionalTime);
       elements.add(new StructElement(additionalTimeFieldID, additionalTimetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void reduceTime(DefaultClusterCallback callback, Long timeReduction) {
@@ -18647,12 +18688,12 @@
       BaseTLVType timeReductiontlvValue = new UIntType(timeReduction);
       elements.add(new StructElement(timeReductionFieldID, timeReductiontlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback {
@@ -18931,7 +18972,7 @@
       final long commandId = 0L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -18946,7 +18987,7 @@
             }
           }
           callback.onSuccess(commandResponseState);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void stop(OperationalCommandResponseCallback callback) {
@@ -18957,7 +18998,7 @@
       final long commandId = 1L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -18972,7 +19013,7 @@
             }
           }
           callback.onSuccess(commandResponseState);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void start(OperationalCommandResponseCallback callback) {
@@ -18983,7 +19024,7 @@
       final long commandId = 2L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -18998,7 +19039,7 @@
             }
           }
           callback.onSuccess(commandResponseState);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void resume(OperationalCommandResponseCallback callback) {
@@ -19009,7 +19050,7 @@
       final long commandId = 3L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -19024,7 +19065,7 @@
             }
           }
           callback.onSuccess(commandResponseState);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface OperationalCommandResponseCallback extends BaseClusterCallback {
@@ -19404,7 +19445,7 @@
       BaseTLVType newModetlvValue = new UIntType(newMode);
       elements.add(new StructElement(newModeFieldID, newModetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -19426,7 +19467,7 @@
             }
           }
           callback.onSuccess(status, statusText);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface ChangeToModeResponseCallback extends BaseClusterCallback {
@@ -20024,12 +20065,12 @@
       BaseTLVType newModetlvValue = new UIntType(newMode);
       elements.add(new StructElement(newModeFieldID, newModetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface StandardNamespaceAttributeCallback extends BaseAttributeCallback {
@@ -20419,7 +20460,7 @@
       BaseTLVType newModetlvValue = new UIntType(newMode);
       elements.add(new StructElement(newModeFieldID, newModetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -20441,7 +20482,7 @@
             }
           }
           callback.onSuccess(status, statusText);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface ChangeToModeResponseCallback extends BaseClusterCallback {
@@ -20781,7 +20822,7 @@
       BaseTLVType newModetlvValue = new UIntType(newMode);
       elements.add(new StructElement(newModeFieldID, newModetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -20803,7 +20844,7 @@
             }
           }
           callback.onSuccess(status, statusText);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface ChangeToModeResponseCallback extends BaseClusterCallback {
@@ -21462,7 +21503,7 @@
       BaseTLVType newModetlvValue = new UIntType(newMode);
       elements.add(new StructElement(newModeFieldID, newModetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -21484,7 +21525,7 @@
             }
           }
           callback.onSuccess(status, statusText);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface ChangeToModeResponseCallback extends BaseClusterCallback {
@@ -21746,7 +21787,7 @@
       BaseTLVType newModetlvValue = new UIntType(newMode);
       elements.add(new StructElement(newModeFieldID, newModetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -21768,7 +21809,7 @@
             }
           }
           callback.onSuccess(status, statusText);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface ChangeToModeResponseCallback extends BaseClusterCallback {
@@ -22038,12 +22079,12 @@
       BaseTLVType targetTemperatureLeveltlvValue = targetTemperatureLevel.<BaseTLVType>map((nonOptionaltargetTemperatureLevel) -> new UIntType(nonOptionaltargetTemperatureLevel)).orElse(new EmptyType());
       elements.add(new StructElement(targetTemperatureLevelFieldID, targetTemperatureLeveltlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface SupportedTemperatureLevelsAttributeCallback extends BaseAttributeCallback {
@@ -22668,7 +22709,7 @@
       BaseTLVType newModetlvValue = new UIntType(newMode);
       elements.add(new StructElement(newModeFieldID, newModetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -22690,7 +22731,7 @@
             }
           }
           callback.onSuccess(status, statusText);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface ChangeToModeResponseCallback extends BaseClusterCallback {
@@ -23248,12 +23289,12 @@
       final long commandId = 0L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback {
@@ -23793,12 +23834,12 @@
       BaseTLVType alarmstlvValue = new UIntType(alarms);
       elements.add(new StructElement(alarmsFieldID, alarmstlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void modifyEnabledAlarms(DefaultClusterCallback callback, Long mask) {
@@ -23813,12 +23854,12 @@
       BaseTLVType masktlvValue = new UIntType(mask);
       elements.add(new StructElement(maskFieldID, masktlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback {
@@ -24388,12 +24429,12 @@
       BaseTLVType startAfterSettingtlvValue = startAfterSetting.<BaseTLVType>map((nonOptionalstartAfterSetting) -> new BooleanType(nonOptionalstartAfterSetting)).orElse(new EmptyType());
       elements.add(new StructElement(startAfterSettingFieldID, startAfterSettingtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void addMoreTime(DefaultClusterCallback callback, Long timeToAdd) {
@@ -24408,12 +24449,12 @@
       BaseTLVType timeToAddtlvValue = new UIntType(timeToAdd);
       elements.add(new StructElement(timeToAddFieldID, timeToAddtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface SupportedWattsAttributeCallback extends BaseAttributeCallback {
@@ -24846,7 +24887,7 @@
       final long commandId = 0L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -24861,7 +24902,7 @@
             }
           }
           callback.onSuccess(commandResponseState);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void stop(OperationalCommandResponseCallback callback) {
@@ -24872,7 +24913,7 @@
       final long commandId = 1L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -24887,7 +24928,7 @@
             }
           }
           callback.onSuccess(commandResponseState);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void start(OperationalCommandResponseCallback callback) {
@@ -24898,7 +24939,7 @@
       final long commandId = 2L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -24913,7 +24954,7 @@
             }
           }
           callback.onSuccess(commandResponseState);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void resume(OperationalCommandResponseCallback callback) {
@@ -24924,7 +24965,7 @@
       final long commandId = 3L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -24939,7 +24980,7 @@
             }
           }
           callback.onSuccess(commandResponseState);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface OperationalCommandResponseCallback extends BaseClusterCallback {
@@ -25317,7 +25358,7 @@
       final long commandId = 0L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -25332,7 +25373,7 @@
             }
           }
           callback.onSuccess(commandResponseState);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void resume(OperationalCommandResponseCallback callback) {
@@ -25343,7 +25384,7 @@
       final long commandId = 3L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -25358,7 +25399,7 @@
             }
           }
           callback.onSuccess(commandResponseState);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void goHome(OperationalCommandResponseCallback callback) {
@@ -25369,7 +25410,7 @@
       final long commandId = 128L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -25384,7 +25425,7 @@
             }
           }
           callback.onSuccess(commandResponseState);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface OperationalCommandResponseCallback extends BaseClusterCallback {
@@ -25779,7 +25820,7 @@
       BaseTLVType extensionFieldSetstlvValue = ArrayType.generateArrayType(extensionFieldSets, (elementextensionFieldSets) -> elementextensionFieldSets.encodeTlv());
       elements.add(new StructElement(extensionFieldSetsFieldID, extensionFieldSetstlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -25808,7 +25849,7 @@
             }
           }
           callback.onSuccess(status, groupID, sceneID);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void viewScene(ViewSceneResponseCallback callback, Integer groupID, Integer sceneID) {
@@ -25827,7 +25868,7 @@
       BaseTLVType sceneIDtlvValue = new UIntType(sceneID);
       elements.add(new StructElement(sceneIDFieldID, sceneIDtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -25877,7 +25918,7 @@
             }
           }
           callback.onSuccess(status, groupID, sceneID, transitionTime, sceneName, extensionFieldSets);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void removeScene(RemoveSceneResponseCallback callback, Integer groupID, Integer sceneID) {
@@ -25896,7 +25937,7 @@
       BaseTLVType sceneIDtlvValue = new UIntType(sceneID);
       elements.add(new StructElement(sceneIDFieldID, sceneIDtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -25925,7 +25966,7 @@
             }
           }
           callback.onSuccess(status, groupID, sceneID);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void removeAllScenes(RemoveAllScenesResponseCallback callback, Integer groupID) {
@@ -25940,7 +25981,7 @@
       BaseTLVType groupIDtlvValue = new UIntType(groupID);
       elements.add(new StructElement(groupIDFieldID, groupIDtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -25962,7 +26003,7 @@
             }
           }
           callback.onSuccess(status, groupID);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void storeScene(StoreSceneResponseCallback callback, Integer groupID, Integer sceneID) {
@@ -25981,7 +26022,7 @@
       BaseTLVType sceneIDtlvValue = new UIntType(sceneID);
       elements.add(new StructElement(sceneIDFieldID, sceneIDtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -26010,7 +26051,7 @@
             }
           }
           callback.onSuccess(status, groupID, sceneID);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void recallScene(DefaultClusterCallback callback, Integer groupID, Integer sceneID, @Nullable Optional<Long> transitionTime) {
@@ -26033,12 +26074,12 @@
       BaseTLVType transitionTimetlvValue = transitionTime != null ? transitionTime.<BaseTLVType>map((nonOptionaltransitionTime) -> new UIntType(nonOptionaltransitionTime)).orElse(new EmptyType()) : new NullType();
       elements.add(new StructElement(transitionTimeFieldID, transitionTimetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void getSceneMembership(GetSceneMembershipResponseCallback callback, Integer groupID) {
@@ -26053,7 +26094,7 @@
       BaseTLVType groupIDtlvValue = new UIntType(groupID);
       elements.add(new StructElement(groupIDFieldID, groupIDtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -26089,7 +26130,7 @@
             }
           }
           callback.onSuccess(status, capacity, groupID, sceneList);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void copyScene(CopySceneResponseCallback callback, Integer mode, Integer groupIdentifierFrom, Integer sceneIdentifierFrom, Integer groupIdentifierTo, Integer sceneIdentifierTo) {
@@ -26120,7 +26161,7 @@
       BaseTLVType sceneIdentifierTotlvValue = new UIntType(sceneIdentifierTo);
       elements.add(new StructElement(sceneIdentifierToFieldID, sceneIdentifierTotlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -26149,7 +26190,7 @@
             }
           }
           callback.onSuccess(status, groupIdentifierFrom, sceneIdentifierFrom);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface AddSceneResponseCallback extends BaseClusterCallback {
@@ -26469,12 +26510,12 @@
       final long commandId = 0L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface LastChangedTimeAttributeCallback extends BaseAttributeCallback {
@@ -26845,12 +26886,12 @@
       final long commandId = 0L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface LastChangedTimeAttributeCallback extends BaseAttributeCallback {
@@ -27227,12 +27268,12 @@
       BaseTLVType alarmsToSuppresstlvValue = new UIntType(alarmsToSuppress);
       elements.add(new StructElement(alarmsToSuppressFieldID, alarmsToSuppresstlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void enableDisableAlarm(DefaultClusterCallback callback, Integer alarmsToEnableDisable) {
@@ -27247,12 +27288,12 @@
       BaseTLVType alarmsToEnableDisabletlvValue = new UIntType(alarmsToEnableDisable);
       elements.add(new StructElement(alarmsToEnableDisableFieldID, alarmsToEnableDisabletlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback {
@@ -27678,12 +27719,12 @@
       BaseTLVType targetLeveltlvValue = targetLevel.<BaseTLVType>map((nonOptionaltargetLevel) -> new UIntType(nonOptionaltargetLevel)).orElse(new EmptyType());
       elements.add(new StructElement(targetLevelFieldID, targetLeveltlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void close(DefaultClusterCallback callback) {
@@ -27694,12 +27735,12 @@
       final long commandId = 1L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface OpenDurationAttributeCallback extends BaseAttributeCallback {
@@ -29350,12 +29391,12 @@
       BaseTLVType loadControlProgramtlvValue = loadControlProgram.encodeTlv();
       elements.add(new StructElement(loadControlProgramFieldID, loadControlProgramtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void unregisterLoadControlProgramRequest(DefaultClusterCallback callback, byte[] loadControlProgramID) {
@@ -29370,12 +29411,12 @@
       BaseTLVType loadControlProgramIDtlvValue = new ByteArrayType(loadControlProgramID);
       elements.add(new StructElement(loadControlProgramIDFieldID, loadControlProgramIDtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void addLoadControlEventRequest(DefaultClusterCallback callback, ChipStructs.DemandResponseLoadControlClusterLoadControlEventStruct event) {
@@ -29390,12 +29431,12 @@
       BaseTLVType eventtlvValue = event.encodeTlv();
       elements.add(new StructElement(eventFieldID, eventtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void removeLoadControlEventRequest(DefaultClusterCallback callback, byte[] eventID, Integer cancelControl) {
@@ -29414,12 +29455,12 @@
       BaseTLVType cancelControltlvValue = new UIntType(cancelControl);
       elements.add(new StructElement(cancelControlFieldID, cancelControltlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void clearLoadControlEventsRequest(DefaultClusterCallback callback) {
@@ -29430,12 +29471,12 @@
       final long commandId = 4L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface LoadControlProgramsAttributeCallback extends BaseAttributeCallback {
@@ -29893,12 +29934,12 @@
       BaseTLVType responsestlvValue = responses.<BaseTLVType>map((nonOptionalresponses) -> ArrayType.generateArrayType(nonOptionalresponses, (elementnonOptionalresponses) -> elementnonOptionalresponses.encodeTlv())).orElse(new EmptyType());
       elements.add(new StructElement(responsesFieldID, responsestlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void cancelMessagesRequest(DefaultClusterCallback callback, ArrayList<byte[]> messageIDs) {
@@ -29913,12 +29954,12 @@
       BaseTLVType messageIDstlvValue = ArrayType.generateArrayType(messageIDs, (elementmessageIDs) -> new ByteArrayType(elementmessageIDs));
       elements.add(new StructElement(messageIDsFieldID, messageIDstlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface MessagesAttributeCallback extends BaseAttributeCallback {
@@ -30194,12 +30235,12 @@
       BaseTLVType causetlvValue = new UIntType(cause);
       elements.add(new StructElement(causeFieldID, causetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void cancelPowerAdjustRequest(DefaultClusterCallback callback) {
@@ -30210,12 +30251,12 @@
       final long commandId = 1L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void startTimeAdjustRequest(DefaultClusterCallback callback, Long requestedStartTime, Integer cause) {
@@ -30234,12 +30275,12 @@
       BaseTLVType causetlvValue = new UIntType(cause);
       elements.add(new StructElement(causeFieldID, causetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void pauseRequest(DefaultClusterCallback callback, Long duration, Integer cause) {
@@ -30258,12 +30299,12 @@
       BaseTLVType causetlvValue = new UIntType(cause);
       elements.add(new StructElement(causeFieldID, causetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void resumeRequest(DefaultClusterCallback callback) {
@@ -30274,12 +30315,12 @@
       final long commandId = 4L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void modifyForecastRequest(DefaultClusterCallback callback, Long forecastId, ArrayList<ChipStructs.DeviceEnergyManagementClusterSlotAdjustmentStruct> slotAdjustments, Integer cause) {
@@ -30302,12 +30343,12 @@
       BaseTLVType causetlvValue = new UIntType(cause);
       elements.add(new StructElement(causeFieldID, causetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void requestConstraintBasedForecast(DefaultClusterCallback callback, ArrayList<ChipStructs.DeviceEnergyManagementClusterConstraintsStruct> constraints, Integer cause) {
@@ -30326,12 +30367,12 @@
       BaseTLVType causetlvValue = new UIntType(cause);
       elements.add(new StructElement(causeFieldID, causetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void cancelRequest(DefaultClusterCallback callback) {
@@ -30342,12 +30383,12 @@
       final long commandId = 7L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface PowerAdjustmentCapabilityAttributeCallback extends BaseAttributeCallback {
@@ -30773,12 +30814,12 @@
       final long commandId = 1L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -30798,12 +30839,12 @@
       BaseTLVType maximumChargeCurrenttlvValue = new IntType(maximumChargeCurrent);
       elements.add(new StructElement(maximumChargeCurrentFieldID, maximumChargeCurrenttlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -30819,12 +30860,12 @@
       BaseTLVType maximumDischargeCurrenttlvValue = new IntType(maximumDischargeCurrent);
       elements.add(new StructElement(maximumDischargeCurrentFieldID, maximumDischargeCurrenttlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -30832,12 +30873,12 @@
       final long commandId = 4L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -30849,12 +30890,12 @@
       BaseTLVType chargingTargetSchedulestlvValue = ArrayType.generateArrayType(chargingTargetSchedules, (elementchargingTargetSchedules) -> elementchargingTargetSchedules.encodeTlv());
       elements.add(new StructElement(chargingTargetSchedulesFieldID, chargingTargetSchedulestlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -30862,7 +30903,7 @@
       final long commandId = 6L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -30877,7 +30918,7 @@
             }
           }
           callback.onSuccess(chargingTargetSchedules);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -30885,12 +30926,12 @@
       final long commandId = 7L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface GetTargetsResponseCallback extends BaseClusterCallback {
@@ -32356,7 +32397,7 @@
       BaseTLVType newModetlvValue = new UIntType(newMode);
       elements.add(new StructElement(newModeFieldID, newModetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -32378,7 +32419,7 @@
             }
           }
           callback.onSuccess(status, statusText);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface ChangeToModeResponseCallback extends BaseClusterCallback {
@@ -32718,7 +32759,7 @@
       BaseTLVType newModetlvValue = new UIntType(newMode);
       elements.add(new StructElement(newModeFieldID, newModetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -32740,7 +32781,7 @@
             }
           }
           callback.onSuccess(status, statusText);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface ChangeToModeResponseCallback extends BaseClusterCallback {
@@ -33118,12 +33159,12 @@
       BaseTLVType PINCodetlvValue = PINCode.<BaseTLVType>map((nonOptionalPINCode) -> new ByteArrayType(nonOptionalPINCode)).orElse(new EmptyType());
       elements.add(new StructElement(PINCodeFieldID, PINCodetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -33135,12 +33176,12 @@
       BaseTLVType PINCodetlvValue = PINCode.<BaseTLVType>map((nonOptionalPINCode) -> new ByteArrayType(nonOptionalPINCode)).orElse(new EmptyType());
       elements.add(new StructElement(PINCodeFieldID, PINCodetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -33156,12 +33197,12 @@
       BaseTLVType PINCodetlvValue = PINCode.<BaseTLVType>map((nonOptionalPINCode) -> new ByteArrayType(nonOptionalPINCode)).orElse(new EmptyType());
       elements.add(new StructElement(PINCodeFieldID, PINCodetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void setWeekDaySchedule(DefaultClusterCallback callback, Integer weekDayIndex, Integer userIndex, Integer daysMask, Integer startHour, Integer startMinute, Integer endHour, Integer endMinute) {
@@ -33200,12 +33241,12 @@
       BaseTLVType endMinutetlvValue = new UIntType(endMinute);
       elements.add(new StructElement(endMinuteFieldID, endMinutetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void getWeekDaySchedule(GetWeekDayScheduleResponseCallback callback, Integer weekDayIndex, Integer userIndex) {
@@ -33224,7 +33265,7 @@
       BaseTLVType userIndextlvValue = new UIntType(userIndex);
       elements.add(new StructElement(userIndexFieldID, userIndextlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -33288,7 +33329,7 @@
             }
           }
           callback.onSuccess(weekDayIndex, userIndex, status, daysMask, startHour, startMinute, endHour, endMinute);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void clearWeekDaySchedule(DefaultClusterCallback callback, Integer weekDayIndex, Integer userIndex) {
@@ -33307,12 +33348,12 @@
       BaseTLVType userIndextlvValue = new UIntType(userIndex);
       elements.add(new StructElement(userIndexFieldID, userIndextlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void setYearDaySchedule(DefaultClusterCallback callback, Integer yearDayIndex, Integer userIndex, Long localStartTime, Long localEndTime) {
@@ -33339,12 +33380,12 @@
       BaseTLVType localEndTimetlvValue = new UIntType(localEndTime);
       elements.add(new StructElement(localEndTimeFieldID, localEndTimetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void getYearDaySchedule(GetYearDayScheduleResponseCallback callback, Integer yearDayIndex, Integer userIndex) {
@@ -33363,7 +33404,7 @@
       BaseTLVType userIndextlvValue = new UIntType(userIndex);
       elements.add(new StructElement(userIndexFieldID, userIndextlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -33406,7 +33447,7 @@
             }
           }
           callback.onSuccess(yearDayIndex, userIndex, status, localStartTime, localEndTime);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void clearYearDaySchedule(DefaultClusterCallback callback, Integer yearDayIndex, Integer userIndex) {
@@ -33425,12 +33466,12 @@
       BaseTLVType userIndextlvValue = new UIntType(userIndex);
       elements.add(new StructElement(userIndexFieldID, userIndextlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void setHolidaySchedule(DefaultClusterCallback callback, Integer holidayIndex, Long localStartTime, Long localEndTime, Integer operatingMode) {
@@ -33457,12 +33498,12 @@
       BaseTLVType operatingModetlvValue = new UIntType(operatingMode);
       elements.add(new StructElement(operatingModeFieldID, operatingModetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void getHolidaySchedule(GetHolidayScheduleResponseCallback callback, Integer holidayIndex) {
@@ -33477,7 +33518,7 @@
       BaseTLVType holidayIndextlvValue = new UIntType(holidayIndex);
       elements.add(new StructElement(holidayIndexFieldID, holidayIndextlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -33520,7 +33561,7 @@
             }
           }
           callback.onSuccess(holidayIndex, status, localStartTime, localEndTime, operatingMode);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void clearHolidaySchedule(DefaultClusterCallback callback, Integer holidayIndex) {
@@ -33535,12 +33576,12 @@
       BaseTLVType holidayIndextlvValue = new UIntType(holidayIndex);
       elements.add(new StructElement(holidayIndexFieldID, holidayIndextlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -33576,12 +33617,12 @@
       BaseTLVType credentialRuletlvValue = credentialRule != null ? new UIntType(credentialRule) : new NullType();
       elements.add(new StructElement(credentialRuleFieldID, credentialRuletlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void getUser(GetUserResponseCallback callback, Integer userIndex) {
@@ -33596,7 +33637,7 @@
       BaseTLVType userIndextlvValue = new UIntType(userIndex);
       elements.add(new StructElement(userIndexFieldID, userIndextlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -33674,7 +33715,7 @@
             }
           }
           callback.onSuccess(userIndex, userName, userUniqueID, userStatus, userType, credentialRule, credentials, creatorFabricIndex, lastModifiedFabricIndex, nextUserIndex);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -33686,12 +33727,12 @@
       BaseTLVType userIndextlvValue = new UIntType(userIndex);
       elements.add(new StructElement(userIndexFieldID, userIndextlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -33723,7 +33764,7 @@
       BaseTLVType userTypetlvValue = userType != null ? new UIntType(userType) : new NullType();
       elements.add(new StructElement(userTypeFieldID, userTypetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -33752,7 +33793,7 @@
             }
           }
           callback.onSuccess(status, userIndex, nextCredentialIndex);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void getCredentialStatus(GetCredentialStatusResponseCallback callback, ChipStructs.DoorLockClusterCredentialStruct credential) {
@@ -33767,7 +33808,7 @@
       BaseTLVType credentialtlvValue = credential.encodeTlv();
       elements.add(new StructElement(credentialFieldID, credentialtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -33810,7 +33851,7 @@
             }
           }
           callback.onSuccess(credentialExists, userIndex, creatorFabricIndex, lastModifiedFabricIndex, nextCredentialIndex);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -33822,12 +33863,12 @@
       BaseTLVType credentialtlvValue = credential != null ? credential.encodeTlv() : new NullType();
       elements.add(new StructElement(credentialFieldID, credentialtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -33839,12 +33880,12 @@
       BaseTLVType PINCodetlvValue = PINCode.<BaseTLVType>map((nonOptionalPINCode) -> new ByteArrayType(nonOptionalPINCode)).orElse(new EmptyType());
       elements.add(new StructElement(PINCodeFieldID, PINCodetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -33868,12 +33909,12 @@
       BaseTLVType groupResolvingKeytlvValue = groupResolvingKey.<BaseTLVType>map((nonOptionalgroupResolvingKey) -> new ByteArrayType(nonOptionalgroupResolvingKey)).orElse(new EmptyType());
       elements.add(new StructElement(groupResolvingKeyFieldID, groupResolvingKeytlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -33881,12 +33922,12 @@
       final long commandId = 41L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface GetWeekDayScheduleResponseCallback extends BaseClusterCallback {
@@ -35445,12 +35486,12 @@
       final long commandId = 0L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void downOrClose(DefaultClusterCallback callback) {
@@ -35461,12 +35502,12 @@
       final long commandId = 1L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void stopMotion(DefaultClusterCallback callback) {
@@ -35477,12 +35518,12 @@
       final long commandId = 2L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void goToLiftValue(DefaultClusterCallback callback, Integer liftValue) {
@@ -35497,12 +35538,12 @@
       BaseTLVType liftValuetlvValue = new UIntType(liftValue);
       elements.add(new StructElement(liftValueFieldID, liftValuetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void goToLiftPercentage(DefaultClusterCallback callback, Integer liftPercent100thsValue) {
@@ -35517,12 +35558,12 @@
       BaseTLVType liftPercent100thsValuetlvValue = new UIntType(liftPercent100thsValue);
       elements.add(new StructElement(liftPercent100thsValueFieldID, liftPercent100thsValuetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void goToTiltValue(DefaultClusterCallback callback, Integer tiltValue) {
@@ -35537,12 +35578,12 @@
       BaseTLVType tiltValuetlvValue = new UIntType(tiltValue);
       elements.add(new StructElement(tiltValueFieldID, tiltValuetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void goToTiltPercentage(DefaultClusterCallback callback, Integer tiltPercent100thsValue) {
@@ -35557,12 +35598,12 @@
       BaseTLVType tiltPercent100thsValuetlvValue = new UIntType(tiltPercent100thsValue);
       elements.add(new StructElement(tiltPercent100thsValueFieldID, tiltPercent100thsValuetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface CurrentPositionLiftAttributeCallback extends BaseAttributeCallback {
@@ -36365,12 +36406,12 @@
       BaseTLVType percentOpentlvValue = new UIntType(percentOpen);
       elements.add(new StructElement(percentOpenFieldID, percentOpentlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void barrierControlStop(DefaultClusterCallback callback) {
@@ -36381,12 +36422,12 @@
       final long commandId = 1L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback {
@@ -37852,12 +37893,12 @@
       BaseTLVType amounttlvValue = new IntType(amount);
       elements.add(new StructElement(amountFieldID, amounttlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void setWeeklySchedule(DefaultClusterCallback callback, Integer numberOfTransitionsForSequence, Integer dayOfWeekForSequence, Integer modeForSequence, ArrayList<ChipStructs.ThermostatClusterWeeklyScheduleTransitionStruct> transitions) {
@@ -37884,12 +37925,12 @@
       BaseTLVType transitionstlvValue = ArrayType.generateArrayType(transitions, (elementtransitions) -> elementtransitions.encodeTlv());
       elements.add(new StructElement(transitionsFieldID, transitionstlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void getWeeklySchedule(GetWeeklyScheduleResponseCallback callback, Integer daysToReturn, Integer modeToReturn) {
@@ -37908,7 +37949,7 @@
       BaseTLVType modeToReturntlvValue = new UIntType(modeToReturn);
       elements.add(new StructElement(modeToReturnFieldID, modeToReturntlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -37944,7 +37985,7 @@
             }
           }
           callback.onSuccess(numberOfTransitionsForSequence, dayOfWeekForSequence, modeForSequence, transitions);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void clearWeeklySchedule(DefaultClusterCallback callback) {
@@ -37955,12 +37996,12 @@
       final long commandId = 3L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void setActiveScheduleRequest(DefaultClusterCallback callback, byte[] scheduleHandle) {
@@ -37975,12 +38016,12 @@
       BaseTLVType scheduleHandletlvValue = new ByteArrayType(scheduleHandle);
       elements.add(new StructElement(scheduleHandleFieldID, scheduleHandletlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void setActivePresetRequest(DefaultClusterCallback callback, byte[] presetHandle, Optional<Integer> delayMinutes) {
@@ -37999,12 +38040,12 @@
       BaseTLVType delayMinutestlvValue = delayMinutes.<BaseTLVType>map((nonOptionaldelayMinutes) -> new UIntType(nonOptionaldelayMinutes)).orElse(new EmptyType());
       elements.add(new StructElement(delayMinutesFieldID, delayMinutestlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void startPresetsSchedulesEditRequest(DefaultClusterCallback callback, Integer timeoutSeconds) {
@@ -38019,12 +38060,12 @@
       BaseTLVType timeoutSecondstlvValue = new UIntType(timeoutSeconds);
       elements.add(new StructElement(timeoutSecondsFieldID, timeoutSecondstlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void cancelPresetsSchedulesEditRequest(DefaultClusterCallback callback) {
@@ -38035,12 +38076,12 @@
       final long commandId = 8L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void commitPresetsSchedulesRequest(DefaultClusterCallback callback) {
@@ -38051,12 +38092,12 @@
       final long commandId = 9L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void cancelSetActivePresetRequest(DefaultClusterCallback callback) {
@@ -38067,12 +38108,12 @@
       final long commandId = 10L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void setTemperatureSetpointHoldPolicy(DefaultClusterCallback callback, Integer temperatureSetpointHoldPolicy) {
@@ -38087,12 +38128,12 @@
       BaseTLVType temperatureSetpointHoldPolicytlvValue = new UIntType(temperatureSetpointHoldPolicy);
       elements.add(new StructElement(temperatureSetpointHoldPolicyFieldID, temperatureSetpointHoldPolicytlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface GetWeeklyScheduleResponseCallback extends BaseClusterCallback {
@@ -40234,12 +40275,12 @@
       BaseTLVType lowestOfftlvValue = lowestOff.<BaseTLVType>map((nonOptionallowestOff) -> new BooleanType(nonOptionallowestOff)).orElse(new EmptyType());
       elements.add(new StructElement(lowestOffFieldID, lowestOfftlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface PercentSettingAttributeCallback extends BaseAttributeCallback {
@@ -41163,12 +41204,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void moveHue(DefaultClusterCallback callback, Integer moveMode, Integer rate, Integer optionsMask, Integer optionsOverride) {
@@ -41195,12 +41236,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void stepHue(DefaultClusterCallback callback, Integer stepMode, Integer stepSize, Integer transitionTime, Integer optionsMask, Integer optionsOverride) {
@@ -41231,12 +41272,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void moveToSaturation(DefaultClusterCallback callback, Integer saturation, Integer transitionTime, Integer optionsMask, Integer optionsOverride) {
@@ -41263,12 +41304,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void moveSaturation(DefaultClusterCallback callback, Integer moveMode, Integer rate, Integer optionsMask, Integer optionsOverride) {
@@ -41295,12 +41336,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void stepSaturation(DefaultClusterCallback callback, Integer stepMode, Integer stepSize, Integer transitionTime, Integer optionsMask, Integer optionsOverride) {
@@ -41331,12 +41372,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void moveToHueAndSaturation(DefaultClusterCallback callback, Integer hue, Integer saturation, Integer transitionTime, Integer optionsMask, Integer optionsOverride) {
@@ -41367,12 +41408,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void moveToColor(DefaultClusterCallback callback, Integer colorX, Integer colorY, Integer transitionTime, Integer optionsMask, Integer optionsOverride) {
@@ -41403,12 +41444,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void moveColor(DefaultClusterCallback callback, Integer rateX, Integer rateY, Integer optionsMask, Integer optionsOverride) {
@@ -41435,12 +41476,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void stepColor(DefaultClusterCallback callback, Integer stepX, Integer stepY, Integer transitionTime, Integer optionsMask, Integer optionsOverride) {
@@ -41471,12 +41512,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void moveToColorTemperature(DefaultClusterCallback callback, Integer colorTemperatureMireds, Integer transitionTime, Integer optionsMask, Integer optionsOverride) {
@@ -41503,12 +41544,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void enhancedMoveToHue(DefaultClusterCallback callback, Integer enhancedHue, Integer direction, Integer transitionTime, Integer optionsMask, Integer optionsOverride) {
@@ -41539,12 +41580,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void enhancedMoveHue(DefaultClusterCallback callback, Integer moveMode, Integer rate, Integer optionsMask, Integer optionsOverride) {
@@ -41571,12 +41612,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void enhancedStepHue(DefaultClusterCallback callback, Integer stepMode, Integer stepSize, Integer transitionTime, Integer optionsMask, Integer optionsOverride) {
@@ -41607,12 +41648,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void enhancedMoveToHueAndSaturation(DefaultClusterCallback callback, Integer enhancedHue, Integer saturation, Integer transitionTime, Integer optionsMask, Integer optionsOverride) {
@@ -41643,12 +41684,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void colorLoopSet(DefaultClusterCallback callback, Integer updateFlags, Integer action, Integer direction, Integer time, Integer startHue, Integer optionsMask, Integer optionsOverride) {
@@ -41687,12 +41728,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void stopMoveStep(DefaultClusterCallback callback, Integer optionsMask, Integer optionsOverride) {
@@ -41711,12 +41752,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void moveColorTemperature(DefaultClusterCallback callback, Integer moveMode, Integer rate, Integer colorTemperatureMinimumMireds, Integer colorTemperatureMaximumMireds, Integer optionsMask, Integer optionsOverride) {
@@ -41751,12 +41792,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void stepColorTemperature(DefaultClusterCallback callback, Integer stepMode, Integer stepSize, Integer transitionTime, Integer colorTemperatureMinimumMireds, Integer colorTemperatureMaximumMireds, Integer optionsMask, Integer optionsOverride) {
@@ -41795,12 +41836,12 @@
       BaseTLVType optionsOverridetlvValue = new UIntType(optionsOverride);
       elements.add(new StructElement(optionsOverrideFieldID, optionsOverridetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface NumberOfPrimariesAttributeCallback extends BaseAttributeCallback {
@@ -51563,7 +51604,7 @@
       BaseTLVType matchtlvValue = new StringType(match);
       elements.add(new StructElement(matchFieldID, matchtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -51585,7 +51626,7 @@
             }
           }
           callback.onSuccess(status, data);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void changeChannelByNumber(DefaultClusterCallback callback, Integer majorNumber, Integer minorNumber) {
@@ -51604,12 +51645,12 @@
       BaseTLVType minorNumbertlvValue = new UIntType(minorNumber);
       elements.add(new StructElement(minorNumberFieldID, minorNumbertlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void skipChannel(DefaultClusterCallback callback, Integer count) {
@@ -51624,12 +51665,12 @@
       BaseTLVType counttlvValue = new IntType(count);
       elements.add(new StructElement(countFieldID, counttlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void getProgramGuide(ProgramGuideResponseCallback callback, Optional<Long> startTime, Optional<Long> endTime, Optional<ArrayList<ChipStructs.ChannelClusterChannelInfoStruct>> channelList, Optional<ChipStructs.ChannelClusterPageTokenStruct> pageToken, Optional<Long> recordingFlag, Optional<ArrayList<ChipStructs.ChannelClusterAdditionalInfoStruct>> externalIDList, Optional<byte[]> data) {
@@ -51668,7 +51709,7 @@
       BaseTLVType datatlvValue = data.<BaseTLVType>map((nonOptionaldata) -> new ByteArrayType(nonOptionaldata)).orElse(new EmptyType());
       elements.add(new StructElement(dataFieldID, datatlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -51690,7 +51731,7 @@
             }
           }
           callback.onSuccess(paging, programList);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void recordProgram(DefaultClusterCallback callback, String programIdentifier, Boolean shouldRecordSeries, ArrayList<ChipStructs.ChannelClusterAdditionalInfoStruct> externalIDList, byte[] data) {
@@ -51717,12 +51758,12 @@
       BaseTLVType datatlvValue = new ByteArrayType(data);
       elements.add(new StructElement(dataFieldID, datatlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void cancelRecordProgram(DefaultClusterCallback callback, String programIdentifier, Boolean shouldRecordSeries, ArrayList<ChipStructs.ChannelClusterAdditionalInfoStruct> externalIDList, byte[] data) {
@@ -51749,12 +51790,12 @@
       BaseTLVType datatlvValue = new ByteArrayType(data);
       elements.add(new StructElement(dataFieldID, datatlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface ChangeChannelResponseCallback extends BaseClusterCallback {
@@ -52057,7 +52098,7 @@
       BaseTLVType datatlvValue = data.<BaseTLVType>map((nonOptionaldata) -> new StringType(nonOptionaldata)).orElse(new EmptyType());
       elements.add(new StructElement(dataFieldID, datatlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -52079,7 +52120,7 @@
             }
           }
           callback.onSuccess(status, data);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface NavigateTargetResponseCallback extends BaseClusterCallback {
@@ -52346,7 +52387,7 @@
       final long commandId = 0L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -52368,7 +52409,7 @@
             }
           }
           callback.onSuccess(status, data);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void pause(PlaybackResponseCallback callback) {
@@ -52379,7 +52420,7 @@
       final long commandId = 1L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -52401,7 +52442,7 @@
             }
           }
           callback.onSuccess(status, data);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void stop(PlaybackResponseCallback callback) {
@@ -52412,7 +52453,7 @@
       final long commandId = 2L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -52434,7 +52475,7 @@
             }
           }
           callback.onSuccess(status, data);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void startOver(PlaybackResponseCallback callback) {
@@ -52445,7 +52486,7 @@
       final long commandId = 3L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -52467,7 +52508,7 @@
             }
           }
           callback.onSuccess(status, data);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void previous(PlaybackResponseCallback callback) {
@@ -52478,7 +52519,7 @@
       final long commandId = 4L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -52500,7 +52541,7 @@
             }
           }
           callback.onSuccess(status, data);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void next(PlaybackResponseCallback callback) {
@@ -52511,7 +52552,7 @@
       final long commandId = 5L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -52533,7 +52574,7 @@
             }
           }
           callback.onSuccess(status, data);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void rewind(PlaybackResponseCallback callback, Optional<Boolean> audioAdvanceUnmuted) {
@@ -52548,7 +52589,7 @@
       BaseTLVType audioAdvanceUnmutedtlvValue = audioAdvanceUnmuted.<BaseTLVType>map((nonOptionalaudioAdvanceUnmuted) -> new BooleanType(nonOptionalaudioAdvanceUnmuted)).orElse(new EmptyType());
       elements.add(new StructElement(audioAdvanceUnmutedFieldID, audioAdvanceUnmutedtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -52570,7 +52611,7 @@
             }
           }
           callback.onSuccess(status, data);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void fastForward(PlaybackResponseCallback callback, Optional<Boolean> audioAdvanceUnmuted) {
@@ -52585,7 +52626,7 @@
       BaseTLVType audioAdvanceUnmutedtlvValue = audioAdvanceUnmuted.<BaseTLVType>map((nonOptionalaudioAdvanceUnmuted) -> new BooleanType(nonOptionalaudioAdvanceUnmuted)).orElse(new EmptyType());
       elements.add(new StructElement(audioAdvanceUnmutedFieldID, audioAdvanceUnmutedtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -52607,7 +52648,7 @@
             }
           }
           callback.onSuccess(status, data);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void skipForward(PlaybackResponseCallback callback, Long deltaPositionMilliseconds) {
@@ -52622,7 +52663,7 @@
       BaseTLVType deltaPositionMillisecondstlvValue = new UIntType(deltaPositionMilliseconds);
       elements.add(new StructElement(deltaPositionMillisecondsFieldID, deltaPositionMillisecondstlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -52644,7 +52685,7 @@
             }
           }
           callback.onSuccess(status, data);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void skipBackward(PlaybackResponseCallback callback, Long deltaPositionMilliseconds) {
@@ -52659,7 +52700,7 @@
       BaseTLVType deltaPositionMillisecondstlvValue = new UIntType(deltaPositionMilliseconds);
       elements.add(new StructElement(deltaPositionMillisecondsFieldID, deltaPositionMillisecondstlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -52681,7 +52722,7 @@
             }
           }
           callback.onSuccess(status, data);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void seek(PlaybackResponseCallback callback, Long position) {
@@ -52696,7 +52737,7 @@
       BaseTLVType positiontlvValue = new UIntType(position);
       elements.add(new StructElement(positionFieldID, positiontlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -52718,7 +52759,7 @@
             }
           }
           callback.onSuccess(status, data);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void activateAudioTrack(DefaultClusterCallback callback, String trackID, Integer audioOutputIndex) {
@@ -52737,12 +52778,12 @@
       BaseTLVType audioOutputIndextlvValue = new UIntType(audioOutputIndex);
       elements.add(new StructElement(audioOutputIndexFieldID, audioOutputIndextlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void activateTextTrack(DefaultClusterCallback callback, String trackID) {
@@ -52757,12 +52798,12 @@
       BaseTLVType trackIDtlvValue = new StringType(trackID);
       elements.add(new StructElement(trackIDFieldID, trackIDtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void deactivateTextTrack(DefaultClusterCallback callback) {
@@ -52773,12 +52814,12 @@
       final long commandId = 14L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface PlaybackResponseCallback extends BaseClusterCallback {
@@ -53297,12 +53338,12 @@
       BaseTLVType indextlvValue = new UIntType(index);
       elements.add(new StructElement(indexFieldID, indextlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void showInputStatus(DefaultClusterCallback callback) {
@@ -53313,12 +53354,12 @@
       final long commandId = 1L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void hideInputStatus(DefaultClusterCallback callback) {
@@ -53329,12 +53370,12 @@
       final long commandId = 2L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void renameInput(DefaultClusterCallback callback, Integer index, String name) {
@@ -53353,12 +53394,12 @@
       BaseTLVType nametlvValue = new StringType(name);
       elements.add(new StructElement(nameFieldID, nametlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface InputListAttributeCallback extends BaseAttributeCallback {
@@ -53610,12 +53651,12 @@
       final long commandId = 0L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback {
@@ -53817,7 +53858,7 @@
       BaseTLVType keyCodetlvValue = new UIntType(keyCode);
       elements.add(new StructElement(keyCodeFieldID, keyCodetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -53832,7 +53873,7 @@
             }
           }
           callback.onSuccess(status);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface SendKeyResponseCallback extends BaseClusterCallback {
@@ -54056,7 +54097,7 @@
       BaseTLVType useCurrentContexttlvValue = useCurrentContext.<BaseTLVType>map((nonOptionaluseCurrentContext) -> new BooleanType(nonOptionaluseCurrentContext)).orElse(new EmptyType());
       elements.add(new StructElement(useCurrentContextFieldID, useCurrentContexttlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -54078,7 +54119,7 @@
             }
           }
           callback.onSuccess(status, data);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void launchURL(LauncherResponseCallback callback, String contentURL, Optional<String> displayString, Optional<ChipStructs.ContentLauncherClusterBrandingInformationStruct> brandingInformation) {
@@ -54101,7 +54142,7 @@
       BaseTLVType brandingInformationtlvValue = brandingInformation.<BaseTLVType>map((nonOptionalbrandingInformation) -> nonOptionalbrandingInformation.encodeTlv()).orElse(new EmptyType());
       elements.add(new StructElement(brandingInformationFieldID, brandingInformationtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -54123,7 +54164,7 @@
             }
           }
           callback.onSuccess(status, data);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface LauncherResponseCallback extends BaseClusterCallback {
@@ -54385,12 +54426,12 @@
       BaseTLVType indextlvValue = new UIntType(index);
       elements.add(new StructElement(indexFieldID, indextlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void renameOutput(DefaultClusterCallback callback, Integer index, String name) {
@@ -54409,12 +54450,12 @@
       BaseTLVType nametlvValue = new StringType(name);
       elements.add(new StructElement(nameFieldID, nametlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface OutputListAttributeCallback extends BaseAttributeCallback {
@@ -54676,7 +54717,7 @@
       BaseTLVType datatlvValue = data.<BaseTLVType>map((nonOptionaldata) -> new ByteArrayType(nonOptionaldata)).orElse(new EmptyType());
       elements.add(new StructElement(dataFieldID, datatlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -54698,7 +54739,7 @@
             }
           }
           callback.onSuccess(status, data);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void stopApp(LauncherResponseCallback callback, Optional<ChipStructs.ApplicationLauncherClusterApplicationStruct> application) {
@@ -54713,7 +54754,7 @@
       BaseTLVType applicationtlvValue = application.<BaseTLVType>map((nonOptionalapplication) -> nonOptionalapplication.encodeTlv()).orElse(new EmptyType());
       elements.add(new StructElement(applicationFieldID, applicationtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -54735,7 +54776,7 @@
             }
           }
           callback.onSuccess(status, data);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void hideApp(LauncherResponseCallback callback, Optional<ChipStructs.ApplicationLauncherClusterApplicationStruct> application) {
@@ -54750,7 +54791,7 @@
       BaseTLVType applicationtlvValue = application.<BaseTLVType>map((nonOptionalapplication) -> nonOptionalapplication.encodeTlv()).orElse(new EmptyType());
       elements.add(new StructElement(applicationFieldID, applicationtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -54772,7 +54813,7 @@
             }
           }
           callback.onSuccess(status, data);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface LauncherResponseCallback extends BaseClusterCallback {
@@ -55436,7 +55477,7 @@
       BaseTLVType tempAccountIdentifiertlvValue = new StringType(tempAccountIdentifier);
       elements.add(new StructElement(tempAccountIdentifierFieldID, tempAccountIdentifiertlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -55451,7 +55492,7 @@
             }
           }
           callback.onSuccess(setupPIN);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -55471,12 +55512,12 @@
       BaseTLVType nodetlvValue = node.<BaseTLVType>map((nonOptionalnode) -> new UIntType(nonOptionalnode)).orElse(new EmptyType());
       elements.add(new StructElement(nodeFieldID, nodetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -55488,12 +55529,12 @@
       BaseTLVType nodetlvValue = node.<BaseTLVType>map((nonOptionalnode) -> new UIntType(nonOptionalnode)).orElse(new EmptyType());
       elements.add(new StructElement(nodeFieldID, nodetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface GetSetupPINResponseCallback extends BaseClusterCallback {
@@ -55711,12 +55752,12 @@
       BaseTLVType newPINtlvValue = new StringType(newPIN);
       elements.add(new StructElement(newPINFieldID, newPINtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void resetPIN(ResetPINResponseCallback callback) {
@@ -55727,7 +55768,7 @@
       final long commandId = 1L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -55742,7 +55783,7 @@
             }
           }
           callback.onSuccess(PINCode);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void enable(DefaultClusterCallback callback) {
@@ -55753,12 +55794,12 @@
       final long commandId = 3L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void disable(DefaultClusterCallback callback) {
@@ -55769,12 +55810,12 @@
       final long commandId = 4L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void addBonusTime(DefaultClusterCallback callback, Optional<String> PINCode, Optional<Long> bonusTime) {
@@ -55793,12 +55834,12 @@
       BaseTLVType bonusTimetlvValue = bonusTime.<BaseTLVType>map((nonOptionalbonusTime) -> new UIntType(nonOptionalbonusTime)).orElse(new EmptyType());
       elements.add(new StructElement(bonusTimeFieldID, bonusTimetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void setScreenDailyTime(DefaultClusterCallback callback, Long screenTime) {
@@ -55813,12 +55854,12 @@
       BaseTLVType screenTimetlvValue = new UIntType(screenTime);
       elements.add(new StructElement(screenTimeFieldID, screenTimetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void blockUnratedContent(DefaultClusterCallback callback) {
@@ -55829,12 +55870,12 @@
       final long commandId = 7L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void unblockUnratedContent(DefaultClusterCallback callback) {
@@ -55845,12 +55886,12 @@
       final long commandId = 8L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void setOnDemandRatingThreshold(DefaultClusterCallback callback, String rating) {
@@ -55865,12 +55906,12 @@
       BaseTLVType ratingtlvValue = new StringType(rating);
       elements.add(new StructElement(ratingFieldID, ratingtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void setScheduledContentRatingThreshold(DefaultClusterCallback callback, String rating) {
@@ -55885,12 +55926,12 @@
       BaseTLVType ratingtlvValue = new StringType(rating);
       elements.add(new StructElement(ratingFieldID, ratingtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface ResetPINResponseCallback extends BaseClusterCallback {
@@ -56308,7 +56349,7 @@
       BaseTLVType encodingHinttlvValue = new StringType(encodingHint);
       elements.add(new StructElement(encodingHintFieldID, encodingHinttlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -56337,7 +56378,7 @@
             }
           }
           callback.onSuccess(status, data, encodingHint);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface ContentAppMessageResponseCallback extends BaseClusterCallback {
@@ -56667,12 +56708,12 @@
       final long commandId = 0L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void getMeasurementProfileCommand(DefaultClusterCallback callback, Integer attributeId, Long startTime, Integer numberOfIntervals) {
@@ -56695,12 +56736,12 @@
       BaseTLVType numberOfIntervalstlvValue = new UIntType(numberOfIntervals);
       elements.add(new StructElement(numberOfIntervalsFieldID, numberOfIntervalstlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback {
@@ -60253,12 +60294,12 @@
       final long commandId = 0L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testNotHandled(DefaultClusterCallback callback) {
@@ -60269,12 +60310,12 @@
       final long commandId = 1L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testSpecific(TestSpecificResponseCallback callback) {
@@ -60285,7 +60326,7 @@
       final long commandId = 2L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -60300,7 +60341,7 @@
             }
           }
           callback.onSuccess(returnValue);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testUnknownCommand(DefaultClusterCallback callback) {
@@ -60311,12 +60352,12 @@
       final long commandId = 3L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testAddArguments(TestAddArgumentsResponseCallback callback, Integer arg1, Integer arg2) {
@@ -60335,7 +60376,7 @@
       BaseTLVType arg2tlvValue = new UIntType(arg2);
       elements.add(new StructElement(arg2FieldID, arg2tlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -60350,7 +60391,7 @@
             }
           }
           callback.onSuccess(returnValue);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testSimpleArgumentRequest(TestSimpleArgumentResponseCallback callback, Boolean arg1) {
@@ -60365,7 +60406,7 @@
       BaseTLVType arg1tlvValue = new BooleanType(arg1);
       elements.add(new StructElement(arg1FieldID, arg1tlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -60380,7 +60421,7 @@
             }
           }
           callback.onSuccess(returnValue);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testStructArrayArgumentRequest(TestStructArrayArgumentResponseCallback callback, ArrayList<ChipStructs.UnitTestingClusterNestedStructList> arg1, ArrayList<ChipStructs.UnitTestingClusterSimpleStruct> arg2, ArrayList<Integer> arg3, ArrayList<Boolean> arg4, Integer arg5, Boolean arg6) {
@@ -60415,7 +60456,7 @@
       BaseTLVType arg6tlvValue = new BooleanType(arg6);
       elements.add(new StructElement(arg6FieldID, arg6tlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -60465,7 +60506,7 @@
             }
           }
           callback.onSuccess(arg1, arg2, arg3, arg4, arg5, arg6);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testStructArgumentRequest(BooleanResponseCallback callback, ChipStructs.UnitTestingClusterSimpleStruct arg1) {
@@ -60480,7 +60521,7 @@
       BaseTLVType arg1tlvValue = arg1.encodeTlv();
       elements.add(new StructElement(arg1FieldID, arg1tlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -60495,7 +60536,7 @@
             }
           }
           callback.onSuccess(value);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testNestedStructArgumentRequest(BooleanResponseCallback callback, ChipStructs.UnitTestingClusterNestedStruct arg1) {
@@ -60510,7 +60551,7 @@
       BaseTLVType arg1tlvValue = arg1.encodeTlv();
       elements.add(new StructElement(arg1FieldID, arg1tlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -60525,7 +60566,7 @@
             }
           }
           callback.onSuccess(value);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testListStructArgumentRequest(BooleanResponseCallback callback, ArrayList<ChipStructs.UnitTestingClusterSimpleStruct> arg1) {
@@ -60540,7 +60581,7 @@
       BaseTLVType arg1tlvValue = ArrayType.generateArrayType(arg1, (elementarg1) -> elementarg1.encodeTlv());
       elements.add(new StructElement(arg1FieldID, arg1tlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -60555,7 +60596,7 @@
             }
           }
           callback.onSuccess(value);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testListInt8UArgumentRequest(BooleanResponseCallback callback, ArrayList<Integer> arg1) {
@@ -60570,7 +60611,7 @@
       BaseTLVType arg1tlvValue = ArrayType.generateArrayType(arg1, (elementarg1) -> new UIntType(elementarg1));
       elements.add(new StructElement(arg1FieldID, arg1tlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -60585,7 +60626,7 @@
             }
           }
           callback.onSuccess(value);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testNestedStructListArgumentRequest(BooleanResponseCallback callback, ChipStructs.UnitTestingClusterNestedStructList arg1) {
@@ -60600,7 +60641,7 @@
       BaseTLVType arg1tlvValue = arg1.encodeTlv();
       elements.add(new StructElement(arg1FieldID, arg1tlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -60615,7 +60656,7 @@
             }
           }
           callback.onSuccess(value);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testListNestedStructListArgumentRequest(BooleanResponseCallback callback, ArrayList<ChipStructs.UnitTestingClusterNestedStructList> arg1) {
@@ -60630,7 +60671,7 @@
       BaseTLVType arg1tlvValue = ArrayType.generateArrayType(arg1, (elementarg1) -> elementarg1.encodeTlv());
       elements.add(new StructElement(arg1FieldID, arg1tlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -60645,7 +60686,7 @@
             }
           }
           callback.onSuccess(value);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testListInt8UReverseRequest(TestListInt8UReverseResponseCallback callback, ArrayList<Integer> arg1) {
@@ -60660,7 +60701,7 @@
       BaseTLVType arg1tlvValue = ArrayType.generateArrayType(arg1, (elementarg1) -> new UIntType(elementarg1));
       elements.add(new StructElement(arg1FieldID, arg1tlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -60675,7 +60716,7 @@
             }
           }
           callback.onSuccess(arg1);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testEnumsRequest(TestEnumsResponseCallback callback, Integer arg1, Integer arg2) {
@@ -60694,7 +60735,7 @@
       BaseTLVType arg2tlvValue = new UIntType(arg2);
       elements.add(new StructElement(arg2FieldID, arg2tlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -60716,7 +60757,7 @@
             }
           }
           callback.onSuccess(arg1, arg2);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testNullableOptionalRequest(TestNullableOptionalResponseCallback callback, @Nullable Optional<Integer> arg1) {
@@ -60731,7 +60772,7 @@
       BaseTLVType arg1tlvValue = arg1 != null ? arg1.<BaseTLVType>map((nonOptionalarg1) -> new UIntType(nonOptionalarg1)).orElse(new EmptyType()) : new NullType();
       elements.add(new StructElement(arg1FieldID, arg1tlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -60767,7 +60808,7 @@
             }
           }
           callback.onSuccess(wasPresent, wasNull, value, originalValue);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testComplexNullableOptionalRequest(TestComplexNullableOptionalResponseCallback callback, @Nullable Integer nullableInt, Optional<Integer> optionalInt, @Nullable Optional<Integer> nullableOptionalInt, @Nullable String nullableString, Optional<String> optionalString, @Nullable Optional<String> nullableOptionalString, @Nullable ChipStructs.UnitTestingClusterSimpleStruct nullableStruct, Optional<ChipStructs.UnitTestingClusterSimpleStruct> optionalStruct, @Nullable Optional<ChipStructs.UnitTestingClusterSimpleStruct> nullableOptionalStruct, @Nullable ArrayList<Integer> nullableList, Optional<ArrayList<Integer>> optionalList, @Nullable Optional<ArrayList<Integer>> nullableOptionalList) {
@@ -60826,7 +60867,7 @@
       BaseTLVType nullableOptionalListtlvValue = nullableOptionalList != null ? nullableOptionalList.<BaseTLVType>map((nonOptionalnullableOptionalList) -> ArrayType.generateArrayType(nonOptionalnullableOptionalList, (elementnonOptionalnullableOptionalList) -> new UIntType(elementnonOptionalnullableOptionalList))).orElse(new EmptyType()) : new NullType();
       elements.add(new StructElement(nullableOptionalListFieldID, nullableOptionalListtlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -61030,7 +61071,7 @@
             }
           }
           callback.onSuccess(nullableIntWasNull, nullableIntValue, optionalIntWasPresent, optionalIntValue, nullableOptionalIntWasPresent, nullableOptionalIntWasNull, nullableOptionalIntValue, nullableStringWasNull, nullableStringValue, optionalStringWasPresent, optionalStringValue, nullableOptionalStringWasPresent, nullableOptionalStringWasNull, nullableOptionalStringValue, nullableStructWasNull, nullableStructValue, optionalStructWasPresent, optionalStructValue, nullableOptionalStructWasPresent, nullableOptionalStructWasNull, nullableOptionalStructValue, nullableListWasNull, nullableListValue, optionalListWasPresent, optionalListValue, nullableOptionalListWasPresent, nullableOptionalListWasNull, nullableOptionalListValue);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void simpleStructEchoRequest(SimpleStructResponseCallback callback, ChipStructs.UnitTestingClusterSimpleStruct arg1) {
@@ -61045,7 +61086,7 @@
       BaseTLVType arg1tlvValue = arg1.encodeTlv();
       elements.add(new StructElement(arg1FieldID, arg1tlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -61060,7 +61101,7 @@
             }
           }
           callback.onSuccess(arg1);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
 
@@ -61068,12 +61109,12 @@
       final long commandId = 18L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testSimpleOptionalArgumentRequest(DefaultClusterCallback callback, Optional<Boolean> arg1) {
@@ -61088,12 +61129,12 @@
       BaseTLVType arg1tlvValue = arg1.<BaseTLVType>map((nonOptionalarg1) -> new BooleanType(nonOptionalarg1)).orElse(new EmptyType());
       elements.add(new StructElement(arg1FieldID, arg1tlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testEmitTestEventRequest(TestEmitTestEventResponseCallback callback, Integer arg1, Integer arg2, Boolean arg3) {
@@ -61116,7 +61157,7 @@
       BaseTLVType arg3tlvValue = new BooleanType(arg3);
       elements.add(new StructElement(arg3FieldID, arg3tlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -61131,7 +61172,7 @@
             }
           }
           callback.onSuccess(value);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testEmitTestFabricScopedEventRequest(TestEmitTestFabricScopedEventResponseCallback callback, Integer arg1) {
@@ -61146,7 +61187,7 @@
       BaseTLVType arg1tlvValue = new UIntType(arg1);
       elements.add(new StructElement(arg1FieldID, arg1tlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -61161,7 +61202,7 @@
             }
           }
           callback.onSuccess(value);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testBatchHelperRequest(TestBatchHelperResponseCallback callback, Integer sleepBeforeResponseTimeMs, Integer sizeOfResponseBuffer, Integer fillCharacter) {
@@ -61184,7 +61225,7 @@
       BaseTLVType fillCharactertlvValue = new UIntType(fillCharacter);
       elements.add(new StructElement(fillCharacterFieldID, fillCharactertlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -61199,7 +61240,7 @@
             }
           }
           callback.onSuccess(buffer);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testSecondBatchHelperRequest(TestBatchHelperResponseCallback callback, Integer sleepBeforeResponseTimeMs, Integer sizeOfResponseBuffer, Integer fillCharacter) {
@@ -61222,7 +61263,7 @@
       BaseTLVType fillCharactertlvValue = new UIntType(fillCharacter);
       elements.add(new StructElement(fillCharacterFieldID, fillCharactertlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -61237,7 +61278,7 @@
             }
           }
           callback.onSuccess(buffer);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void testDifferentVendorMeiRequest(TestDifferentVendorMeiResponseCallback callback, Integer arg1) {
@@ -61252,7 +61293,7 @@
       BaseTLVType arg1tlvValue = new UIntType(arg1);
       elements.add(new StructElement(arg1FieldID, arg1tlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -61274,7 +61315,7 @@
             }
           }
           callback.onSuccess(arg1, eventNumber);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface TestSpecificResponseCallback extends BaseClusterCallback {
@@ -64531,12 +64572,12 @@
       BaseTLVType takeMutextlvValue = new BooleanType(takeMutex);
       elements.add(new StructElement(takeMutexFieldID, takeMutextlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void failRandomlyAtFault(DefaultClusterCallback callback, Integer type, Long id, Integer percentage) {
@@ -64559,12 +64600,12 @@
       BaseTLVType percentagetlvValue = new UIntType(percentage);
       elements.add(new StructElement(percentageFieldID, percentagetlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback {
@@ -64763,12 +64804,12 @@
       final long commandId = 0L;
 
       ArrayList<StructElement> elements = new ArrayList<>();
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
           callback.onSuccess();
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public void addArguments(AddArgumentsResponseCallback callback, Integer arg1, Integer arg2) {
@@ -64787,7 +64828,7 @@
       BaseTLVType arg2tlvValue = new UIntType(arg2);
       elements.add(new StructElement(arg2FieldID, arg2tlvValue));
 
-      StructType value = new StructType(elements);
+      StructType commandArgs = new StructType(elements);
       invoke(new InvokeCallbackImpl(callback) {
           @Override
           public void onResponse(StructType invokeStructValue) {
@@ -64802,7 +64843,7 @@
             }
           }
           callback.onSuccess(returnValue);
-        }}, commandId, value, timedInvokeTimeoutMs);
+        }}, commandId, commandArgs, timedInvokeTimeoutMs);
     }
 
     public interface AddArgumentsResponseCallback extends BaseClusterCallback {
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java
index ecb206c..a1d43e3 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java
@@ -3592,7 +3592,8 @@
 
         public enum Command {
             TestEventTrigger(0L),
-            TimeSnapshot(1L),;
+            TimeSnapshot(1L),
+            PayloadTestRequest(3L),;
             private final long id;
             Command(long id) {
                 this.id = id;
@@ -3627,6 +3628,23 @@
                         }
                         throw new NoSuchFieldError();
                     }
+                }public enum PayloadTestRequestCommandField {EnableKey(0),Value(1),Count(2),;
+                    private final int id;
+                    PayloadTestRequestCommandField(int id) {
+                        this.id = id;
+                    }
+
+                    public int getID() {
+                        return id;
+                    }
+                    public static PayloadTestRequestCommandField value(int id) throws NoSuchFieldError {
+                        for (PayloadTestRequestCommandField field : PayloadTestRequestCommandField.values()) {
+                        if (field.getID() == id) {
+                            return field;
+                        }
+                        }
+                        throw new NoSuchFieldError();
+                    }
                 }@Override
         public String getAttributeName(long id) throws NoSuchFieldError {
             return Attribute.value(id).toString();
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java
index f100e1f..14b4a97 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java
@@ -3336,6 +3336,28 @@
       callback.onFailure(error);
     }
   }
+
+  public static class DelegatedGeneralDiagnosticsClusterPayloadTestResponseCallback implements ChipClusters.GeneralDiagnosticsCluster.PayloadTestResponseCallback, DelegatedClusterCallback {
+    private ClusterCommandCallback callback;
+    @Override
+    public void setCallbackDelegate(ClusterCommandCallback callback) {
+      this.callback = callback;
+    }
+
+    @Override
+    public void onSuccess(byte[] payload) {
+      Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>();
+
+      CommandResponseInfo payloadResponseValue = new CommandResponseInfo("payload", "byte[]");
+      responseValues.put(payloadResponseValue, payload);
+      callback.onSuccess(responseValues);
+    }
+
+    @Override
+    public void onError(Exception error) {
+      callback.onFailure(error);
+    }
+  }
   public static class DelegatedGeneralDiagnosticsClusterNetworkInterfacesAttributeCallback implements ChipClusters.GeneralDiagnosticsCluster.NetworkInterfacesAttributeCallback, DelegatedClusterCallback {
     private ClusterCommandCallback callback;
     @Override
@@ -22728,6 +22750,36 @@
       );
     generalDiagnosticsClusterInteractionInfoMap.put("timeSnapshot", generalDiagnosticstimeSnapshotInteractionInfo);
 
+    Map<String, CommandParameterInfo> generalDiagnosticspayloadTestRequestCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
+
+    CommandParameterInfo generalDiagnosticspayloadTestRequestenableKeyCommandParameterInfo = new CommandParameterInfo("enableKey", byte[].class, byte[].class);
+    generalDiagnosticspayloadTestRequestCommandParams.put("enableKey",generalDiagnosticspayloadTestRequestenableKeyCommandParameterInfo);
+
+    CommandParameterInfo generalDiagnosticspayloadTestRequestvalueCommandParameterInfo = new CommandParameterInfo("value", Integer.class, Integer.class);
+    generalDiagnosticspayloadTestRequestCommandParams.put("value",generalDiagnosticspayloadTestRequestvalueCommandParameterInfo);
+
+    CommandParameterInfo generalDiagnosticspayloadTestRequestcountCommandParameterInfo = new CommandParameterInfo("count", Integer.class, Integer.class);
+    generalDiagnosticspayloadTestRequestCommandParams.put("count",generalDiagnosticspayloadTestRequestcountCommandParameterInfo);
+    InteractionInfo generalDiagnosticspayloadTestRequestInteractionInfo = new InteractionInfo(
+      (cluster, callback, commandArguments) -> {
+        ((ChipClusters.GeneralDiagnosticsCluster) cluster)
+          .payloadTestRequest((ChipClusters.GeneralDiagnosticsCluster.PayloadTestResponseCallback) callback
+           , (byte[])
+             commandArguments.get("enableKey")
+
+           , (Integer)
+             commandArguments.get("value")
+
+           , (Integer)
+             commandArguments.get("count")
+
+            );
+        },
+        () -> new DelegatedGeneralDiagnosticsClusterPayloadTestResponseCallback(),
+        generalDiagnosticspayloadTestRequestCommandParams
+      );
+    generalDiagnosticsClusterInteractionInfoMap.put("payloadTestRequest", generalDiagnosticspayloadTestRequestInteractionInfo);
+
     commandMap.put("generalDiagnostics", generalDiagnosticsClusterInteractionInfoMap);
 
     Map<String, InteractionInfo> softwareDiagnosticsClusterInteractionInfoMap = new LinkedHashMap<>();
diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralDiagnosticsCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralDiagnosticsCluster.kt
index cdc7a18..192e15b 100644
--- a/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralDiagnosticsCluster.kt
+++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralDiagnosticsCluster.kt
@@ -48,6 +48,8 @@
 ) {
   class TimeSnapshotResponse(val systemTimeMs: ULong, val posixTimeMs: ULong?)
 
+  class PayloadTestResponse(val payload: ByteArray)
+
   class NetworkInterfacesAttribute(val value: List<GeneralDiagnosticsClusterNetworkInterface>)
 
   sealed class NetworkInterfacesAttributeSubscriptionState {
@@ -216,6 +218,61 @@
     return TimeSnapshotResponse(systemTimeMs_decoded, posixTimeMs_decoded)
   }
 
+  suspend fun payloadTestRequest(
+    enableKey: ByteArray,
+    value: UByte,
+    count: UShort,
+    timedInvokeTimeout: Duration? = null
+  ): PayloadTestResponse {
+    val commandId: UInt = 3u
+
+    val tlvWriter = TlvWriter()
+    tlvWriter.startStructure(AnonymousTag)
+
+    val TAG_ENABLE_KEY_REQ: Int = 0
+    tlvWriter.put(ContextSpecificTag(TAG_ENABLE_KEY_REQ), enableKey)
+
+    val TAG_VALUE_REQ: Int = 1
+    tlvWriter.put(ContextSpecificTag(TAG_VALUE_REQ), value)
+
+    val TAG_COUNT_REQ: Int = 2
+    tlvWriter.put(ContextSpecificTag(TAG_COUNT_REQ), count)
+    tlvWriter.endStructure()
+
+    val request: InvokeRequest =
+      InvokeRequest(
+        CommandPath(endpointId, clusterId = CLUSTER_ID, commandId),
+        tlvPayload = tlvWriter.getEncoded(),
+        timedRequest = timedInvokeTimeout
+      )
+
+    val response: InvokeResponse = controller.invoke(request)
+    logger.log(Level.FINE, "Invoke command succeeded: ${response}")
+
+    val tlvReader = TlvReader(response.payload)
+    tlvReader.enterStructure(AnonymousTag)
+    val TAG_PAYLOAD: Int = 0
+    var payload_decoded: ByteArray? = null
+
+    while (!tlvReader.isEndOfContainer()) {
+      val tag = tlvReader.peekElement().tag
+
+      if (tag == ContextSpecificTag(TAG_PAYLOAD)) {
+        payload_decoded = tlvReader.getByteArray(tag)
+      } else {
+        tlvReader.skipElement()
+      }
+    }
+
+    if (payload_decoded == null) {
+      throw IllegalStateException("payload not found in TLV")
+    }
+
+    tlvReader.exitContainer()
+
+    return PayloadTestResponse(payload_decoded)
+  }
+
   suspend fun readNetworkInterfacesAttribute(): NetworkInterfacesAttribute {
     val ATTRIBUTE_ID: UInt = 0u
 
diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py
index 1ddda36..853fd1f 100644
--- a/src/controller/python/chip/clusters/CHIPClusters.py
+++ b/src/controller/python/chip/clusters/CHIPClusters.py
@@ -2246,6 +2246,15 @@
                 "args": {
                 },
             },
+            0x00000003: {
+                "commandId": 0x00000003,
+                "commandName": "PayloadTestRequest",
+                "args": {
+                    "enableKey": "bytes",
+                    "value": "int",
+                    "count": "int",
+                },
+            },
         },
         "attributes": {
             0x00000000: {
diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py
index 44cd49c..338d93e 100644
--- a/src/controller/python/chip/clusters/Objects.py
+++ b/src/controller/python/chip/clusters/Objects.py
@@ -7699,6 +7699,10 @@
             # enum value. This specific should never be transmitted.
             kUnknownEnumValue = 7,
 
+    class Bitmaps:
+        class Feature(IntFlag):
+            kDataModelTest = 0x1
+
     class Structs:
         @dataclass
         class NetworkInterface(ClusterObject):
@@ -7775,6 +7779,42 @@
             systemTimeMs: 'uint' = 0
             posixTimeMs: 'typing.Union[Nullable, uint]' = NullValue
 
+        @dataclass
+        class PayloadTestRequest(ClusterCommand):
+            cluster_id: typing.ClassVar[int] = 0x00000033
+            command_id: typing.ClassVar[int] = 0x00000003
+            is_client: typing.ClassVar[bool] = True
+            response_type: typing.ClassVar[str] = 'PayloadTestResponse'
+
+            @ChipUtility.classproperty
+            def descriptor(cls) -> ClusterObjectDescriptor:
+                return ClusterObjectDescriptor(
+                    Fields=[
+                        ClusterObjectFieldDescriptor(Label="enableKey", Tag=0, Type=bytes),
+                        ClusterObjectFieldDescriptor(Label="value", Tag=1, Type=uint),
+                        ClusterObjectFieldDescriptor(Label="count", Tag=2, Type=uint),
+                    ])
+
+            enableKey: 'bytes' = b""
+            value: 'uint' = 0
+            count: 'uint' = 0
+
+        @dataclass
+        class PayloadTestResponse(ClusterCommand):
+            cluster_id: typing.ClassVar[int] = 0x00000033
+            command_id: typing.ClassVar[int] = 0x00000004
+            is_client: typing.ClassVar[bool] = False
+            response_type: typing.ClassVar[str] = None
+
+            @ChipUtility.classproperty
+            def descriptor(cls) -> ClusterObjectDescriptor:
+                return ClusterObjectDescriptor(
+                    Fields=[
+                        ClusterObjectFieldDescriptor(Label="payload", Tag=0, Type=bytes),
+                    ])
+
+            payload: 'bytes' = b""
+
     class Attributes:
         @dataclass
         class NetworkInterfaces(ClusterAttributeDescriptor):
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
index c030edd..6383079 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
@@ -2561,6 +2561,12 @@
 - (void)timeSnapshotWithParams:(MTRGeneralDiagnosticsClusterTimeSnapshotParams * _Nullable)params completion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
 - (void)timeSnapshotWithCompletion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion
     MTR_PROVISIONALLY_AVAILABLE;
+/**
+ * Command PayloadTestRequest
+ *
+ * Request a variable length payload response.
+ */
+- (void)payloadTestRequestWithParams:(MTRGeneralDiagnosticsClusterPayloadTestRequestParams *)params completion:(void (^)(MTRGeneralDiagnosticsClusterPayloadTestResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
 
 - (void)readAttributeNetworkInterfacesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
 - (void)subscribeAttributeNetworkInterfacesWithParams:(MTRSubscribeParams *)params
@@ -17059,6 +17065,10 @@
     MTRGeneralDiagnosticsRadioFaultTypeEthernetFault MTR_DEPRECATED("Please use MTRGeneralDiagnosticsRadioFaultEthernetFault", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) = 0x06,
 } MTR_DEPRECATED("Please use MTRGeneralDiagnosticsRadioFault", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4));
 
+typedef NS_OPTIONS(uint32_t, MTRGeneralDiagnosticsFeature) {
+    MTRGeneralDiagnosticsFeatureDataModelTest MTR_PROVISIONALLY_AVAILABLE = 0x1,
+} MTR_PROVISIONALLY_AVAILABLE;
+
 typedef NS_OPTIONS(uint32_t, MTRSoftwareDiagnosticsFeature) {
     MTRSoftwareDiagnosticsFeatureWatermarks MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4)) = 0x1,
     MTRSoftwareDiagnosticsFeatureWaterMarks MTR_DEPRECATED("Please use MTRSoftwareDiagnosticsFeatureWatermarks", ios(16.1, 17.4), macos(13.0, 14.4), watchos(9.1, 10.4), tvos(16.1, 17.4)) = 0x1,
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm
index e998f74..8cca4c8 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm
@@ -20674,6 +20674,30 @@
                                              queue:self.callbackQueue
                                         completion:responseHandler];
 }
+- (void)payloadTestRequestWithParams:(MTRGeneralDiagnosticsClusterPayloadTestRequestParams *)params completion:(void (^)(MTRGeneralDiagnosticsClusterPayloadTestResponseParams * _Nullable data, NSError * _Nullable error))completion
+{
+    if (params == nil) {
+        params = [[MTRGeneralDiagnosticsClusterPayloadTestRequestParams
+            alloc] init];
+    }
+
+    auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) {
+        completion(response, error);
+    };
+
+    auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs;
+
+    using RequestType = GeneralDiagnostics::Commands::PayloadTestRequest::Type;
+    [self.device _invokeKnownCommandWithEndpointID:self.endpointID
+                                         clusterID:@(RequestType::GetClusterId())
+                                         commandID:@(RequestType::GetCommandId())
+                                    commandPayload:params
+                                timedInvokeTimeout:timedInvokeTimeoutMs
+                       serverSideProcessingTimeout:params.serverSideProcessingTimeout
+                                     responseClass:MTRGeneralDiagnosticsClusterPayloadTestResponseParams.class
+                                             queue:self.callbackQueue
+                                        completion:responseHandler];
+}
 
 - (void)readAttributeNetworkInterfacesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion
 {
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h
index 13558dd..a3351bc 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h
@@ -6018,6 +6018,8 @@
     MTRCommandIDTypeClusterGeneralDiagnosticsCommandTestEventTriggerID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000000,
     MTRCommandIDTypeClusterGeneralDiagnosticsCommandTimeSnapshotID MTR_PROVISIONALLY_AVAILABLE = 0x00000001,
     MTRCommandIDTypeClusterGeneralDiagnosticsCommandTimeSnapshotResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000002,
+    MTRCommandIDTypeClusterGeneralDiagnosticsCommandPayloadTestRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000003,
+    MTRCommandIDTypeClusterGeneralDiagnosticsCommandPayloadTestResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000004,
 
     // Cluster SoftwareDiagnostics deprecated command id names
     MTRClusterSoftwareDiagnosticsCommandResetWatermarksID
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h
index 3f3e7aa..d8bc645 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h
@@ -1234,6 +1234,7 @@
 - (void)timeSnapshotWithParams:(MTRGeneralDiagnosticsClusterTimeSnapshotParams * _Nullable)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
 - (void)timeSnapshotWithExpectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion
     MTR_PROVISIONALLY_AVAILABLE;
+- (void)payloadTestRequestWithParams:(MTRGeneralDiagnosticsClusterPayloadTestRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRGeneralDiagnosticsClusterPayloadTestResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
 
 - (NSDictionary<NSString *, id> * _Nullable)readAttributeNetworkInterfacesWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1));
 
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm
index 100622c..2374d7f 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm
@@ -3793,6 +3793,33 @@
                                         completion:responseHandler];
 }
 
+- (void)payloadTestRequestWithParams:(MTRGeneralDiagnosticsClusterPayloadTestRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRGeneralDiagnosticsClusterPayloadTestResponseParams * _Nullable data, NSError * _Nullable error))completion
+{
+    if (params == nil) {
+        params = [[MTRGeneralDiagnosticsClusterPayloadTestRequestParams
+            alloc] init];
+    }
+
+    auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) {
+        completion(response, error);
+    };
+
+    auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs;
+
+    using RequestType = GeneralDiagnostics::Commands::PayloadTestRequest::Type;
+    [self.device _invokeKnownCommandWithEndpointID:self.endpointID
+                                         clusterID:@(RequestType::GetClusterId())
+                                         commandID:@(RequestType::GetCommandId())
+                                    commandPayload:params
+                                    expectedValues:expectedValues
+                             expectedValueInterval:expectedValueIntervalMs
+                                timedInvokeTimeout:timedInvokeTimeoutMs
+                       serverSideProcessingTimeout:params.serverSideProcessingTimeout
+                                     responseClass:MTRGeneralDiagnosticsClusterPayloadTestResponseParams.class
+                                             queue:self.callbackQueue
+                                        completion:responseHandler];
+}
+
 - (NSDictionary<NSString *, id> * _Nullable)readAttributeNetworkInterfacesWithParams:(MTRReadParams * _Nullable)params
 {
     return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeGeneralDiagnosticsID) attributeID:@(MTRAttributeIDTypeClusterGeneralDiagnosticsAttributeNetworkInterfacesID) params:params];
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h
index b215962..8f2b070 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h
@@ -2543,6 +2543,59 @@
                                          error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE;
 @end
 
+MTR_PROVISIONALLY_AVAILABLE
+@interface MTRGeneralDiagnosticsClusterPayloadTestRequestParams : NSObject <NSCopying>
+
+@property (nonatomic, copy) NSData * _Nonnull enableKey MTR_PROVISIONALLY_AVAILABLE;
+
+@property (nonatomic, copy) NSNumber * _Nonnull value MTR_PROVISIONALLY_AVAILABLE;
+
+@property (nonatomic, copy, getter=getCount) NSNumber * _Nonnull count MTR_PROVISIONALLY_AVAILABLE;
+/**
+ * Controls whether the command is a timed command (using Timed Invoke).
+ *
+ * If nil (the default value), a regular invoke is done for commands that do
+ * not require a timed invoke and a timed invoke with some default timed request
+ * timeout is done for commands that require a timed invoke.
+ *
+ * If not nil, a timed invoke is done, with the provided value used as the timed
+ * request timeout.  The value should be chosen small enough to provide the
+ * desired security properties but large enough that it will allow a round-trip
+ * from the sever to the client (for the status response and actual invoke
+ * request) within the timeout window.
+ *
+ */
+@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs;
+
+/**
+ * Controls how much time, in seconds, we will allow for the server to process the command.
+ *
+ * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes.
+ *
+ * If nil, the framework will try to select an appropriate timeout value itself.
+ */
+@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout;
+@end
+
+MTR_PROVISIONALLY_AVAILABLE
+@interface MTRGeneralDiagnosticsClusterPayloadTestResponseParams : NSObject <NSCopying>
+
+@property (nonatomic, copy) NSData * _Nonnull payload MTR_PROVISIONALLY_AVAILABLE;
+
+/**
+ * Initialize an MTRGeneralDiagnosticsClusterPayloadTestResponseParams with a response-value dictionary
+ * of the sort that MTRDeviceResponseHandler would receive.
+ *
+ * Will return nil and hand out an error if the response-value dictionary is not
+ * a command data response or is not the right command response.
+ *
+ * Will return nil and hand out an error if the data response does not match the known
+ * schema for this command.
+ */
+- (nullable instancetype)initWithResponseValue:(NSDictionary<NSString *, id> *)responseValue
+                                         error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE;
+@end
+
 MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1))
 @interface MTRSoftwareDiagnosticsClusterResetWatermarksParams : NSObject <NSCopying>
 /**
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm
index 0e172b2..b2c1355 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm
@@ -6532,6 +6532,176 @@
 
 @end
 
+@implementation MTRGeneralDiagnosticsClusterPayloadTestRequestParams
+- (instancetype)init
+{
+    if (self = [super init]) {
+
+        _enableKey = [NSData data];
+
+        _value = @(0);
+
+        _count = @(0);
+        _timedInvokeTimeoutMs = nil;
+        _serverSideProcessingTimeout = nil;
+    }
+    return self;
+}
+
+- (id)copyWithZone:(NSZone * _Nullable)zone;
+{
+    auto other = [[MTRGeneralDiagnosticsClusterPayloadTestRequestParams alloc] init];
+
+    other.enableKey = self.enableKey;
+    other.value = self.value;
+    other.count = self.count;
+    other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs;
+    other.serverSideProcessingTimeout = self.serverSideProcessingTimeout;
+
+    return other;
+}
+
+- (NSString *)description
+{
+    NSString * descriptionString = [NSString stringWithFormat:@"<%@: enableKey:%@; value:%@; count:%@; >", NSStringFromClass([self class]), [_enableKey base64EncodedStringWithOptions:0], _value, _count];
+    return descriptionString;
+}
+
+@end
+
+@implementation MTRGeneralDiagnosticsClusterPayloadTestRequestParams (InternalMethods)
+
+- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader
+{
+    chip::app::Clusters::GeneralDiagnostics::Commands::PayloadTestRequest::Type encodableStruct;
+    ListFreer listFreer;
+    {
+        encodableStruct.enableKey = AsByteSpan(self.enableKey);
+    }
+    {
+        encodableStruct.value = self.value.unsignedCharValue;
+    }
+    {
+        encodableStruct.count = self.count.unsignedShortValue;
+    }
+
+    auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0);
+    if (buffer.IsNull()) {
+        return CHIP_ERROR_NO_MEMORY;
+    }
+
+    chip::System::PacketBufferTLVWriter writer;
+    // Commands never need chained buffers, since they cannot be chunked.
+    writer.Init(std::move(buffer), /* useChainedBuffers = */ false);
+
+    ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct));
+
+    ReturnErrorOnFailure(writer.Finalize(&buffer));
+
+    reader.Init(std::move(buffer));
+    return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag());
+}
+
+- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error
+{
+    chip::System::PacketBufferTLVReader reader;
+    CHIP_ERROR err = [self _encodeToTLVReader:reader];
+    if (err != CHIP_NO_ERROR) {
+        if (error) {
+            *error = [MTRError errorForCHIPErrorCode:err];
+        }
+        return nil;
+    }
+
+    auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader);
+    if (decodedObj == nil) {
+        if (error) {
+            *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE];
+        }
+    }
+    return decodedObj;
+}
+@end
+
+@implementation MTRGeneralDiagnosticsClusterPayloadTestResponseParams
+- (instancetype)init
+{
+    if (self = [super init]) {
+
+        _payload = [NSData data];
+    }
+    return self;
+}
+
+- (id)copyWithZone:(NSZone * _Nullable)zone;
+{
+    auto other = [[MTRGeneralDiagnosticsClusterPayloadTestResponseParams alloc] init];
+
+    other.payload = self.payload;
+
+    return other;
+}
+
+- (NSString *)description
+{
+    NSString * descriptionString = [NSString stringWithFormat:@"<%@: payload:%@; >", NSStringFromClass([self class]), [_payload base64EncodedStringWithOptions:0]];
+    return descriptionString;
+}
+
+- (nullable instancetype)initWithResponseValue:(NSDictionary<NSString *, id> *)responseValue
+                                         error:(NSError * __autoreleasing *)error
+{
+    if (!(self = [super init])) {
+        return nil;
+    }
+
+    using DecodableType = chip::app::Clusters::GeneralDiagnostics::Commands::PayloadTestResponse::DecodableType;
+    chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue
+                                                                           clusterID:DecodableType::GetClusterId()
+                                                                           commandID:DecodableType::GetCommandId()
+                                                                               error:error];
+    if (buffer.IsNull()) {
+        return nil;
+    }
+
+    chip::TLV::TLVReader reader;
+    reader.Init(buffer->Start(), buffer->DataLength());
+
+    CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag());
+    if (err == CHIP_NO_ERROR) {
+        DecodableType decodedStruct;
+        err = chip::app::DataModel::Decode(reader, decodedStruct);
+        if (err == CHIP_NO_ERROR) {
+            err = [self _setFieldsFromDecodableStruct:decodedStruct];
+            if (err == CHIP_NO_ERROR) {
+                return self;
+            }
+        }
+    }
+
+    NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()];
+    MTR_LOG_ERROR("%s", errorStr.UTF8String);
+    if (error != nil) {
+        NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) };
+        *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo];
+    }
+    return nil;
+}
+
+@end
+
+@implementation MTRGeneralDiagnosticsClusterPayloadTestResponseParams (InternalMethods)
+
+- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::GeneralDiagnostics::Commands::PayloadTestResponse::DecodableType &)decodableStruct
+{
+    {
+        self.payload = AsData(decodableStruct.payload);
+    }
+    return CHIP_NO_ERROR;
+}
+
+@end
+
 @implementation MTRSoftwareDiagnosticsClusterResetWatermarksParams
 - (instancetype)init
 {
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h
index d72da7c..2579d3b 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h
@@ -424,6 +424,18 @@
 
 @end
 
+@interface MTRGeneralDiagnosticsClusterPayloadTestRequestParams (InternalMethods)
+
+- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error;
+
+@end
+
+@interface MTRGeneralDiagnosticsClusterPayloadTestResponseParams (InternalMethods)
+
+- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::GeneralDiagnostics::Commands::PayloadTestResponse::DecodableType &)decodableStruct;
+
+@end
+
 @interface MTRSoftwareDiagnosticsClusterResetWatermarksParams (InternalMethods)
 
 - (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error;
diff --git a/src/python_testing/TC_TestEventTrigger.py b/src/python_testing/TC_TestEventTrigger.py
index a27e2f7..b11f115 100644
--- a/src/python_testing/TC_TestEventTrigger.py
+++ b/src/python_testing/TC_TestEventTrigger.py
@@ -15,6 +15,8 @@
 #    limitations under the License.
 #
 
+import logging
+
 import chip.clusters as Clusters
 from chip.interaction_model import InteractionModelError
 from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main
@@ -110,6 +112,104 @@
                 )
             )
 
+    @async_test_body
+    async def test_multiple_command_request_feature_present_if_needed(self):
+        dev_ctrl = self.default_controller
+        test_event_triggers_enabled = await self.read_single_attribute(
+            dev_ctrl,
+            self.dut_node_id,
+            endpoint=0,
+            attribute=Clusters.GeneralDiagnostics.Attributes.TestEventTriggersEnabled
+        )
+        asserts.assert_true(test_event_triggers_enabled, "This test expects Test Event Triggers are Enabled")
+
+        max_paths_per_invoke = await self.read_single_attribute(self.default_controller, node_id=self.dut_node_id, endpoint=0, attribute=Clusters.BasicInformation.Attributes.MaxPathsPerInvoke)
+        feature_map = await self.read_single_attribute(self.default_controller, node_id=self.dut_node_id, endpoint=0, attribute=Clusters.GeneralDiagnostics.Attributes.FeatureMap)
+        accepted_commands = await self.read_single_attribute(self.default_controller, node_id=self.dut_node_id, endpoint=0, attribute=Clusters.GeneralDiagnostics.Attributes.AcceptedCommandList)
+        generated_commands = await self.read_single_attribute(self.default_controller, node_id=self.dut_node_id, endpoint=0, attribute=Clusters.GeneralDiagnostics.Attributes.GeneratedCommandList)
+
+        has_multiple_paths_per_invoke = max_paths_per_invoke > 1
+        has_data_model_test_feature = (feature_map & Clusters.GeneralDiagnostics.Bitmaps.Feature.kDataModelTest) != 0
+        has_payload_test_request_command = (Clusters.GeneralDiagnostics.Commands.PayloadTestRequest.command_id in accepted_commands)
+        has_payload_test_response_command = (
+            Clusters.GeneralDiagnostics.Commands.PayloadTestResponse.command_id in generated_commands)
+
+        logging.info(f"Number of supported invoke paths reported: {max_paths_per_invoke}")
+        if has_multiple_paths_per_invoke:
+            asserts.assert_true(has_data_model_test_feature, "Must have DMTEST feature when > 1 invoke paths supported")
+
+        if has_data_model_test_feature:
+            asserts.assert_true(has_payload_test_request_command, "Must support PayloadTestRequest command when DMTEST supported")
+            asserts.assert_true(has_payload_test_response_command,
+                                "Must generate PayloadTestResponse command when DMTEST supported")
+
+        if has_data_model_test_feature:
+            # Test count too large (above max 2048)
+            with asserts.assert_raises_regex(InteractionModelError,
+                                             "ConstraintError",
+                                             "PayloadTestRequest with request too large (> 2048) must return ConstraintError"):
+                await dev_ctrl.SendCommand(
+                    self.dut_node_id,
+                    endpoint=0,
+                    payload=Clusters.GeneralDiagnostics.Commands.PayloadTestRequest(
+                        enableKey=kExpectedKey,
+                        value=0x55,
+                        count=2049
+                    )
+                )
+
+            # Test size > 1 MTU but still legal by constraints, but should fail since that will be too large (unless future TCP transport)
+            with asserts.assert_raises_regex(InteractionModelError,
+                                             "ResourceExhausted",
+                                             "PayloadTestRequest with request too large (> 1 MTU) must return ResourceExhausted"):
+                await dev_ctrl.SendCommand(
+                    self.dut_node_id,
+                    endpoint=0,
+                    payload=Clusters.GeneralDiagnostics.Commands.PayloadTestRequest(
+                        enableKey=kExpectedKey,
+                        value=0x55,
+                        count=1280 + 1
+                    )
+                )
+
+            # Test empty count succeeds
+            response = await dev_ctrl.SendCommand(
+                self.dut_node_id,
+                endpoint=0,
+                payload=Clusters.GeneralDiagnostics.Commands.PayloadTestRequest(
+                    enableKey=kExpectedKey,
+                    value=ord('B'),
+                    count=0
+                )
+            )
+            asserts.assert_equal(response.payload, b'', "Expect empty payload for count == 0")
+
+            # Test size that should always fit.
+            response = await dev_ctrl.SendCommand(
+                self.dut_node_id,
+                endpoint=0,
+                payload=Clusters.GeneralDiagnostics.Commands.PayloadTestRequest(
+                    enableKey=kExpectedKey,
+                    value=ord('A'),
+                    count=800
+                )
+            )
+            asserts.assert_equal(response.payload, b'A' * 800, "Expect response to match for count == 800")
+
+        if not has_data_model_test_feature:
+            with asserts.assert_raises_regex(InteractionModelError,
+                                             "UnsupportedCommand",
+                                             "PayloadTestRequest must not be supported if not reported"):
+                await dev_ctrl.SendCommand(
+                    self.dut_node_id,
+                    endpoint=0,
+                    payload=Clusters.GeneralDiagnostics.Commands.PayloadTestRequest(
+                        enableKey=kExpectedKey,
+                        value=0x55,
+                        count=1
+                    )
+                )
+
 
 if __name__ == "__main__":
     default_matter_test_main()
diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp
index e84db02..808a68f 100644
--- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp
+++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp
@@ -4434,68 +4434,6 @@
 
 } // namespace TestEventTriggersEnabled
 
-namespace FeatureMap {
-
-EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value)
-{
-    using Traits = NumericAttributeTraits<uint32_t>;
-    Traits::StorageType temp;
-    uint8_t * readable   = Traits::ToAttributeStoreRepresentation(temp);
-    EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, readable, sizeof(temp));
-    VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status);
-    if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
-    {
-        return EMBER_ZCL_STATUS_CONSTRAINT_ERROR;
-    }
-    *value = Traits::StorageToWorking(temp);
-    return status;
-}
-EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value)
-{
-    using Traits = NumericAttributeTraits<uint32_t>;
-    if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
-    {
-        return EMBER_ZCL_STATUS_CONSTRAINT_ERROR;
-    }
-    Traits::StorageType storageValue;
-    Traits::WorkingToStorage(value, storageValue);
-    uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
-    return emberAfWriteAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
-}
-
-} // namespace FeatureMap
-
-namespace ClusterRevision {
-
-EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value)
-{
-    using Traits = NumericAttributeTraits<uint16_t>;
-    Traits::StorageType temp;
-    uint8_t * readable   = Traits::ToAttributeStoreRepresentation(temp);
-    EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, readable, sizeof(temp));
-    VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status);
-    if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
-    {
-        return EMBER_ZCL_STATUS_CONSTRAINT_ERROR;
-    }
-    *value = Traits::StorageToWorking(temp);
-    return status;
-}
-EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value)
-{
-    using Traits = NumericAttributeTraits<uint16_t>;
-    if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
-    {
-        return EMBER_ZCL_STATUS_CONSTRAINT_ERROR;
-    }
-    Traits::StorageType storageValue;
-    Traits::WorkingToStorage(value, storageValue);
-    uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
-    return emberAfWriteAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
-}
-
-} // namespace ClusterRevision
-
 } // namespace Attributes
 } // namespace GeneralDiagnostics
 
diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h
index ba53559..58daa78 100644
--- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h
+++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h
@@ -842,16 +842,6 @@
 EmberAfStatus Set(chip::EndpointId endpoint, bool value);
 } // namespace TestEventTriggersEnabled
 
-namespace FeatureMap {
-EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32
-EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value);
-} // namespace FeatureMap
-
-namespace ClusterRevision {
-EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u
-EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value);
-} // namespace ClusterRevision
-
 } // namespace Attributes
 } // namespace GeneralDiagnostics
 
diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h
index d385926..350190a 100644
--- a/zzz_generated/app-common/app-common/zap-generated/callback.h
+++ b/zzz_generated/app-common/app-common/zap-generated/callback.h
@@ -5463,6 +5463,12 @@
     chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
     const chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshot::DecodableType & commandData);
 /**
+ * @brief General Diagnostics Cluster PayloadTestRequest Command callback (from client)
+ */
+bool emberAfGeneralDiagnosticsClusterPayloadTestRequestCallback(
+    chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
+    const chip::app::Clusters::GeneralDiagnostics::Commands::PayloadTestRequest::DecodableType & commandData);
+/**
  * @brief Software Diagnostics Cluster ResetWatermarks Command callback (from client)
  */
 bool emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(
diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h
index 88b3c9e..4f7102d 100644
--- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h
+++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h
@@ -1183,6 +1183,12 @@
     // enum value. This specific should never be transmitted.
     kUnknownEnumValue = 7,
 };
+
+// Bitmap for Feature
+enum class Feature : uint32_t
+{
+    kDataModelTest = 0x1,
+};
 } // namespace GeneralDiagnostics
 
 namespace SoftwareDiagnostics {
diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp
index feda2a4..fc5a2bd 100644
--- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp
+++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp
@@ -5773,6 +5773,84 @@
     }
 }
 } // namespace TimeSnapshotResponse.
+namespace PayloadTestRequest {
+CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
+{
+    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
+    encoder.Encode(to_underlying(Fields::kEnableKey), enableKey);
+    encoder.Encode(to_underlying(Fields::kValue), value);
+    encoder.Encode(to_underlying(Fields::kCount), count);
+    return encoder.Finalize();
+}
+
+CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
+{
+    detail::StructDecodeIterator __iterator(reader);
+    while (true)
+    {
+        auto __element = __iterator.Next();
+        if (std::holds_alternative<CHIP_ERROR>(__element))
+        {
+            return std::get<CHIP_ERROR>(__element);
+        }
+
+        CHIP_ERROR err              = CHIP_NO_ERROR;
+        const uint8_t __context_tag = std::get<uint8_t>(__element);
+
+        if (__context_tag == to_underlying(Fields::kEnableKey))
+        {
+            err = DataModel::Decode(reader, enableKey);
+        }
+        else if (__context_tag == to_underlying(Fields::kValue))
+        {
+            err = DataModel::Decode(reader, value);
+        }
+        else if (__context_tag == to_underlying(Fields::kCount))
+        {
+            err = DataModel::Decode(reader, count);
+        }
+        else
+        {
+        }
+
+        ReturnErrorOnFailure(err);
+    }
+}
+} // namespace PayloadTestRequest.
+namespace PayloadTestResponse {
+CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
+{
+    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
+    encoder.Encode(to_underlying(Fields::kPayload), payload);
+    return encoder.Finalize();
+}
+
+CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
+{
+    detail::StructDecodeIterator __iterator(reader);
+    while (true)
+    {
+        auto __element = __iterator.Next();
+        if (std::holds_alternative<CHIP_ERROR>(__element))
+        {
+            return std::get<CHIP_ERROR>(__element);
+        }
+
+        CHIP_ERROR err              = CHIP_NO_ERROR;
+        const uint8_t __context_tag = std::get<uint8_t>(__element);
+
+        if (__context_tag == to_underlying(Fields::kPayload))
+        {
+            err = DataModel::Decode(reader, payload);
+        }
+        else
+        {
+        }
+
+        ReturnErrorOnFailure(err);
+    }
+}
+} // namespace PayloadTestResponse.
 } // namespace Commands
 
 namespace Attributes {
diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h
index 74cd7dc..99e6e3b 100644
--- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h
+++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h
@@ -7330,6 +7330,16 @@
 struct DecodableType;
 } // namespace TimeSnapshotResponse
 
+namespace PayloadTestRequest {
+struct Type;
+struct DecodableType;
+} // namespace PayloadTestRequest
+
+namespace PayloadTestResponse {
+struct Type;
+struct DecodableType;
+} // namespace PayloadTestResponse
+
 } // namespace Commands
 
 namespace Commands {
@@ -7431,6 +7441,76 @@
     CHIP_ERROR Decode(TLV::TLVReader & reader);
 };
 }; // namespace TimeSnapshotResponse
+namespace PayloadTestRequest {
+enum class Fields : uint8_t
+{
+    kEnableKey = 0,
+    kValue     = 1,
+    kCount     = 2,
+};
+
+struct Type
+{
+public:
+    // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
+    static constexpr CommandId GetCommandId() { return Commands::PayloadTestRequest::Id; }
+    static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; }
+
+    chip::ByteSpan enableKey;
+    uint8_t value  = static_cast<uint8_t>(0);
+    uint16_t count = static_cast<uint16_t>(0);
+
+    CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
+
+    using ResponseType = Clusters::GeneralDiagnostics::Commands::PayloadTestResponse::DecodableType;
+
+    static constexpr bool MustUseTimedInvoke() { return false; }
+};
+
+struct DecodableType
+{
+public:
+    static constexpr CommandId GetCommandId() { return Commands::PayloadTestRequest::Id; }
+    static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; }
+
+    chip::ByteSpan enableKey;
+    uint8_t value  = static_cast<uint8_t>(0);
+    uint16_t count = static_cast<uint16_t>(0);
+    CHIP_ERROR Decode(TLV::TLVReader & reader);
+};
+}; // namespace PayloadTestRequest
+namespace PayloadTestResponse {
+enum class Fields : uint8_t
+{
+    kPayload = 0,
+};
+
+struct Type
+{
+public:
+    // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
+    static constexpr CommandId GetCommandId() { return Commands::PayloadTestResponse::Id; }
+    static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; }
+
+    chip::ByteSpan payload;
+
+    CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
+
+    using ResponseType = DataModel::NullObjectType;
+
+    static constexpr bool MustUseTimedInvoke() { return false; }
+};
+
+struct DecodableType
+{
+public:
+    static constexpr CommandId GetCommandId() { return Commands::PayloadTestResponse::Id; }
+    static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; }
+
+    chip::ByteSpan payload;
+    CHIP_ERROR Decode(TLV::TLVReader & reader);
+};
+}; // namespace PayloadTestResponse
 } // namespace Commands
 
 namespace Attributes {
diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h
index 6093139..da8b04c 100644
--- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h
+++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h
@@ -368,6 +368,14 @@
 static constexpr CommandId Id = 0x00000002;
 } // namespace TimeSnapshotResponse
 
+namespace PayloadTestRequest {
+static constexpr CommandId Id = 0x00000003;
+} // namespace PayloadTestRequest
+
+namespace PayloadTestResponse {
+static constexpr CommandId Id = 0x00000004;
+} // namespace PayloadTestResponse
+
 } // namespace Commands
 } // namespace GeneralDiagnostics
 
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
index 0a43afb..3a7a4e9 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
+++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
@@ -2691,6 +2691,7 @@
 | Commands:                                                           |        |
 | * TestEventTrigger                                                  |   0x00 |
 | * TimeSnapshot                                                      |   0x01 |
+| * PayloadTestRequest                                                |   0x03 |
 |------------------------------------------------------------------------------|
 | Attributes:                                                         |        |
 | * NetworkInterfaces                                                 | 0x0000 |
@@ -2792,6 +2793,46 @@
     chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshot::Type mRequest;
 };
 
+/*
+ * Command PayloadTestRequest
+ */
+class GeneralDiagnosticsPayloadTestRequest : public ClusterCommand
+{
+public:
+    GeneralDiagnosticsPayloadTestRequest(CredentialIssuerCommands * credsIssuerConfig) :
+        ClusterCommand("payload-test-request", credsIssuerConfig)
+    {
+        AddArgument("EnableKey", &mRequest.enableKey);
+        AddArgument("Value", 0, UINT8_MAX, &mRequest.value);
+        AddArgument("Count", 0, UINT16_MAX, &mRequest.count);
+        ClusterCommand::AddArguments();
+    }
+
+    CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector<chip::EndpointId> endpointIds) override
+    {
+        constexpr chip::ClusterId clusterId = chip::app::Clusters::GeneralDiagnostics::Id;
+        constexpr chip::CommandId commandId = chip::app::Clusters::GeneralDiagnostics::Commands::PayloadTestRequest::Id;
+
+        ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId,
+                        commandId, endpointIds.at(0));
+        return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest);
+    }
+
+    CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override
+    {
+        constexpr chip::ClusterId clusterId = chip::app::Clusters::GeneralDiagnostics::Id;
+        constexpr chip::CommandId commandId = chip::app::Clusters::GeneralDiagnostics::Commands::PayloadTestRequest::Id;
+
+        ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId,
+                        groupId);
+
+        return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest);
+    }
+
+private:
+    chip::app::Clusters::GeneralDiagnostics::Commands::PayloadTestRequest::Type mRequest;
+};
+
 /*----------------------------------------------------------------------------*\
 | Cluster SoftwareDiagnostics                                         | 0x0034 |
 |------------------------------------------------------------------------------|
@@ -16470,9 +16511,10 @@
         //
         // Commands
         //
-        make_unique<ClusterCommand>(Id, credsIssuerConfig),                 //
-        make_unique<GeneralDiagnosticsTestEventTrigger>(credsIssuerConfig), //
-        make_unique<GeneralDiagnosticsTimeSnapshot>(credsIssuerConfig),     //
+        make_unique<ClusterCommand>(Id, credsIssuerConfig),                   //
+        make_unique<GeneralDiagnosticsTestEventTrigger>(credsIssuerConfig),   //
+        make_unique<GeneralDiagnosticsTimeSnapshot>(credsIssuerConfig),       //
+        make_unique<GeneralDiagnosticsPayloadTestRequest>(credsIssuerConfig), //
         //
         // Attributes
         //
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
index a433d10..fde5089 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
+++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
@@ -7368,6 +7368,14 @@
     return CHIP_NO_ERROR;
 }
 CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
+                                     const GeneralDiagnostics::Commands::PayloadTestResponse::DecodableType & value)
+{
+    DataModelLogger::LogString(label, indent, "{");
+    ReturnErrorOnFailure(DataModelLogger::LogValue("payload", indent + 1, value.payload));
+    DataModelLogger::LogString(indent, "}");
+    return CHIP_NO_ERROR;
+}
+CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
                                      const TimeSynchronization::Commands::SetTimeZoneResponse::DecodableType & value)
 {
     DataModelLogger::LogString(label, indent, "{");
@@ -18133,6 +18141,11 @@
             ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
             return DataModelLogger::LogValue("TimeSnapshotResponse", 1, value);
         }
+        case GeneralDiagnostics::Commands::PayloadTestResponse::Id: {
+            GeneralDiagnostics::Commands::PayloadTestResponse::DecodableType value;
+            ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
+            return DataModelLogger::LogValue("PayloadTestResponse", 1, value);
+        }
         }
         break;
     }
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h
index f201e84..1c790b5 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h
+++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h
@@ -655,6 +655,8 @@
 static CHIP_ERROR LogValue(const char * label, size_t indent,
                            const chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType & value);
 static CHIP_ERROR LogValue(const char * label, size_t indent,
+                           const chip::app::Clusters::GeneralDiagnostics::Commands::PayloadTestResponse::DecodableType & value);
+static CHIP_ERROR LogValue(const char * label, size_t indent,
                            const chip::app::Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::DecodableType & value);
 static CHIP_ERROR LogValue(const char * label, size_t indent,
                            const chip::app::Clusters::OperationalCredentials::Commands::AttestationResponse::DecodableType & value);
diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h
index 9b9f747..9a1389e 100644
--- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h
+++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h
@@ -26426,6 +26426,7 @@
 | Commands:                                                           |        |
 | * TestEventTrigger                                                  |   0x00 |
 | * TimeSnapshot                                                      |   0x01 |
+| * PayloadTestRequest                                                |   0x03 |
 |------------------------------------------------------------------------------|
 | Attributes:                                                         |        |
 | * NetworkInterfaces                                                 | 0x0000 |
@@ -26552,6 +26553,77 @@
 };
 
 #endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+/*
+ * Command PayloadTestRequest
+ */
+class GeneralDiagnosticsPayloadTestRequest : public ClusterCommand {
+public:
+    GeneralDiagnosticsPayloadTestRequest()
+        : ClusterCommand("payload-test-request")
+    {
+#if MTR_ENABLE_PROVISIONAL
+        AddArgument("EnableKey", &mRequest.enableKey);
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+        AddArgument("Value", 0, UINT8_MAX, &mRequest.value);
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+        AddArgument("Count", 0, UINT16_MAX, &mRequest.count);
+#endif // MTR_ENABLE_PROVISIONAL
+        ClusterCommand::AddArguments();
+    }
+
+    CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+    {
+        constexpr chip::ClusterId clusterId = chip::app::Clusters::GeneralDiagnostics::Id;
+        constexpr chip::CommandId commandId = chip::app::Clusters::GeneralDiagnostics::Commands::PayloadTestRequest::Id;
+
+        ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId);
+
+        dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+        __auto_type * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+        __auto_type * params = [[MTRGeneralDiagnosticsClusterPayloadTestRequestParams alloc] init];
+        params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil;
+#if MTR_ENABLE_PROVISIONAL
+        params.enableKey = [NSData dataWithBytes:mRequest.enableKey.data() length:mRequest.enableKey.size()];
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+        params.value = [NSNumber numberWithUnsignedChar:mRequest.value];
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+        params.count = [NSNumber numberWithUnsignedShort:mRequest.count];
+#endif // MTR_ENABLE_PROVISIONAL
+        uint16_t repeatCount = mRepeatCount.ValueOr(1);
+        uint16_t __block responsesNeeded = repeatCount;
+        while (repeatCount--) {
+            [cluster payloadTestRequestWithParams:params completion:
+                                                             ^(MTRGeneralDiagnosticsClusterPayloadTestResponseParams * _Nullable values, NSError * _Nullable error) {
+                                                                 NSLog(@"Values: %@", values);
+                                                                 if (error == nil) {
+                                                                     constexpr chip::CommandId responseId = chip::app::Clusters::GeneralDiagnostics::Commands::PayloadTestResponse::Id;
+                                                                     RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values);
+                                                                 }
+                                                                 responsesNeeded--;
+                                                                 if (error != nil) {
+                                                                     mError = error;
+                                                                     LogNSError("Error", error);
+                                                                     constexpr chip::CommandId responseId = chip::app::Clusters::GeneralDiagnostics::Commands::PayloadTestResponse::Id;
+                                                                     RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error);
+                                                                 }
+                                                                 if (responsesNeeded == 0) {
+                                                                     SetCommandExitStatus(mError);
+                                                                 }
+                                                             }];
+        }
+        return CHIP_NO_ERROR;
+    }
+
+private:
+    chip::app::Clusters::GeneralDiagnostics::Commands::PayloadTestRequest::Type mRequest;
+};
+
+#endif // MTR_ENABLE_PROVISIONAL
 
 /*
  * Attribute NetworkInterfaces
@@ -183942,6 +184014,9 @@
 #if MTR_ENABLE_PROVISIONAL
         make_unique<GeneralDiagnosticsTimeSnapshot>(), //
 #endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+        make_unique<GeneralDiagnosticsPayloadTestRequest>(), //
+#endif // MTR_ENABLE_PROVISIONAL
         make_unique<ReadAttribute>(Id), //
         make_unique<WriteAttribute>(Id), //
         make_unique<SubscribeAttribute>(Id), //
