diff --git a/src/app/app-platform/ContentApp.cpp b/src/app/app-platform/ContentApp.cpp
index 5715614..3bc16e9 100644
--- a/src/app/app-platform/ContentApp.cpp
+++ b/src/app/app-platform/ContentApp.cpp
@@ -29,35 +29,37 @@
 #include <lib/support/CodeUtils.h>
 #include <lib/support/ZclString.h>
 #include <platform/CHIPDeviceLayer.h>
+#include <protocols/interaction_model/StatusCode.h>
 
 #if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
 
 using namespace chip;
 using namespace chip::AppPlatform;
 
+using chip::Protocols::InteractionModel::Status;
+
 namespace chip {
 namespace AppPlatform {
 
 #define ZCL_DESCRIPTOR_CLUSTER_REVISION (1u)
 #define ZCL_APPLICATION_BASIC_CLUSTER_REVISION (1u)
 
-EmberAfStatus ContentApp::HandleReadAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer,
-                                              uint16_t maxReadLength)
+Status ContentApp::HandleReadAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer, uint16_t maxReadLength)
 {
     ChipLogProgress(DeviceLayer,
                     "Read Attribute for endpoint " ChipLogFormatMEI " cluster " ChipLogFormatMEI " attribute " ChipLogFormatMEI,
                     ChipLogValueMEI(mEndpointId), ChipLogValueMEI(clusterId), ChipLogValueMEI(attributeId));
 
-    return EMBER_ZCL_STATUS_FAILURE;
+    return Status::Failure;
 }
 
-EmberAfStatus ContentApp::HandleWriteAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer)
+Status ContentApp::HandleWriteAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer)
 {
     ChipLogProgress(DeviceLayer,
                     "Read Attribute for endpoint " ChipLogFormatMEI " cluster " ChipLogFormatMEI " attribute " ChipLogFormatMEI,
                     ChipLogValueMEI(mEndpointId), ChipLogValueMEI(clusterId), ChipLogValueMEI(attributeId));
 
-    return EMBER_ZCL_STATUS_FAILURE;
+    return Status::Failure;
 }
 
 } // namespace AppPlatform
diff --git a/src/app/app-platform/ContentApp.h b/src/app/app-platform/ContentApp.h
index 6fed23c..d3b7d1f 100644
--- a/src/app/app-platform/ContentApp.h
+++ b/src/app/app-platform/ContentApp.h
@@ -33,6 +33,7 @@
 #include <app/clusters/media-playback-server/media-playback-delegate.h>
 #include <app/clusters/target-navigator-server/target-navigator-delegate.h>
 #include <app/util/attribute-storage.h>
+#include <protocols/interaction_model/StatusCode.h>
 
 namespace chip {
 namespace AppPlatform {
@@ -65,8 +66,9 @@
     virtual MediaPlaybackDelegate * GetMediaPlaybackDelegate()             = 0;
     virtual TargetNavigatorDelegate * GetTargetNavigatorDelegate()         = 0;
 
-    EmberAfStatus HandleReadAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer, uint16_t maxReadLength);
-    EmberAfStatus HandleWriteAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer);
+    Protocols::InteractionModel::Status HandleReadAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer,
+                                                            uint16_t maxReadLength);
+    Protocols::InteractionModel::Status HandleWriteAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer);
 
 protected:
     EndpointId mEndpointId = 0;
diff --git a/src/app/app-platform/ContentAppPlatform.cpp b/src/app/app-platform/ContentAppPlatform.cpp
index bb4638c..abcaa98 100644
--- a/src/app/app-platform/ContentAppPlatform.cpp
+++ b/src/app/app-platform/ContentAppPlatform.cpp
@@ -32,6 +32,7 @@
 #include <lib/support/CodeUtils.h>
 #include <lib/support/ZclString.h>
 #include <platform/CHIPDeviceLayer.h>
+#include <protocols/interaction_model/StatusCode.h>
 
 #if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
 
@@ -41,19 +42,20 @@
 using namespace chip::Access;
 using ApplicationStatusEnum   = app::Clusters::ApplicationBasic::ApplicationStatusEnum;
 using GetSetupPINResponseType = app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Type;
+using chip::Protocols::InteractionModel::Status;
 
 // Device Version for dynamic endpoints:
 #define DEVICE_VERSION_DEFAULT 1
 
-EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
-                                                   const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
-                                                   uint16_t maxReadLength)
+Status emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
+                                            const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
+                                            uint16_t maxReadLength)
 {
     uint16_t endpointIndex = emberAfGetDynamicIndexFromEndpoint(endpoint);
 
     ChipLogDetail(DeviceLayer, "emberAfExternalAttributeReadCallback endpoint %d ", endpointIndex);
 
-    EmberAfStatus ret = EMBER_ZCL_STATUS_FAILURE;
+    Status ret = Status::Failure;
 
     ContentApp * app = ContentAppPlatform::GetInstance().GetContentApp(endpoint);
     if (app != nullptr)
@@ -68,14 +70,14 @@
     return ret;
 }
 
-EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
-                                                    const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer)
+Status emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
+                                             const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer)
 {
     uint16_t endpointIndex = emberAfGetDynamicIndexFromEndpoint(endpoint);
 
     ChipLogDetail(DeviceLayer, "emberAfExternalAttributeWriteCallback endpoint %d ", endpointIndex);
 
-    EmberAfStatus ret = EMBER_ZCL_STATUS_FAILURE;
+    Status ret = Status::Failure;
 
     ContentApp * app = ContentAppPlatform::GetInstance().GetContentApp(endpoint);
     if (app != nullptr)
@@ -93,18 +95,18 @@
 namespace chip {
 namespace AppPlatform {
 
-EmberAfStatus __attribute__((weak)) AppPlatformExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
-                                                                             const EmberAfAttributeMetadata * attributeMetadata,
-                                                                             uint8_t * buffer, uint16_t maxReadLength)
+Status __attribute__((weak)) AppPlatformExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
+                                                                      const EmberAfAttributeMetadata * attributeMetadata,
+                                                                      uint8_t * buffer, uint16_t maxReadLength)
 {
-    return (EMBER_ZCL_STATUS_FAILURE);
+    return (Status::Failure);
 }
 
-EmberAfStatus __attribute__((weak))
+Status __attribute__((weak))
 AppPlatformExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
                                           const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer)
 {
-    return (EMBER_ZCL_STATUS_FAILURE);
+    return (Status::Failure);
 }
 
 EndpointId ContentAppPlatform::AddContentApp(ContentApp * app, EmberAfEndpointType * ep,
diff --git a/src/app/app-platform/ContentAppPlatform.h b/src/app/app-platform/ContentAppPlatform.h
index 3dd0b13..16a47c2 100644
--- a/src/app/app-platform/ContentAppPlatform.h
+++ b/src/app/app-platform/ContentAppPlatform.h
@@ -27,6 +27,7 @@
 #include <app/util/attribute-storage.h>
 #include <controller/CHIPCluster.h>
 #include <platform/CHIPDeviceLayer.h>
+#include <protocols/interaction_model/StatusCode.h>
 #include <protocols/user_directed_commissioning/UserDirectedCommissioning.h>
 
 using chip::app::Clusters::ApplicationBasic::CatalogVendorApp;
@@ -40,14 +41,15 @@
 
 // The AppPlatform overrides emberAfExternalAttributeReadCallback to handle external attribute reads for ContentApps.
 // This callback can be used to handle external attribute reads for attributes belonging to static endpoints.
-EmberAfStatus AppPlatformExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
-                                                       const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
-                                                       uint16_t maxReadLength);
+Protocols::InteractionModel::Status AppPlatformExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
+                                                                             const EmberAfAttributeMetadata * attributeMetadata,
+                                                                             uint8_t * buffer, uint16_t maxReadLength);
 
 // The AppPlatform overrides emberAfExternalAttributeWriteCallback to handle external attribute writes for ContentApps.
 // This callback can be used to handle external attribute writes for attributes belonging to static endpoints.
-EmberAfStatus AppPlatformExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
-                                                        const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer);
+Protocols::InteractionModel::Status AppPlatformExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
+                                                                              const EmberAfAttributeMetadata * attributeMetadata,
+                                                                              uint8_t * buffer);
 
 inline constexpr EndpointId kTargetBindingClusterEndpointId = 0;
 inline constexpr EndpointId kLocalVideoPlayerEndpointId     = 1;
@@ -157,7 +159,7 @@
     // loads given app and calls HandleGetSetupPasscode. Sets passcode to 0 if it cannot be obtained.
     // return true if a matching app was found (and it granted this client access), even if a passcode was not obtained
     bool HasTargetContentApp(uint16_t vendorId, uint16_t productId, CharSpan rotatingId,
-                             chip::Protocols::UserDirectedCommissioning::TargetAppInfo & info, uint32_t & passcode);
+                             Protocols::UserDirectedCommissioning::TargetAppInfo & info, uint32_t & passcode);
 
     /**
      * @brief
diff --git a/src/app/clusters/account-login-server/account-login-server.cpp b/src/app/clusters/account-login-server/account-login-server.cpp
index aa939ae..684558e 100644
--- a/src/app/clusters/account-login-server/account-login-server.cpp
+++ b/src/app/clusters/account-login-server/account-login-server.cpp
@@ -34,6 +34,7 @@
 #include <app/util/attribute-storage.h>
 #include <app/util/config.h>
 #include <platform/CHIPDeviceConfig.h>
+#include <protocols/interaction_model/StatusCode.h>
 
 #if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
 #include <app/app-platform/ContentAppPlatform.h>
diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.cpp b/src/app/clusters/application-launcher-server/application-launcher-server.cpp
index aa72d8a..18a30bb 100644
--- a/src/app/clusters/application-launcher-server/application-launcher-server.cpp
+++ b/src/app/clusters/application-launcher-server/application-launcher-server.cpp
@@ -116,8 +116,8 @@
     bool hasFeature     = false;
     uint32_t featureMap = 0;
 
-    EmberAfStatus status = Attributes::FeatureMap::Get(endpoint, &featureMap);
-    if (EMBER_ZCL_STATUS_SUCCESS == status)
+    Status status = Attributes::FeatureMap::Get(endpoint, &featureMap);
+    if (Status::Success == status)
     {
         hasFeature = (featureMap & chip::to_underlying(feature));
     }
diff --git a/src/app/clusters/audio-output-server/audio-output-server.cpp b/src/app/clusters/audio-output-server/audio-output-server.cpp
index f47fc52..297d1ea 100644
--- a/src/app/clusters/audio-output-server/audio-output-server.cpp
+++ b/src/app/clusters/audio-output-server/audio-output-server.cpp
@@ -92,8 +92,8 @@
     bool hasFeature     = false;
     uint32_t featureMap = 0;
 
-    EmberAfStatus status = Attributes::FeatureMap::Get(endpoint, &featureMap);
-    if (EMBER_ZCL_STATUS_SUCCESS == status)
+    Status status = Attributes::FeatureMap::Get(endpoint, &featureMap);
+    if (Status::Success == status)
     {
         hasFeature = (featureMap & chip::to_underlying(feature));
     }
diff --git a/src/app/clusters/barrier-control-server/barrier-control-server.cpp b/src/app/clusters/barrier-control-server/barrier-control-server.cpp
index e4e72ee..99bd062 100644
--- a/src/app/clusters/barrier-control-server/barrier-control-server.cpp
+++ b/src/app/clusters/barrier-control-server/barrier-control-server.cpp
@@ -102,29 +102,29 @@
 uint8_t emAfPluginBarrierControlServerGetBarrierPosition(EndpointId endpoint)
 {
     uint8_t position;
-    EmberAfStatus status = Attributes::BarrierPosition::Get(endpoint, &position);
-    assert(status == EMBER_ZCL_STATUS_SUCCESS);
+    Status status = Attributes::BarrierPosition::Get(endpoint, &position);
+    assert(status == Status::Success);
     return position;
 }
 
 void emAfPluginBarrierControlServerSetBarrierPosition(EndpointId endpoint, uint8_t position)
 {
-    EmberAfStatus status = Attributes::BarrierPosition::Set(endpoint, position);
-    assert(status == EMBER_ZCL_STATUS_SUCCESS);
+    Status status = Attributes::BarrierPosition::Set(endpoint, position);
+    assert(status == Status::Success);
 }
 
 bool emAfPluginBarrierControlServerIsPartialBarrierSupported(EndpointId endpoint)
 {
     uint8_t bitmap;
-    EmberAfStatus status = Attributes::BarrierCapabilities::Get(endpoint, &bitmap);
-    assert(status == EMBER_ZCL_STATUS_SUCCESS);
+    Status status = Attributes::BarrierCapabilities::Get(endpoint, &bitmap);
+    assert(status == Status::Success);
     return (bitmap & to_underlying(BarrierControlCapabilities::kPartialBarrier)) != 0;
 }
 
 static uint16_t getOpenOrClosePeriod(EndpointId endpoint, bool open)
 {
-    uint16_t period      = 0;
-    EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+    uint16_t period = 0;
+    Status status   = Status::Success;
 #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_OPEN_PERIOD_ATTRIBUTE)
     if (open)
     {
@@ -137,21 +137,21 @@
         status = Attributes::BarrierClosePeriod::Get(endpoint, &period);
     }
 #endif
-    assert(status == EMBER_ZCL_STATUS_SUCCESS);
+    assert(status == Status::Success);
     return period;
 }
 
 static void setMovingState(EndpointId endpoint, uint8_t newState)
 {
-    EmberAfStatus status = Attributes::BarrierMovingState::Set(endpoint, newState);
-    assert(status == EMBER_ZCL_STATUS_SUCCESS);
+    Status status = Attributes::BarrierMovingState::Set(endpoint, newState);
+    assert(status == Status::Success);
 }
 
 uint16_t emAfPluginBarrierControlServerGetSafetyStatus(EndpointId endpoint)
 {
     uint16_t safetyStatus;
-    EmberAfStatus status = Attributes::BarrierSafetyStatus::Get(endpoint, &safetyStatus);
-    assert(status == EMBER_ZCL_STATUS_SUCCESS);
+    Status status = Attributes::BarrierSafetyStatus::Get(endpoint, &safetyStatus);
+    assert(status == Status::Success);
     return safetyStatus;
 }
 
@@ -163,8 +163,8 @@
 
 void emAfPluginBarrierControlServerIncrementEvents(EndpointId endpoint, bool open, bool command)
 {
-    EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
-    uint16_t events      = 0;
+    Status status   = Status::Success;
+    uint16_t events = 0;
 
 #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_OPEN_EVENTS_ATTRIBUTE)
     if (open && !command)
@@ -190,7 +190,7 @@
         status = Attributes::BarrierCommandCloseEvents::Get(endpoint, &events);
     }
 #endif
-    assert(status == EMBER_ZCL_STATUS_SUCCESS);
+    assert(status == Status::Success);
 
     // Section 7.1.2.1.5-8 says that this events counter SHALL NOT roll over.
     // The maximum 16-bit unsigned integer in Zigbee is 0xFFFE, so we have this
@@ -225,7 +225,7 @@
         status = Attributes::BarrierCommandCloseEvents::Set(endpoint, events);
     }
 #endif
-    assert(status == EMBER_ZCL_STATUS_SUCCESS);
+    assert(status == Status::Success);
 }
 
 // -----------------------------------------------------------------------------
diff --git a/src/app/clusters/basic-information/basic-information.cpp b/src/app/clusters/basic-information/basic-information.cpp
index f241bb2..641dc59 100644
--- a/src/app/clusters/basic-information/basic-information.cpp
+++ b/src/app/clusters/basic-information/basic-information.cpp
@@ -30,6 +30,7 @@
 #include <platform/ConfigurationManager.h>
 #include <platform/DeviceInstanceInfoProvider.h>
 #include <platform/PlatformManager.h>
+#include <protocols/interaction_model/StatusCode.h>
 
 #include <cstddef>
 #include <cstring>
@@ -41,6 +42,7 @@
 using namespace chip::app::Clusters::BasicInformation;
 using namespace chip::app::Clusters::BasicInformation::Attributes;
 using namespace chip::DeviceLayer;
+using chip::Protocols::InteractionModel::Status;
 
 namespace {
 
@@ -463,9 +465,9 @@
 namespace BasicInformation {
 bool IsLocalConfigDisabled()
 {
-    bool disabled        = false;
-    EmberAfStatus status = LocalConfigDisabled::Get(0, &disabled);
-    return status == EMBER_ZCL_STATUS_SUCCESS && disabled;
+    bool disabled = false;
+    Status status = LocalConfigDisabled::Get(0, &disabled);
+    return status == Status::Success && disabled;
 }
 } // namespace BasicInformation
 } // namespace Clusters
diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp
index 941f9d5..3e883cf 100644
--- a/src/app/clusters/color-control-server/color-control-server.cpp
+++ b/src/app/clusters/color-control-server/color-control-server.cpp
@@ -109,14 +109,14 @@
         if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kXy))
         {
             uint16_t xValue;
-            if (EMBER_ZCL_STATUS_SUCCESS != Attributes::CurrentX::Get(endpoint, &xValue))
+            if (Status::Success != Attributes::CurrentX::Get(endpoint, &xValue))
             {
                 xValue = 0x616B; // Default X value according to spec
             }
             AddAttributeValuePair(pairs, Attributes::CurrentX::Id, xValue, attributeCount);
 
             uint16_t yValue;
-            if (EMBER_ZCL_STATUS_SUCCESS != Attributes::CurrentY::Get(endpoint, &yValue))
+            if (Status::Success != Attributes::CurrentY::Get(endpoint, &yValue))
             {
                 yValue = 0x607D; // Default Y value according to spec
             }
@@ -133,7 +133,7 @@
         if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kHueAndSaturation))
         {
             uint8_t saturationValue;
-            if (EMBER_ZCL_STATUS_SUCCESS != Attributes::CurrentSaturation::Get(endpoint, &saturationValue))
+            if (Status::Success != Attributes::CurrentSaturation::Get(endpoint, &saturationValue))
             {
                 saturationValue = 0x00;
             }
@@ -143,21 +143,21 @@
         if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kColorLoop))
         {
             uint8_t loopActiveValue;
-            if (EMBER_ZCL_STATUS_SUCCESS != Attributes::ColorLoopActive::Get(endpoint, &loopActiveValue))
+            if (Status::Success != Attributes::ColorLoopActive::Get(endpoint, &loopActiveValue))
             {
                 loopActiveValue = 0x00;
             }
             AddAttributeValuePair(pairs, Attributes::ColorLoopActive::Id, loopActiveValue, attributeCount);
 
             uint8_t loopDirectionValue;
-            if (EMBER_ZCL_STATUS_SUCCESS != Attributes::ColorLoopDirection::Get(endpoint, &loopDirectionValue))
+            if (Status::Success != Attributes::ColorLoopDirection::Get(endpoint, &loopDirectionValue))
             {
                 loopDirectionValue = 0x00;
             }
             AddAttributeValuePair(pairs, Attributes::ColorLoopDirection::Id, loopDirectionValue, attributeCount);
 
             uint16_t loopTimeValue;
-            if (EMBER_ZCL_STATUS_SUCCESS != Attributes::ColorLoopTime::Get(endpoint, &loopTimeValue))
+            if (Status::Success != Attributes::ColorLoopTime::Get(endpoint, &loopTimeValue))
             {
                 loopTimeValue = 0x0019; // Default loop time value according to spec
             }
@@ -167,7 +167,7 @@
         if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kColorTemperature))
         {
             uint16_t temperatureValue;
-            if (EMBER_ZCL_STATUS_SUCCESS != Attributes::ColorTemperatureMireds::Get(endpoint, &temperatureValue))
+            if (Status::Success != Attributes::ColorTemperatureMireds::Get(endpoint, &temperatureValue))
             {
                 temperatureValue = 0x00FA; // Default temperature value according to spec
             }
@@ -175,7 +175,7 @@
         }
 
         uint8_t modeValue;
-        if (EMBER_ZCL_STATUS_SUCCESS != Attributes::EnhancedColorMode::Get(endpoint, &modeValue))
+        if (Status::Success != Attributes::EnhancedColorMode::Get(endpoint, &modeValue))
         {
             modeValue = ColorControl::EnhancedColorMode::kCurrentXAndCurrentY; // Default mode value according to spec
         }
@@ -446,7 +446,7 @@
 {
     bool success;
     uint32_t featureMap;
-    success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == EMBER_ZCL_STATUS_SUCCESS);
+    success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == Status::Success);
 
     return success ? ((featureMap & to_underlying(feature)) != 0) : false;
 }
@@ -2509,11 +2509,11 @@
 uint16_t ColorControlServer::getTemperatureCoupleToLevelMin(EndpointId endpoint)
 {
     uint16_t colorTemperatureCoupleToLevelMin;
-    EmberAfStatus status;
+    Status status;
 
     status = Attributes::CoupleColorTempToLevelMinMireds::Get(endpoint, &colorTemperatureCoupleToLevelMin);
 
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != Status::Success)
     {
         // Not less than the physical min.
         Attributes::ColorTempPhysicalMinMireds::Get(endpoint, &colorTemperatureCoupleToLevelMin);
@@ -2552,14 +2552,14 @@
 
     // Initialize startUpColorTempMireds to "maintain previous value" value null
     app::DataModel::Nullable<uint16_t> startUpColorTemp;
-    EmberAfStatus status = Attributes::StartUpColorTemperatureMireds::Get(endpoint, startUpColorTemp);
+    Status status = Attributes::StartUpColorTemperatureMireds::Get(endpoint, startUpColorTemp);
 
-    if (status == EMBER_ZCL_STATUS_SUCCESS && !startUpColorTemp.IsNull())
+    if (status == Status::Success && !startUpColorTemp.IsNull())
     {
         uint16_t updatedColorTemp = MAX_TEMPERATURE_VALUE;
         status                    = Attributes::ColorTemperatureMireds::Get(endpoint, &updatedColorTemp);
 
-        if (status == EMBER_ZCL_STATUS_SUCCESS)
+        if (status == Status::Success)
         {
             uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE;
             Attributes::ColorTempPhysicalMinMireds::Get(endpoint, &tempPhysicalMin);
@@ -2576,7 +2576,7 @@
                 updatedColorTemp = startUpColorTemp.Value();
                 status           = Attributes::ColorTemperatureMireds::Set(endpoint, updatedColorTemp);
 
-                if (status == EMBER_ZCL_STATUS_SUCCESS)
+                if (status == Status::Success)
                 {
                     // Set ColorMode attributes to reflect ColorTemperature.
                     uint8_t updateColorMode = ColorControl::EnhancedColorMode::kColorTemperature;
@@ -2607,7 +2607,7 @@
         // Check whether our color temperature has actually changed.  If not, do
         // nothing, and wait for it to change.
         uint16_t currentColorTemp;
-        if (Attributes::ColorTemperatureMireds::Get(endpoint, &currentColorTemp) != EMBER_ZCL_STATUS_SUCCESS)
+        if (Attributes::ColorTemperatureMireds::Get(endpoint, &currentColorTemp) != Status::Success)
         {
             // Why can't we read our attribute?
             return;
@@ -2906,9 +2906,9 @@
     if (colorMode == ColorControl::EnhancedColorMode::kColorTemperature)
     {
         app::DataModel::Nullable<uint8_t> currentLevel;
-        EmberAfStatus status = LevelControl::Attributes::CurrentLevel::Get(endpoint, currentLevel);
+        Status status = LevelControl::Attributes::CurrentLevel::Get(endpoint, currentLevel);
 
-        if (status != EMBER_ZCL_STATUS_SUCCESS || currentLevel.IsNull())
+        if (status != Status::Success || currentLevel.IsNull())
         {
             currentLevel.SetNonNull((uint8_t) 0x7F);
         }
diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.h b/src/app/clusters/device-energy-management-server/device-energy-management-server.h
index 3620379..7aeb06d 100644
--- a/src/app/clusters/device-energy-management-server/device-energy-management-server.h
+++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.h
@@ -27,6 +27,7 @@
 #include <app/reporting/reporting.h>
 #include <app/util/attribute-storage.h>
 #include <lib/core/CHIPError.h>
+#include <protocols/interaction_model/StatusCode.h>
 
 namespace chip {
 namespace app {
@@ -35,8 +36,6 @@
 
 using namespace chip::app::Clusters::DeviceEnergyManagement::Attributes;
 
-using chip::Protocols::InteractionModel::Status;
-
 class Delegate
 {
 public:
@@ -52,7 +51,8 @@
      * @param duration The duration that the ESA SHALL maintain the requested power for.
      * @return  Success if the adjustment is accepted; otherwise the command SHALL be rejected with appropriate error.
      */
-    virtual Status PowerAdjustRequest(const int64_t power, const uint32_t duration, AdjustmentCauseEnum cause) = 0;
+    virtual Protocols::InteractionModel::Status PowerAdjustRequest(const int64_t power, const uint32_t duration,
+                                                                   AdjustmentCauseEnum cause) = 0;
 
     /**
      * @brief Delegate SHALL make the ESA end the active power adjustment session & return to normal (or idle) power levels.
@@ -60,7 +60,7 @@
      *
      * @return It should report SUCCESS if successful and FAILURE otherwise.
      */
-    virtual Status CancelPowerAdjustRequest() = 0;
+    virtual Protocols::InteractionModel::Status CancelPowerAdjustRequest() = 0;
 
     /**
      * @brief Delegate for the ESA SHALL update its Forecast attribute with the RequestedStartTime including a new ForecastId.
@@ -76,7 +76,8 @@
      * @return Success if the StartTime in the Forecast is updated, otherwise the command SHALL be rejected with appropriate
      * IM_Status.
      */
-    virtual Status StartTimeAdjustRequest(const uint32_t requestedStartTime, AdjustmentCauseEnum cause) = 0;
+    virtual Protocols::InteractionModel::Status StartTimeAdjustRequest(const uint32_t requestedStartTime,
+                                                                       AdjustmentCauseEnum cause) = 0;
 
     /**
      * @brief Delegate handler for PauseRequest command
@@ -91,7 +92,7 @@
      * @param duration Duration that the ESA SHALL be paused for.
      * @return  Success if the ESA is paused, otherwise returns other IM_Status.
      */
-    virtual Status PauseRequest(const uint32_t duration, AdjustmentCauseEnum cause) = 0;
+    virtual Protocols::InteractionModel::Status PauseRequest(const uint32_t duration, AdjustmentCauseEnum cause) = 0;
 
     /**
      * @brief Delegate handler for ResumeRequest command
@@ -102,7 +103,7 @@
      *
      * @return  Success if the ESA is resumed, otherwise returns other IM_Status.
      */
-    virtual Status ResumeRequest() = 0;
+    virtual Protocols::InteractionModel::Status ResumeRequest() = 0;
 
     /**
      * @brief Delegate handler for ModifyForecastRequest
@@ -118,9 +119,10 @@
      * @return  Success if the entire list of SlotAdjustmentStruct are accepted, otherwise the command
      *          SHALL be rejected returning other IM_Status.
      */
-    virtual Status ModifyForecastRequest(const uint32_t forecastId,
-                                         const DataModel::DecodableList<Structs::SlotAdjustmentStruct::Type> & slotAdjustments,
-                                         AdjustmentCauseEnum cause) = 0;
+    virtual Protocols::InteractionModel::Status
+    ModifyForecastRequest(const uint32_t forecastId,
+                          const DataModel::DecodableList<Structs::SlotAdjustmentStruct::Type> & slotAdjustments,
+                          AdjustmentCauseEnum cause) = 0;
 
     /**
      * @brief Delegate handler for RequestConstraintBasedForecast
@@ -133,8 +135,9 @@
      * @param constraints  Sequence of turn up/down power requests that the ESA is being asked to constrain its operation within.
      * @return  Success if successful, otherwise the command SHALL be rejected returning other IM_Status.
      */
-    virtual Status RequestConstraintBasedForecast(const DataModel::DecodableList<Structs::ConstraintsStruct::Type> & constraints,
-                                                  AdjustmentCauseEnum cause) = 0;
+    virtual Protocols::InteractionModel::Status
+    RequestConstraintBasedForecast(const DataModel::DecodableList<Structs::ConstraintsStruct::Type> & constraints,
+                                   AdjustmentCauseEnum cause) = 0;
 
     /**
      * @brief Delegate handler for CancelRequest
@@ -153,7 +156,7 @@
      *
      * @return  Success if successful, otherwise the command SHALL be rejected returning other IM_Status.
      */
-    virtual Status CancelRequest() = 0;
+    virtual Protocols::InteractionModel::Status CancelRequest() = 0;
 
     // ------------------------------------------------------------------
     // Get attribute methods
@@ -210,7 +213,7 @@
     void InvokeCommand(HandlerContext & handlerContext) override;
     CHIP_ERROR EnumerateAcceptedCommands(const ConcreteClusterPath & cluster, CommandIdCallback callback, void * context) override;
 
-    Status CheckOptOutAllowsRequest(AdjustmentCauseEnum adjustmentCause);
+    Protocols::InteractionModel::Status CheckOptOutAllowsRequest(AdjustmentCauseEnum adjustmentCause);
     void HandlePowerAdjustRequest(HandlerContext & ctx, const Commands::PowerAdjustRequest::DecodableType & commandData);
     void HandleCancelPowerAdjustRequest(HandlerContext & ctx,
                                         const Commands::CancelPowerAdjustRequest::DecodableType & commandData);
diff --git a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp
index 73a626e..dbf3ee3 100644
--- a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp
+++ b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp
@@ -76,18 +76,18 @@
     return instance;
 }
 
-EmberAfStatus DishwasherAlarmServer::GetMaskValue(EndpointId endpoint, BitMask<AlarmMap> * mask)
+Status DishwasherAlarmServer::GetMaskValue(EndpointId endpoint, BitMask<AlarmMap> * mask)
 {
-    EmberAfStatus status = Attributes::Mask::Get(endpoint, mask);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    Status status = Attributes::Mask::Get(endpoint, mask);
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading  mask, err:0x%x", status);
+        ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading  mask, err:0x%x", to_underlying(status));
         return status;
     }
     return status;
 }
 
-EmberAfStatus DishwasherAlarmServer::GetLatchValue(EndpointId endpoint, BitMask<AlarmMap> * latch)
+Status DishwasherAlarmServer::GetLatchValue(EndpointId endpoint, BitMask<AlarmMap> * latch)
 {
     if (!HasResetFeature(endpoint))
     {
@@ -95,48 +95,48 @@
         return EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE;
     }
 
-    EmberAfStatus status = Attributes::Latch::Get(endpoint, latch);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    Status status = Attributes::Latch::Get(endpoint, latch);
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading  latch, err:0x%x", status);
+        ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading  latch, err:0x%x", to_underlying(status));
         return status;
     }
     return status;
 }
 
-EmberAfStatus DishwasherAlarmServer::GetStateValue(EndpointId endpoint, BitMask<AlarmMap> * state)
+Status DishwasherAlarmServer::GetStateValue(EndpointId endpoint, BitMask<AlarmMap> * state)
 {
-    EmberAfStatus status = Attributes::State::Get(endpoint, state);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    Status status = Attributes::State::Get(endpoint, state);
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: get state, err:0x%x", status);
+        ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: get state, err:0x%x", to_underlying(status));
         return status;
     }
     return status;
 }
 
-EmberAfStatus DishwasherAlarmServer::GetSupportedValue(EndpointId endpoint, BitMask<AlarmMap> * supported)
+Status DishwasherAlarmServer::GetSupportedValue(EndpointId endpoint, BitMask<AlarmMap> * supported)
 {
-    EmberAfStatus status = Attributes::Supported::Get(endpoint, supported);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    Status status = Attributes::Supported::Get(endpoint, supported);
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading  supported, err:0x%x", status);
+        ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading  supported, err:0x%x", to_underlying(status));
     }
     return status;
 }
 
-EmberAfStatus DishwasherAlarmServer::SetSupportedValue(EndpointId endpoint, const BitMask<AlarmMap> supported)
+Status DishwasherAlarmServer::SetSupportedValue(EndpointId endpoint, const BitMask<AlarmMap> supported)
 {
-    EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+    Status status = Status::Success;
     ;
-    if ((status = Attributes::Supported::Set(endpoint, supported)) != EMBER_ZCL_STATUS_SUCCESS)
+    if ((status = Attributes::Supported::Set(endpoint, supported)) != Status::Success)
     {
-        ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing supported, err:0x%x", status);
+        ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing supported, err:0x%x", to_underlying(status));
         return status;
     }
     // Whenever there is change in Supported attribute, Latch should change accordingly (if possible).
     BitMask<AlarmMap> latch;
-    if (GetLatchValue(endpoint, &latch) == EMBER_ZCL_STATUS_SUCCESS && !supported.HasAll(latch))
+    if (GetLatchValue(endpoint, &latch) == Status::Success && !supported.HasAll(latch))
     {
         latch  = latch & supported;
         status = SetLatchValue(endpoint, latch);
@@ -144,7 +144,7 @@
 
     // Whenever there is change in Supported attribute, Mask, State should change accordingly.
     BitMask<AlarmMap> mask;
-    if ((status = GetMaskValue(endpoint, &mask)) != EMBER_ZCL_STATUS_SUCCESS)
+    if ((status = GetMaskValue(endpoint, &mask)) != Status::Success)
     {
         return status;
     }
@@ -157,7 +157,7 @@
     return status;
 }
 
-EmberAfStatus DishwasherAlarmServer::SetMaskValue(EndpointId endpoint, const BitMask<AlarmMap> mask)
+Status DishwasherAlarmServer::SetMaskValue(EndpointId endpoint, const BitMask<AlarmMap> mask)
 {
     BitMask<AlarmMap> supported;
     if (GetSupportedValue(endpoint, &supported) || !supported.HasAll(mask))
@@ -166,17 +166,17 @@
         return EMBER_ZCL_STATUS_FAILURE;
     }
 
-    EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
-    if ((status = Attributes::Mask::Set(endpoint, mask)) != EMBER_ZCL_STATUS_SUCCESS)
+    Status status = Status::Success;
+    if ((status = Attributes::Mask::Set(endpoint, mask)) != Status::Success)
     {
-        ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing  mask, err:0x%x", status);
+        ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing  mask, err:0x%x", to_underlying(status));
         return status;
     }
 
     // Whenever there is change in Mask, State should change accordingly.
     BitMask<AlarmMap> state;
     status = GetStateValue(endpoint, &state);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != Status::Success)
     {
         return status;
     }
@@ -189,7 +189,7 @@
     return status;
 }
 
-EmberAfStatus DishwasherAlarmServer::SetLatchValue(EndpointId endpoint, const BitMask<AlarmMap> latch)
+Status DishwasherAlarmServer::SetLatchValue(EndpointId endpoint, const BitMask<AlarmMap> latch)
 {
     if (!HasResetFeature(endpoint))
     {
@@ -204,17 +204,17 @@
         return EMBER_ZCL_STATUS_FAILURE;
     }
 
-    EmberAfStatus status = Attributes::Latch::Set(endpoint, latch);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    Status status = Attributes::Latch::Set(endpoint, latch);
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing  latch, err:0x%x", status);
+        ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing  latch, err:0x%x", to_underlying(status));
         return status;
     }
 
     return status;
 }
 
-EmberAfStatus DishwasherAlarmServer::SetStateValue(EndpointId endpoint, const BitMask<AlarmMap> newState, bool ignoreLatchState)
+Status DishwasherAlarmServer::SetStateValue(EndpointId endpoint, const BitMask<AlarmMap> newState, bool ignoreLatchState)
 {
     BitMask<AlarmMap> supported;
     BitMask<AlarmMap> finalNewState;
@@ -233,17 +233,17 @@
         return EMBER_ZCL_STATUS_FAILURE;
     }
 
-    EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+    Status status = Status::Success;
     BitMask<AlarmMap> currentState;
     status = Attributes::State::Get(endpoint, &currentState);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading  state, err:0x%x", status);
+        ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading  state, err:0x%x", to_underlying(status));
         return status;
     }
 
     BitMask<AlarmMap> latch;
-    if (!ignoreLatchState && (GetLatchValue(endpoint, &latch) == EMBER_ZCL_STATUS_SUCCESS))
+    if (!ignoreLatchState && (GetLatchValue(endpoint, &latch) == Status::Success))
     {
         // Restore bits that have their Latch bit set.
         auto bitsToKeep = latch & currentState;
@@ -252,9 +252,9 @@
 
     // Store the new value of the State attribute.
     status = Attributes::State::Set(endpoint, finalNewState);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing  state, err:0x%x", status);
+        ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing  state, err:0x%x", to_underlying(status));
         return status;
     }
 
@@ -268,7 +268,7 @@
     return status;
 }
 
-EmberAfStatus DishwasherAlarmServer::ResetLatchedAlarms(EndpointId endpoint, const BitMask<AlarmMap> alarms)
+Status DishwasherAlarmServer::ResetLatchedAlarms(EndpointId endpoint, const BitMask<AlarmMap> alarms)
 {
     BitMask<AlarmMap> supported;
     if (GetSupportedValue(endpoint, &supported) || !supported.HasAll(alarms))
@@ -278,7 +278,7 @@
     }
 
     BitMask<AlarmMap> state;
-    if (GetStateValue(endpoint, &state) != EMBER_ZCL_STATUS_SUCCESS)
+    if (GetStateValue(endpoint, &state) != Status::Success)
     {
         return EMBER_ZCL_STATUS_FAILURE;
     }
@@ -290,7 +290,7 @@
 bool DishwasherAlarmServer::HasResetFeature(EndpointId endpoint)
 {
     uint32_t featureMap = 0;
-    if (Attributes::FeatureMap::Get(endpoint, &featureMap) != EMBER_ZCL_STATUS_SUCCESS)
+    if (Attributes::FeatureMap::Get(endpoint, &featureMap) != Status::Success)
     {
         return false;
     }
@@ -319,7 +319,7 @@
     EndpointId endpoint = commandPath.mEndpointId;
     BitMask<AlarmMap> supported;
 
-    if (DishwasherAlarmServer::Instance().GetSupportedValue(endpoint, &supported) != EMBER_ZCL_STATUS_SUCCESS)
+    if (DishwasherAlarmServer::Instance().GetSupportedValue(endpoint, &supported) != Status::Success)
     {
         return Status::Failure;
     }
@@ -340,7 +340,7 @@
         return Status::Failure;
     }
     // The cluster will do this update if delegate.ModifyEnabledAlarmsCallback() returns true.
-    if (DishwasherAlarmServer::Instance().SetMaskValue(endpoint, mask) != EMBER_ZCL_STATUS_SUCCESS)
+    if (DishwasherAlarmServer::Instance().SetMaskValue(endpoint, mask) != Status::Success)
     {
         return Status::Failure;
     }
@@ -366,7 +366,7 @@
     }
 
     // The cluster will do this update if delegate.ResetAlarmsCallback() returns true.
-    if (DishwasherAlarmServer::Instance().ResetLatchedAlarms(endpoint, alarms) != EMBER_ZCL_STATUS_SUCCESS)
+    if (DishwasherAlarmServer::Instance().ResetLatchedAlarms(endpoint, alarms) != Status::Success)
     {
         ChipLogProgress(Zcl, "reset alarms fail");
         return Status::Failure;
diff --git a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.h b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.h
index d03662f..5aff983 100644
--- a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.h
+++ b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.h
@@ -24,6 +24,7 @@
 #include <app/util/af-types.h>
 #include <app/util/basic-types.h>
 #include <platform/CHIPDeviceConfig.h>
+#include <protocols/interaction_model/StatusCode.h>
 
 namespace chip {
 namespace app {
@@ -35,16 +36,16 @@
 public:
     static DishwasherAlarmServer & Instance();
 
-    EmberAfStatus GetMaskValue(EndpointId endpoint, BitMask<AlarmMap> * mask);
-    EmberAfStatus GetStateValue(EndpointId endpoint, BitMask<AlarmMap> * state);
-    EmberAfStatus GetLatchValue(EndpointId endpoint, BitMask<AlarmMap> * latch);
-    EmberAfStatus GetSupportedValue(EndpointId endpoint, BitMask<AlarmMap> * suppported);
+    Protocols::InteractionModel::Status GetMaskValue(EndpointId endpoint, BitMask<AlarmMap> * mask);
+    Protocols::InteractionModel::Status GetStateValue(EndpointId endpoint, BitMask<AlarmMap> * state);
+    Protocols::InteractionModel::Status GetLatchValue(EndpointId endpoint, BitMask<AlarmMap> * latch);
+    Protocols::InteractionModel::Status GetSupportedValue(EndpointId endpoint, BitMask<AlarmMap> * suppported);
 
     // Whenever there is change on Mask we should change State accordingly.
-    EmberAfStatus SetMaskValue(EndpointId endpoint, const BitMask<AlarmMap> mask);
-    EmberAfStatus SetLatchValue(EndpointId endpoint, const BitMask<AlarmMap> latch);
+    Protocols::InteractionModel::Status SetMaskValue(EndpointId endpoint, const BitMask<AlarmMap> mask);
+    Protocols::InteractionModel::Status SetLatchValue(EndpointId endpoint, const BitMask<AlarmMap> latch);
     // A change in supported value will result in a corresponding change in mask and state.
-    EmberAfStatus SetSupportedValue(EndpointId endpoint, const BitMask<AlarmMap> supported);
+    Protocols::InteractionModel::Status SetSupportedValue(EndpointId endpoint, const BitMask<AlarmMap> supported);
 
     /**
      * @brief Set the value of the State attribute
@@ -60,7 +61,8 @@
      * honoring the Mask and Supported attributes.
      * The default value for the ignoreLatchState parameter is false.
      */
-    EmberAfStatus SetStateValue(EndpointId endpoint, const BitMask<AlarmMap> newState, bool ignoreLatchState = false);
+    Protocols::InteractionModel::Status SetStateValue(EndpointId endpoint, const BitMask<AlarmMap> newState,
+                                                      bool ignoreLatchState = false);
 
     /**
      * @brief Reset the value of latched alarms in the State attribute.
@@ -69,7 +71,7 @@
      * @param[in] alarms Each bit set to a 1 in this parameter corresponds to a bit in the
      * State attribute will SHALL be reset to false.
      */
-    EmberAfStatus ResetLatchedAlarms(EndpointId endpoint, const BitMask<AlarmMap> alarms);
+    Protocols::InteractionModel::Status ResetLatchedAlarms(EndpointId endpoint, const BitMask<AlarmMap> alarms);
 
     // check whether the Alarm featureMap has enabled Reset feature.
     bool HasResetFeature(EndpointId endpoint);
diff --git a/src/app/clusters/door-lock-server/door-lock-server.cpp b/src/app/clusters/door-lock-server/door-lock-server.cpp
index 8f1037a..7f1a991 100644
--- a/src/app/clusters/door-lock-server/door-lock-server.cpp
+++ b/src/app/clusters/door-lock-server/door-lock-server.cpp
@@ -466,7 +466,7 @@
         return;
     }
 
-    EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+    Status status = Status::Success;
     switch (operationType)
     {
     case DataOperationTypeEnum::kAdd:
@@ -481,7 +481,7 @@
     default:
         // appclusters, 5.2.4.34: SetUser command allow only kAdd/kModify, we should respond with INVALID_COMMAND if we got kClear
         // or anything else
-        status = EMBER_ZCL_STATUS_INVALID_COMMAND;
+        status = Status::InvalidCommand;
         ChipLogProgress(Zcl, "[SetUser] Invalid operation type [endpointId=%d,operationType=%u]", commandPath.mEndpointId,
                         to_underlying(operationType));
         break;
@@ -1873,25 +1873,26 @@
     return false;
 }
 
-EmberAfStatus DoorLockServer::createUser(chip::EndpointId endpointId, chip::FabricIndex creatorFabricIdx, chip::NodeId sourceNodeId,
-                                         uint16_t userIndex, const Nullable<chip::CharSpan> & userName,
-                                         const Nullable<uint32_t> & userUniqueId, const Nullable<UserStatusEnum> & userStatus,
-                                         const Nullable<UserTypeEnum> & userType,
-                                         const Nullable<CredentialRuleEnum> & credentialRule,
-                                         const Nullable<CredentialStruct> & credential)
+Status DoorLockServer::createUser(chip::EndpointId endpointId, chip::FabricIndex creatorFabricIdx, chip::NodeId sourceNodeId,
+                                  uint16_t userIndex, const Nullable<chip::CharSpan> & userName,
+                                  const Nullable<uint32_t> & userUniqueId, const Nullable<UserStatusEnum> & userStatus,
+                                  const Nullable<UserTypeEnum> & userType, const Nullable<CredentialRuleEnum> & credentialRule,
+                                  const Nullable<CredentialStruct> & credential)
 {
     EmberAfPluginDoorLockUserInfo user;
     if (!emberAfPluginDoorLockGetUser(endpointId, userIndex, user))
     {
         ChipLogError(Zcl, "[createUser] Unable to get the user from app [endpointId=%d,userIndex=%d]", endpointId, userIndex);
-        return EMBER_ZCL_STATUS_FAILURE;
+        return Status::Failure;
     }
 
     // appclusters, 5.2.4.34: to modify user its status should be set to Available. If it is we should return OCCUPIED.
     if (UserStatusEnum::kAvailable != user.userStatus)
     {
         ChipLogProgress(Zcl, "[createUser] Unable to overwrite existing user [endpointId=%d,userIndex=%d]", endpointId, userIndex);
-        return static_cast<EmberAfStatus>(DlStatus::kOccupied);
+        // TODO FixMe  https://github.com/project-chip/connectedhomeip/issues/32100
+        return static_cast<Status>(DlStatus::kOccupied);
+        ;
     }
 
     const auto & newUserName                = !userName.IsNull() ? userName.Value() : ""_span;
@@ -1917,7 +1918,7 @@
                         endpointId, creatorFabricIdx, userIndex, static_cast<int>(newUserName.size()), newUserName.data(),
                         newUserUniqueId, to_underlying(newUserStatus), to_underlying(newUserType), to_underlying(newCredentialRule),
                         static_cast<unsigned int>(newTotalCredentials));
-        return EMBER_ZCL_STATUS_FAILURE;
+        return Status::Failure;
     }
 
     ChipLogProgress(Zcl,
@@ -1934,25 +1935,24 @@
     return EMBER_ZCL_STATUS_SUCCESS;
 }
 
-EmberAfStatus DoorLockServer::modifyUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricIndex,
-                                         chip::NodeId sourceNodeId, uint16_t userIndex, const Nullable<chip::CharSpan> & userName,
-                                         const Nullable<uint32_t> & userUniqueId, const Nullable<UserStatusEnum> & userStatus,
-                                         const Nullable<UserTypeEnum> & userType,
-                                         const Nullable<CredentialRuleEnum> & credentialRule)
+Status DoorLockServer::modifyUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricIndex, chip::NodeId sourceNodeId,
+                                  uint16_t userIndex, const Nullable<chip::CharSpan> & userName,
+                                  const Nullable<uint32_t> & userUniqueId, const Nullable<UserStatusEnum> & userStatus,
+                                  const Nullable<UserTypeEnum> & userType, const Nullable<CredentialRuleEnum> & credentialRule)
 {
     // We should get the user by that index first
     EmberAfPluginDoorLockUserInfo user;
     if (!emberAfPluginDoorLockGetUser(endpointId, userIndex, user))
     {
         ChipLogError(Zcl, "[modifyUser] Unable to get the user from app [endpointId=%d,userIndex=%d]", endpointId, userIndex);
-        return EMBER_ZCL_STATUS_FAILURE;
+        return Status::Failure;
     }
 
     // appclusters, 5.2.4.34: to modify user its status should NOT be set to Available. If it is we should return INVALID_COMMAND.
     if (UserStatusEnum::kAvailable == user.userStatus)
     {
         ChipLogProgress(Zcl, "[modifyUser] Unable to modify non-existing user [endpointId=%d,userIndex=%d]", endpointId, userIndex);
-        return EMBER_ZCL_STATUS_INVALID_COMMAND;
+        return Status::InvalidCommand;
     }
 
     // appclusters, 5.2.4.34: UserName SHALL be null if modifying a user record that was not created by the accessing fabric
@@ -1962,7 +1962,7 @@
                         "[modifyUser] Unable to modify name of user created by different fabric "
                         "[endpointId=%d,userIndex=%d,creatorIdx=%d,modifierIdx=%d]",
                         endpointId, userIndex, user.createdBy, modifierFabricIndex);
-        return EMBER_ZCL_STATUS_INVALID_COMMAND;
+        return Status::InvalidCommand;
     }
 
     // appclusters, 5.2.4.34: UserUniqueID SHALL be null if modifying the user record that was not created by the accessing fabric.
@@ -1972,7 +1972,7 @@
                         "[modifyUser] Unable to modify UUID of user created by different fabric "
                         "[endpointId=%d,userIndex=%d,creatorIdx=%d,modifierIdx=%d]",
                         endpointId, userIndex, user.createdBy, modifierFabricIndex);
-        return EMBER_ZCL_STATUS_INVALID_COMMAND;
+        return Status::InvalidCommand;
     }
 
     const auto & newUserName = !userName.IsNull() ? userName.Value() : user.userName;
@@ -1991,7 +1991,7 @@
                      ",userType=%u,credentialRule=%u]",
                      endpointId, modifierFabricIndex, userIndex, static_cast<int>(newUserName.size()), newUserName.data(),
                      newUserUniqueId, to_underlying(newUserStatus), to_underlying(newUserType), to_underlying(newCredentialRule));
-        return EMBER_ZCL_STATUS_FAILURE;
+        return Status::Failure;
     }
 
     ChipLogProgress(Zcl,
@@ -2004,7 +2004,7 @@
     sendRemoteLockUserChange(endpointId, LockDataTypeEnum::kUserIndex, DataOperationTypeEnum::kModify, sourceNodeId,
                              modifierFabricIndex, userIndex, userIndex);
 
-    return EMBER_ZCL_STATUS_SUCCESS;
+    return Status::Success;
 }
 
 Status DoorLockServer::clearUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricId, chip::NodeId sourceNodeId,
@@ -3406,7 +3406,7 @@
 }
 
 void DoorLockServer::sendClusterResponse(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
-                                         EmberAfStatus status)
+                                         Status status)
 {
     VerifyOrDie(nullptr != commandObj);
 
@@ -3627,10 +3627,10 @@
 
 template <typename T>
 bool DoorLockServer::GetAttribute(chip::EndpointId endpointId, chip::AttributeId attributeId,
-                                  EmberAfStatus (*getFn)(chip::EndpointId endpointId, T * value), T & value) const
+                                  Status (*getFn)(chip::EndpointId endpointId, T * value), T & value) const
 {
-    EmberAfStatus status = getFn(endpointId, &value);
-    bool success         = (EMBER_ZCL_STATUS_SUCCESS == status);
+    Status status = getFn(endpointId, &value);
+    bool success  = (Status::Success == status);
 
     if (!success)
     {
@@ -3642,10 +3642,10 @@
 
 template <typename T>
 bool DoorLockServer::SetAttribute(chip::EndpointId endpointId, chip::AttributeId attributeId,
-                                  EmberAfStatus (*setFn)(chip::EndpointId endpointId, T value), T value)
+                                  Status (*setFn)(chip::EndpointId endpointId, T value), T value)
 {
-    EmberAfStatus status = setFn(endpointId, value);
-    bool success         = (EMBER_ZCL_STATUS_SUCCESS == status);
+    Status status = setFn(endpointId, value);
+    bool success  = (Status::Success == status);
 
     if (!success)
     {
@@ -3951,11 +3951,11 @@
         return;
     }
 
-    EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+    Status status = Status::Success;
     if (!emberAfPluginDoorLockSetAliroReaderConfig(endpointID, signingKey, verificationKey, groupIdentifier, groupResolvingKey))
     {
         ChipLogProgress(Zcl, "[SetAliroReaderConfig] Unable to set aliro reader config [endpointId=%d]", endpointID);
-        status = EMBER_ZCL_STATUS_FAILURE;
+        status = Status::Failure;
     }
     sendClusterResponse(commandObj, commandPath, status);
 }
@@ -3973,11 +3973,11 @@
         return;
     }
 
-    EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+    Status status = Status::Success;
     if (!emberAfPluginDoorLockClearAliroReaderConfig(endpointID))
     {
         ChipLogProgress(Zcl, "[SetAliroReaderConfig] Unable to set aliro reader config [endpointId=%d]", endpointID);
-        status = EMBER_ZCL_STATUS_FAILURE;
+        status = Status::Failure;
     }
     sendClusterResponse(commandObj, commandPath, status);
 }
diff --git a/src/app/clusters/door-lock-server/door-lock-server.h b/src/app/clusters/door-lock-server/door-lock-server.h
index 9b1a7f6..dd11ebd 100644
--- a/src/app/clusters/door-lock-server/door-lock-server.h
+++ b/src/app/clusters/door-lock-server/door-lock-server.h
@@ -307,15 +307,17 @@
     bool findUserIndexByCredential(chip::EndpointId endpointId, CredentialTypeEnum credentialType, chip::ByteSpan credentialData,
                                    uint16_t & userIndex, uint16_t & credentialIndex, EmberAfPluginDoorLockUserInfo & userInfo);
 
-    EmberAfStatus createUser(chip::EndpointId endpointId, chip::FabricIndex creatorFabricIdx, chip::NodeId sourceNodeId,
-                             uint16_t userIndex, const Nullable<chip::CharSpan> & userName, const Nullable<uint32_t> & userUniqueId,
-                             const Nullable<UserStatusEnum> & userStatus, const Nullable<UserTypeEnum> & userType,
-                             const Nullable<CredentialRuleEnum> & credentialRule,
-                             const Nullable<CredentialStruct> & credential = Nullable<CredentialStruct>());
-    EmberAfStatus modifyUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricIndex, chip::NodeId sourceNodeId,
-                             uint16_t userIndex, const Nullable<chip::CharSpan> & userName, const Nullable<uint32_t> & userUniqueId,
-                             const Nullable<UserStatusEnum> & userStatus, const Nullable<UserTypeEnum> & userType,
-                             const Nullable<CredentialRuleEnum> & credentialRule);
+    chip::Protocols::InteractionModel::Status
+    createUser(chip::EndpointId endpointId, chip::FabricIndex creatorFabricIdx, chip::NodeId sourceNodeId, uint16_t userIndex,
+               const Nullable<chip::CharSpan> & userName, const Nullable<uint32_t> & userUniqueId,
+               const Nullable<UserStatusEnum> & userStatus, const Nullable<UserTypeEnum> & userType,
+               const Nullable<CredentialRuleEnum> & credentialRule,
+               const Nullable<CredentialStruct> & credential = Nullable<CredentialStruct>());
+    chip::Protocols::InteractionModel::Status
+    modifyUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricIndex, chip::NodeId sourceNodeId, uint16_t userIndex,
+               const Nullable<chip::CharSpan> & userName, const Nullable<uint32_t> & userUniqueId,
+               const Nullable<UserStatusEnum> & userStatus, const Nullable<UserTypeEnum> & userType,
+               const Nullable<CredentialRuleEnum> & credentialRule);
     chip::Protocols::InteractionModel::Status clearUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricId,
                                                         chip::NodeId sourceNodeId, uint16_t userIndex, bool sendUserChangeEvent);
     chip::Protocols::InteractionModel::Status clearUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricId,
@@ -477,7 +479,7 @@
     bool engageLockout(chip::EndpointId endpointId);
 
     static void sendClusterResponse(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
-                                    EmberAfStatus status);
+                                    chip::Protocols::InteractionModel::Status status);
 
     /**
      * @brief Common handler for LockDoor, UnlockDoor, UnlockWithTimeout commands
@@ -544,7 +546,7 @@
      */
     template <typename T>
     bool GetAttribute(chip::EndpointId endpointId, chip::AttributeId attributeId,
-                      EmberAfStatus (*getFn)(chip::EndpointId endpointId, T * value), T & value) const;
+                      chip::Protocols::InteractionModel::Status (*getFn)(chip::EndpointId endpointId, T * value), T & value) const;
 
     /**
      * @brief Set generic attribute value
@@ -559,7 +561,7 @@
      */
     template <typename T>
     bool SetAttribute(chip::EndpointId endpointId, chip::AttributeId attributeId,
-                      EmberAfStatus (*setFn)(chip::EndpointId endpointId, T value), T value);
+                      chip::Protocols::InteractionModel::Status (*setFn)(chip::EndpointId endpointId, T value), T value);
 
     // AttributeAccessInterface's Read API
     CHIP_ERROR Read(const chip::app::ConcreteReadAttributePath & aPath, chip::app::AttributeValueEncoder & aEncoder) override;
diff --git a/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.h b/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.h
index 0b5d45f..28af3fa 100644
--- a/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.h
+++ b/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.h
@@ -22,6 +22,7 @@
 #include <app-common/zap-generated/cluster-objects.h>
 #include <app/AttributeAccessInterface.h>
 #include <lib/support/CommonIterator.h>
+#include <protocols/interaction_model/StatusCode.h>
 
 namespace chip {
 namespace app {
@@ -31,8 +32,6 @@
 using namespace chip::app::Clusters::ElectricalPowerMeasurement::Attributes;
 using namespace chip::app::Clusters::ElectricalPowerMeasurement::Structs;
 
-using chip::Protocols::InteractionModel::Status;
-
 class Delegate
 {
 public:
diff --git a/src/app/clusters/energy-evse-server/energy-evse-server.h b/src/app/clusters/energy-evse-server/energy-evse-server.h
index dfead37..2ff46f3 100644
--- a/src/app/clusters/energy-evse-server/energy-evse-server.h
+++ b/src/app/clusters/energy-evse-server/energy-evse-server.h
@@ -27,6 +27,7 @@
 #include <app/reporting/reporting.h>
 #include <app/util/attribute-storage.h>
 #include <lib/core/CHIPError.h>
+#include <protocols/interaction_model/StatusCode.h>
 
 namespace chip {
 namespace app {
@@ -38,7 +39,6 @@
 constexpr int64_t kMaximumChargeCurrent         = 80000;
 constexpr uint32_t kMaxRandomizationDelayWindow = 86400;
 
-using chip::Protocols::InteractionModel::Status;
 /** @brief
  *    Defines methods for implementing application-specific logic for the EVSE Management Cluster.
  */
@@ -55,30 +55,31 @@
      * It should report Status::Success if successful and may
      * return other Status codes if it fails
      */
-    virtual Status Disable() = 0;
+    virtual Protocols::InteractionModel::Status Disable() = 0;
 
     /**
      * @brief Delegate should implement a handler to enable EVSE Charging.
      * It should report Status::Success if successful and may
      * return other Status codes if it fails
      */
-    virtual Status EnableCharging(const DataModel::Nullable<uint32_t> & enableChargeTime, const int64_t & minimumChargeCurrent,
-                                  const int64_t & maximumChargeCurrent) = 0;
+    virtual Protocols::InteractionModel::Status EnableCharging(const DataModel::Nullable<uint32_t> & enableChargeTime,
+                                                               const int64_t & minimumChargeCurrent,
+                                                               const int64_t & maximumChargeCurrent) = 0;
 
     /**
      * @brief Delegate should implement a handler to enable EVSE Discharging.
      * It should report Status::Success if successful and may
      * return other Status codes if it fails
      */
-    virtual Status EnableDischarging(const DataModel::Nullable<uint32_t> & enableDischargeTime,
-                                     const int64_t & maximumDischargeCurrent) = 0;
+    virtual Protocols::InteractionModel::Status EnableDischarging(const DataModel::Nullable<uint32_t> & enableDischargeTime,
+                                                                  const int64_t & maximumDischargeCurrent) = 0;
 
     /**
      * @brief Delegate should implement a handler to enable EVSE Diagnostics.
      * It should report Status::Success if successful and may
      * return other Status codes if it fails
      */
-    virtual Status StartDiagnostics() = 0;
+    virtual Protocols::InteractionModel::Status StartDiagnostics() = 0;
 
     // ------------------------------------------------------------------
     // Get attribute methods
diff --git a/src/app/clusters/fan-control-server/fan-control-server.cpp b/src/app/clusters/fan-control-server/fan-control-server.cpp
index 8bca0d1..b297acd 100644
--- a/src/app/clusters/fan-control-server/fan-control-server.cpp
+++ b/src/app/clusters/fan-control-server/fan-control-server.cpp
@@ -34,6 +34,7 @@
 #include <app/util/attribute-storage.h>
 #include <lib/support/CodeUtils.h>
 #include <lib/support/logging/CHIPLogging.h>
+#include <protocols/interaction_model/StatusCode.h>
 
 using namespace chip;
 using namespace chip::app;
@@ -41,6 +42,8 @@
 using namespace chip::app::Clusters::FanControl;
 using namespace chip::app::Clusters::FanControl::Attributes;
 
+using Protocols::InteractionModel::Status;
+
 namespace {
 
 constexpr size_t kFanControlDelegateTableSize =
@@ -85,11 +88,11 @@
 // Indicates if the write operation is from the cluster server itself
 bool gWriteFromClusterLogic = false;
 
-EmberAfStatus SetFanModeToOff(EndpointId endpointId)
+Status SetFanModeToOff(EndpointId endpointId)
 {
     FanModeEnum currentFanMode;
-    EmberAfStatus status = FanMode::Get(endpointId, &currentFanMode);
-    VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status);
+    Status status = FanMode::Get(endpointId, &currentFanMode);
+    VerifyOrReturnError(Status::Success == status, status);
 
     if (currentFanMode != FanModeEnum::kOff)
     {
@@ -103,7 +106,7 @@
 {
     bool success;
     uint32_t featureMap;
-    success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == EMBER_ZCL_STATUS_SUCCESS);
+    success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == Status::Success);
 
     return success ? ((featureMap & to_underlying(feature)) != 0) : false;
 }
@@ -163,8 +166,8 @@
         else if (*value == to_underlying(FanModeEnum::kSmart))
         {
             FanModeSequenceEnum fanModeSequence;
-            EmberAfStatus status = FanModeSequence::Get(attributePath.mEndpointId, &fanModeSequence);
-            VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, Status::Failure);
+            Status status = FanModeSequence::Get(attributePath.mEndpointId, &fanModeSequence);
+            VerifyOrReturnError(Status::Success == status, Status::Failure);
 
             if (SupportsAuto(attributePath.mEndpointId) &&
                 ((fanModeSequence == FanModeSequenceEnum::kOffLowHighAuto) ||
@@ -204,8 +207,8 @@
             else
             {
                 uint8_t speedMax;
-                EmberAfStatus status = SpeedMax::Get(attributePath.mEndpointId, &speedMax);
-                VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, Status::ConstraintError);
+                Status status = SpeedMax::Get(attributePath.mEndpointId, &speedMax);
+                VerifyOrReturnError(Status::Success == status, Status::ConstraintError);
 
                 if (*value <= speedMax)
                 {
@@ -247,8 +250,8 @@
         if (SupportsRocking(attributePath.mEndpointId))
         {
             BitMask<RockBitmap> rockSupport;
-            EmberAfStatus status = RockSupport::Get(attributePath.mEndpointId, &rockSupport);
-            VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, Status::ConstraintError);
+            Status status = RockSupport::Get(attributePath.mEndpointId, &rockSupport);
+            VerifyOrReturnError(Status::Success == status, Status::ConstraintError);
             auto rawRockSupport = rockSupport.Raw();
             if ((*value & rawRockSupport) == *value)
             {
@@ -269,8 +272,8 @@
         if (SupportsWind(attributePath.mEndpointId))
         {
             BitMask<WindBitmap> windSupport;
-            EmberAfStatus status = WindSupport::Get(attributePath.mEndpointId, &windSupport);
-            VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, Status::ConstraintError);
+            Status status = WindSupport::Get(attributePath.mEndpointId, &windSupport);
+            VerifyOrReturnError(Status::Success == status, Status::ConstraintError);
             auto rawWindSupport = windSupport.Raw();
             if ((*value & rawWindSupport) == *value)
             {
@@ -312,30 +315,30 @@
     {
     case FanMode::Id: {
         FanModeEnum mode;
-        EmberAfStatus status = FanMode::Get(attributePath.mEndpointId, &mode);
-        VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status);
+        Status status = FanMode::Get(attributePath.mEndpointId, &mode);
+        VerifyOrReturn(Status::Success == status);
 
         // Setting the FanMode value to Off SHALL set the values of PercentSetting, PercentCurrent,
         // SpeedSetting, SpeedCurrent attributes to 0 (zero).
         if (mode == FanModeEnum::kOff)
         {
             status = PercentSetting::Set(attributePath.mEndpointId, 0);
-            VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
-                           ChipLogError(Zcl, "Failed to write PercentSetting with error: 0x%02x", status));
+            VerifyOrReturn(Status::Success == status,
+                           ChipLogError(Zcl, "Failed to write PercentSetting with error: 0x%02x", to_underlying(status)));
 
             status = PercentCurrent::Set(attributePath.mEndpointId, 0);
-            VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
-                           ChipLogError(Zcl, "Failed to write PercentCurrent with error: 0x%02x", status));
+            VerifyOrReturn(Status::Success == status,
+                           ChipLogError(Zcl, "Failed to write PercentCurrent with error: 0x%02x", to_underlying(status)));
 
             if (SupportsMultiSpeed(attributePath.mEndpointId))
             {
                 status = SpeedSetting::Set(attributePath.mEndpointId, 0);
-                VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
-                               ChipLogError(Zcl, "Failed to write SpeedSetting with error: 0x%02x", status));
+                VerifyOrReturn(Status::Success == status,
+                               ChipLogError(Zcl, "Failed to write SpeedSetting with error: 0x%02x", to_underlying(status)));
 
                 status = SpeedCurrent::Set(attributePath.mEndpointId, 0);
-                VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
-                               ChipLogError(Zcl, "Failed to write SpeedCurrent with error: 0x%02x", status));
+                VerifyOrReturn(Status::Success == status,
+                               ChipLogError(Zcl, "Failed to write SpeedCurrent with error: 0x%02x", to_underlying(status)));
             }
         }
 
@@ -345,30 +348,30 @@
         {
             gWriteFromClusterLogic = true;
             status                 = PercentSetting::SetNull(attributePath.mEndpointId);
-            VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
-                           ChipLogError(Zcl, "Failed to write PercentSetting with error: 0x%02x", status));
+            VerifyOrReturn(Status::Success == status,
+                           ChipLogError(Zcl, "Failed to write PercentSetting with error: 0x%02x", to_underlying(status)));
 
             if (SupportsMultiSpeed(attributePath.mEndpointId))
             {
                 gWriteFromClusterLogic = true;
                 status                 = SpeedSetting::SetNull(attributePath.mEndpointId);
-                VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
-                               ChipLogError(Zcl, "Failed to write SpeedSetting with error: 0x%02x", status));
+                VerifyOrReturn(Status::Success == status,
+                               ChipLogError(Zcl, "Failed to write SpeedSetting with error: 0x%02x", to_underlying(status)));
             }
         }
         break;
     }
     case PercentSetting::Id: {
         DataModel::Nullable<Percent> percentSetting;
-        EmberAfStatus status = PercentSetting::Get(attributePath.mEndpointId, percentSetting);
-        VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status && !percentSetting.IsNull());
+        Status status = PercentSetting::Get(attributePath.mEndpointId, percentSetting);
+        VerifyOrReturn(Status::Success == status && !percentSetting.IsNull());
 
         // If PercentSetting is set to 0, the server SHALL set the FanMode attribute value to Off.
         if (percentSetting.Value() == 0)
         {
             status = SetFanModeToOff(attributePath.mEndpointId);
-            VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
-                           ChipLogError(Zcl, "Failed to set FanMode to off with error: 0x%02x", status));
+            VerifyOrReturn(Status::Success == status,
+                           ChipLogError(Zcl, "Failed to set FanMode to off with error: 0x%02x", to_underlying(status)));
         }
 
         if (SupportsMultiSpeed(attributePath.mEndpointId))
@@ -377,13 +380,13 @@
             // speed = ceil( SpeedMax * (percent * 0.01) )
             uint8_t speedMax;
             status = SpeedMax::Get(attributePath.mEndpointId, &speedMax);
-            VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
-                           ChipLogError(Zcl, "Failed to get SpeedMax with error: 0x%02x", status));
+            VerifyOrReturn(Status::Success == status,
+                           ChipLogError(Zcl, "Failed to get SpeedMax with error: 0x%02x", to_underlying(status)));
 
             DataModel::Nullable<uint8_t> currentSpeedSetting;
             status = SpeedSetting::Get(attributePath.mEndpointId, currentSpeedSetting);
-            VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
-                           ChipLogError(Zcl, "Failed to get SpeedSetting with error: 0x%02x", status));
+            VerifyOrReturn(Status::Success == status,
+                           ChipLogError(Zcl, "Failed to get SpeedSetting with error: 0x%02x", to_underlying(status)));
 
             uint16_t percent = percentSetting.Value();
             // Plus 99 then integer divide by 100 instead of multiplying 0.01 to avoid floating point precision error
@@ -392,8 +395,8 @@
             if (currentSpeedSetting.IsNull() || speedSetting != currentSpeedSetting.Value())
             {
                 status = SpeedSetting::Set(attributePath.mEndpointId, speedSetting);
-                VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
-                               ChipLogError(Zcl, "Failed to set SpeedSetting with error: 0x%02x", status));
+                VerifyOrReturn(Status::Success == status,
+                               ChipLogError(Zcl, "Failed to set SpeedSetting with error: 0x%02x", to_underlying(status)));
             }
         }
         break;
@@ -402,28 +405,28 @@
         if (SupportsMultiSpeed(attributePath.mEndpointId))
         {
             DataModel::Nullable<uint8_t> speedSetting;
-            EmberAfStatus status = SpeedSetting::Get(attributePath.mEndpointId, speedSetting);
-            VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status && !speedSetting.IsNull());
+            Status status = SpeedSetting::Get(attributePath.mEndpointId, speedSetting);
+            VerifyOrReturn(Status::Success == status && !speedSetting.IsNull());
 
             // If SpeedSetting is set to 0, the server SHALL set the FanMode attribute value to Off.
             if (speedSetting.Value() == 0)
             {
                 status = SetFanModeToOff(attributePath.mEndpointId);
-                VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
-                               ChipLogError(Zcl, "Failed to set FanMode to off with error: 0x%02x", status));
+                VerifyOrReturn(Status::Success == status,
+                               ChipLogError(Zcl, "Failed to set FanMode to off with error: 0x%02x", to_underlying(status)));
             }
 
             // Adjust PercentSetting from a speed value change for SpeedSetting
             // percent = floor( speed/SpeedMax * 100 )
             uint8_t speedMax;
             status = SpeedMax::Get(attributePath.mEndpointId, &speedMax);
-            VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
-                           ChipLogError(Zcl, "Failed to get SpeedMax with error: 0x%02x", status));
+            VerifyOrReturn(Status::Success == status,
+                           ChipLogError(Zcl, "Failed to get SpeedMax with error: 0x%02x", to_underlying(status)));
 
             DataModel::Nullable<Percent> currentPercentSetting;
             status = PercentSetting::Get(attributePath.mEndpointId, currentPercentSetting);
-            VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
-                           ChipLogError(Zcl, "Failed to get PercentSetting with error: 0x%02x", status));
+            VerifyOrReturn(Status::Success == status,
+                           ChipLogError(Zcl, "Failed to get PercentSetting with error: 0x%02x", to_underlying(status)));
 
             float speed            = speedSetting.Value();
             Percent percentSetting = static_cast<Percent>(speed / speedMax * 100);
@@ -431,8 +434,8 @@
             if (currentPercentSetting.IsNull() || percentSetting != currentPercentSetting.Value())
             {
                 status = PercentSetting::Set(attributePath.mEndpointId, percentSetting);
-                VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
-                               ChipLogError(Zcl, "Failed to set PercentSetting with error: 0x%02x", status));
+                VerifyOrReturn(Status::Success == status,
+                               ChipLogError(Zcl, "Failed to set PercentSetting with error: 0x%02x", to_underlying(status)));
             }
         }
         break;
diff --git a/src/app/clusters/groups-server/groups-server.cpp b/src/app/clusters/groups-server/groups-server.cpp
index d591c3f..04e26a0 100644
--- a/src/app/clusters/groups-server/groups-server.cpp
+++ b/src/app/clusters/groups-server/groups-server.cpp
@@ -102,40 +102,40 @@
     return Status::ResourceExhausted;
 }
 
-static EmberAfStatus GroupRemove(FabricIndex fabricIndex, EndpointId endpointId, GroupId groupId)
+static Status GroupRemove(FabricIndex fabricIndex, EndpointId endpointId, GroupId groupId)
 {
-    VerifyOrReturnError(IsValidGroupId(groupId), EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
-    VerifyOrReturnError(GroupExists(fabricIndex, endpointId, groupId), EMBER_ZCL_STATUS_NOT_FOUND);
+    VerifyOrReturnError(IsValidGroupId(groupId), Status::ConstraintError);
+    VerifyOrReturnError(GroupExists(fabricIndex, endpointId, groupId), Status::NotFound);
 
     GroupDataProvider * provider = GetGroupDataProvider();
-    VerifyOrReturnError(nullptr != provider, EMBER_ZCL_STATUS_NOT_FOUND);
+    VerifyOrReturnError(nullptr != provider, Status::NotFound);
 
     CHIP_ERROR err = provider->RemoveEndpoint(fabricIndex, groupId, endpointId);
     if (CHIP_NO_ERROR == err)
     {
         MatterReportingAttributeChangeCallback(kRootEndpointId, GroupKeyManagement::Id,
                                                GroupKeyManagement::Attributes::GroupTable::Id);
-        return EMBER_ZCL_STATUS_SUCCESS;
+        return Status::Success;
     }
 
     ChipLogDetail(Zcl, "ERR: Failed to remove mapping (end:%d, group:0x%x), err:%" CHIP_ERROR_FORMAT, endpointId, groupId,
                   err.Format());
-    return EMBER_ZCL_STATUS_NOT_FOUND;
+    return Status::NotFound;
 }
 
 void emberAfGroupsClusterServerInitCallback(EndpointId endpointId)
 {
     // According to spec, highest bit (Group Names) MUST match feature bit 0 (Group Names)
-    EmberAfStatus status = Attributes::NameSupport::Set(endpointId, NameSupportBitmap::kGroupNames);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    Status status = Attributes::NameSupport::Set(endpointId, NameSupportBitmap::kGroupNames);
+    if (status != Status::Success)
     {
-        ChipLogDetail(Zcl, "ERR: writing NameSupport %x", status);
+        ChipLogDetail(Zcl, "ERR: writing NameSupport %x", to_underlying(status));
     }
 
     status = Attributes::FeatureMap::Set(endpointId, static_cast<uint32_t>(Feature::kGroupNames));
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != Status::Success)
     {
-        ChipLogDetail(Zcl, "ERR: writing group feature map %x", status);
+        ChipLogDetail(Zcl, "ERR: writing group feature map %x", to_underlying(status));
     }
 }
 
@@ -161,21 +161,21 @@
     GroupDataProvider * provider = GetGroupDataProvider();
     GroupDataProvider::GroupInfo info;
     Groups::Commands::ViewGroupResponse::Type response;
-    CHIP_ERROR err       = CHIP_NO_ERROR;
-    EmberAfStatus status = EMBER_ZCL_STATUS_NOT_FOUND;
+    CHIP_ERROR err = CHIP_NO_ERROR;
+    Status status  = Status::NotFound;
 
-    VerifyOrExit(IsValidGroupId(groupId), status = EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
-    VerifyOrExit(nullptr != provider, status = EMBER_ZCL_STATUS_FAILURE);
-    VerifyOrExit(provider->HasEndpoint(fabricIndex, groupId, commandPath.mEndpointId), status = EMBER_ZCL_STATUS_NOT_FOUND);
+    VerifyOrExit(IsValidGroupId(groupId), status = Status::ConstraintError);
+    VerifyOrExit(nullptr != provider, status = Status::Failure);
+    VerifyOrExit(provider->HasEndpoint(fabricIndex, groupId, commandPath.mEndpointId), status = Status::NotFound);
 
     err = provider->GetGroupInfo(fabricIndex, groupId, info);
-    VerifyOrExit(CHIP_NO_ERROR == err, status = EMBER_ZCL_STATUS_NOT_FOUND);
+    VerifyOrExit(CHIP_NO_ERROR == err, status = Status::NotFound);
 
     response.groupName = CharSpan(info.name, strnlen(info.name, GroupDataProvider::GroupInfo::kGroupNameMax));
-    status             = EMBER_ZCL_STATUS_SUCCESS;
+    status             = Status::Success;
 exit:
     response.groupID = groupId;
-    response.status  = status;
+    response.status  = to_underlying(status);
     commandObj->AddResponse(commandPath, response);
     return true;
 }
diff --git a/src/app/clusters/icd-management-server/icd-management-server.cpp b/src/app/clusters/icd-management-server/icd-management-server.cpp
index 90953e3..cac9e2d 100644
--- a/src/app/clusters/icd-management-server/icd-management-server.cpp
+++ b/src/app/clusters/icd-management-server/icd-management-server.cpp
@@ -36,6 +36,8 @@
 using namespace Protocols;
 using namespace chip::Access;
 
+using chip::Protocols::InteractionModel::Status;
+
 namespace {
 
 /**
diff --git a/src/app/clusters/icd-management-server/icd-management-server.h b/src/app/clusters/icd-management-server/icd-management-server.h
index 308d508..0763f48 100644
--- a/src/app/clusters/icd-management-server/icd-management-server.h
+++ b/src/app/clusters/icd-management-server/icd-management-server.h
@@ -29,8 +29,6 @@
 #include <lib/support/Span.h>
 #include <protocols/interaction_model/StatusCode.h>
 
-using chip::Protocols::InteractionModel::Status;
-
 class ICDManagementServer
 {
 public:
@@ -46,14 +44,16 @@
      * ICDConfigurationData If function fails, icdCounter will be unchanged
      * @return Status
      */
-    Status RegisterClient(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
-                          const chip::app::Clusters::IcdManagement::Commands::RegisterClient::DecodableType & commandData,
-                          uint32_t & icdCounter);
+    chip::Protocols::InteractionModel::Status
+    RegisterClient(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
+                   const chip::app::Clusters::IcdManagement::Commands::RegisterClient::DecodableType & commandData,
+                   uint32_t & icdCounter);
 
-    Status UnregisterClient(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
-                            const chip::app::Clusters::IcdManagement::Commands::UnregisterClient::DecodableType & commandData);
+    chip::Protocols::InteractionModel::Status
+    UnregisterClient(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
+                     const chip::app::Clusters::IcdManagement::Commands::UnregisterClient::DecodableType & commandData);
 
-    Status StayActiveRequest(chip::FabricIndex fabricIndex);
+    chip::Protocols::InteractionModel::Status StayActiveRequest(chip::FabricIndex fabricIndex);
 
 private:
     /**
diff --git a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp
index c310701..7a3d47f 100644
--- a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp
+++ b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp
@@ -82,12 +82,12 @@
     return sInstance;
 }
 
-EmberAfStatus LaundryDryerControlsServer::SetSelectedDrynessLevel(EndpointId endpointId, DrynessLevelEnum newSelectedDrynessLevel)
+Status LaundryDryerControlsServer::SetSelectedDrynessLevel(EndpointId endpointId, DrynessLevelEnum newSelectedDrynessLevel)
 {
     DataModel::Nullable<DrynessLevelEnum> selectedDrynessLevel;
-    EmberAfStatus res = SelectedDrynessLevel::Get(endpointId, selectedDrynessLevel);
+    Status res = SelectedDrynessLevel::Get(endpointId, selectedDrynessLevel);
 
-    if ((res == EMBER_ZCL_STATUS_SUCCESS) && (selectedDrynessLevel != newSelectedDrynessLevel))
+    if ((res == Status::Success) && (selectedDrynessLevel != newSelectedDrynessLevel))
     {
         res = SelectedDrynessLevel::Set(endpointId, newSelectedDrynessLevel);
     }
@@ -95,8 +95,8 @@
     return res;
 }
 
-EmberAfStatus LaundryDryerControlsServer::GetSelectedDrynessLevel(EndpointId endpointId,
-                                                                  DataModel::Nullable<DrynessLevelEnum> & selectedDrynessLevel)
+Status LaundryDryerControlsServer::GetSelectedDrynessLevel(EndpointId endpointId,
+                                                           DataModel::Nullable<DrynessLevelEnum> & selectedDrynessLevel)
 {
     return SelectedDrynessLevel::Get(endpointId, selectedDrynessLevel);
 }
diff --git a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h
index 454c029..5a7123c 100644
--- a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h
+++ b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h
@@ -21,6 +21,7 @@
 #include <app-common/zap-generated/cluster-objects.h>
 #include <app/AttributeAccessInterface.h>
 #include <app/util/af.h>
+#include <protocols/interaction_model/StatusCode.h>
 
 namespace chip {
 namespace app {
@@ -46,8 +47,9 @@
     /**
      * API to set/get the SelectedDrynessLevel attribute
      */
-    EmberAfStatus SetSelectedDrynessLevel(EndpointId endpointId, DrynessLevelEnum newSelectedDrynessLevel);
-    EmberAfStatus GetSelectedDrynessLevel(EndpointId endpointId, DataModel::Nullable<DrynessLevelEnum> & selectedDrynessLevel);
+    Protocols::InteractionModel::Status SetSelectedDrynessLevel(EndpointId endpointId, DrynessLevelEnum newSelectedDrynessLevel);
+    Protocols::InteractionModel::Status GetSelectedDrynessLevel(EndpointId endpointId,
+                                                                DataModel::Nullable<DrynessLevelEnum> & selectedDrynessLevel);
 
 private:
     CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
diff --git a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp
index cc8d710..4e58236 100644
--- a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp
+++ b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp
@@ -81,11 +81,11 @@
     return sInstance;
 }
 
-EmberAfStatus LaundryWasherControlsServer::SetSpinSpeedCurrent(EndpointId endpointId, DataModel::Nullable<uint8_t> spinSpeedCurrent)
+Status LaundryWasherControlsServer::SetSpinSpeedCurrent(EndpointId endpointId, DataModel::Nullable<uint8_t> spinSpeedCurrent)
 {
     DataModel::Nullable<uint8_t> spinSpeedCurrentNow;
-    EmberAfStatus res = SpinSpeedCurrent::Get(endpointId, spinSpeedCurrentNow);
-    if ((res == EMBER_ZCL_STATUS_SUCCESS) && (spinSpeedCurrentNow != spinSpeedCurrent))
+    Status res = SpinSpeedCurrent::Get(endpointId, spinSpeedCurrentNow);
+    if ((res == Status::Success) && (spinSpeedCurrentNow != spinSpeedCurrent))
     {
         res = SpinSpeedCurrent::Set(endpointId, spinSpeedCurrent);
     }
@@ -93,18 +93,17 @@
     return res;
 }
 
-EmberAfStatus LaundryWasherControlsServer::GetSpinSpeedCurrent(EndpointId endpointId,
-                                                               DataModel::Nullable<uint8_t> & spinSpeedCurrent)
+Status LaundryWasherControlsServer::GetSpinSpeedCurrent(EndpointId endpointId, DataModel::Nullable<uint8_t> & spinSpeedCurrent)
 {
     return SpinSpeedCurrent::Get(endpointId, spinSpeedCurrent);
 }
 
-EmberAfStatus LaundryWasherControlsServer::SetNumberOfRinses(EndpointId endpointId, NumberOfRinsesEnum newNumberOfRinses)
+Status LaundryWasherControlsServer::SetNumberOfRinses(EndpointId endpointId, NumberOfRinsesEnum newNumberOfRinses)
 {
     NumberOfRinsesEnum numberOfRinses;
-    EmberAfStatus res = NumberOfRinses::Get(endpointId, &numberOfRinses);
+    Status res = NumberOfRinses::Get(endpointId, &numberOfRinses);
 
-    if ((res == EMBER_ZCL_STATUS_SUCCESS) && (numberOfRinses != newNumberOfRinses))
+    if ((res == Status::Success) && (numberOfRinses != newNumberOfRinses))
     {
         res = NumberOfRinses::Set(endpointId, newNumberOfRinses);
     }
@@ -112,7 +111,7 @@
     return res;
 }
 
-EmberAfStatus LaundryWasherControlsServer::GetNumberOfRinses(EndpointId endpointId, NumberOfRinsesEnum & numberOfRinses)
+Status LaundryWasherControlsServer::GetNumberOfRinses(EndpointId endpointId, NumberOfRinsesEnum & numberOfRinses)
 {
     return NumberOfRinses::Get(endpointId, &numberOfRinses);
 }
diff --git a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.h b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.h
index f010691..c19b6f8 100644
--- a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.h
+++ b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.h
@@ -22,6 +22,8 @@
 #include <app/AttributeAccessInterface.h>
 #include <app/util/af.h>
 
+#include <protocols/interaction_model/StatusCode.h>
+
 namespace chip {
 namespace app {
 namespace Clusters {
@@ -48,14 +50,14 @@
     /**
      * API to set/get the SpinSpeedCurrent attribute
      */
-    EmberAfStatus SetSpinSpeedCurrent(EndpointId endpointId, DataModel::Nullable<uint8_t> spinSpeedCurrent);
-    EmberAfStatus GetSpinSpeedCurrent(EndpointId endpointId, DataModel::Nullable<uint8_t> & spinSpeedCurrent);
+    Protocols::InteractionModel::Status SetSpinSpeedCurrent(EndpointId endpointId, DataModel::Nullable<uint8_t> spinSpeedCurrent);
+    Protocols::InteractionModel::Status GetSpinSpeedCurrent(EndpointId endpointId, DataModel::Nullable<uint8_t> & spinSpeedCurrent);
 
     /**
      * API to set/get the NumberOfRinses attribute
      */
-    EmberAfStatus SetNumberOfRinses(EndpointId endpointId, NumberOfRinsesEnum newNumberOfRinses);
-    EmberAfStatus GetNumberOfRinses(EndpointId endpointId, NumberOfRinsesEnum & numberOfRinses);
+    Protocols::InteractionModel::Status SetNumberOfRinses(EndpointId endpointId, NumberOfRinsesEnum newNumberOfRinses);
+    Protocols::InteractionModel::Status GetNumberOfRinses(EndpointId endpointId, NumberOfRinsesEnum & numberOfRinses);
 
 private:
     CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp
index b1edc34..b04d32f 100644
--- a/src/app/clusters/level-control/level-control.cpp
+++ b/src/app/clusters/level-control/level-control.cpp
@@ -161,12 +161,12 @@
         using AttributeValuePair = ScenesManagement::Structs::AttributeValuePair::Type;
 
         app::DataModel::Nullable<uint8_t> level;
-        VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == Attributes::CurrentLevel::Get(endpoint, level), CHIP_ERROR_READ_FAILED);
+        VerifyOrReturnError(Status::Success == Attributes::CurrentLevel::Get(endpoint, level), CHIP_ERROR_READ_FAILED);
 
         AttributeValuePair pairs[kLevelMaxScenableAttributes];
 
         uint8_t maxLevel;
-        VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == Attributes::MaxLevel::Get(endpoint, &maxLevel), CHIP_ERROR_READ_FAILED);
+        VerifyOrReturnError(Status::Success == Attributes::MaxLevel::Get(endpoint, &maxLevel), CHIP_ERROR_READ_FAILED);
 
         pairs[0].attributeID = Attributes::CurrentLevel::Id;
         if (!level.IsNull())
@@ -181,8 +181,7 @@
         if (LevelControlHasFeature(endpoint, LevelControl::Feature::kFrequency))
         {
             uint16_t frequency;
-            VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == Attributes::CurrentFrequency::Get(endpoint, &frequency),
-                                CHIP_ERROR_READ_FAILED);
+            VerifyOrReturnError(Status::Success == Attributes::CurrentFrequency::Get(endpoint, &frequency), CHIP_ERROR_READ_FAILED);
             pairs[attributeCount].attributeID    = Attributes::CurrentFrequency::Id;
             pairs[attributeCount].attributeValue = frequency;
             attributeCount++;
@@ -337,10 +336,10 @@
 static void reallyUpdateCoupledColorTemp(EndpointId endpoint)
 {
     LevelControl::Attributes::Options::TypeInfo::Type options;
-    EmberAfStatus status = Attributes::Options::Get(endpoint, &options);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    Status status = Attributes::Options::Get(endpoint, &options);
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "Unable to read Options attribute: 0x%X", status);
+        ChipLogProgress(Zcl, "Unable to read Options attribute: 0x%X", to_underlying(status));
         return;
     }
 
@@ -357,7 +356,7 @@
 void emberAfLevelControlClusterServerTickCallback(EndpointId endpoint)
 {
     EmberAfLevelControlState * state = getState(endpoint);
-    EmberAfStatus status;
+    Status status;
     app::DataModel::Nullable<uint8_t> currentLevel;
     const auto callbackStartTimestamp = System::SystemClock().GetMonotonicTimestamp();
 
@@ -371,9 +370,9 @@
     // Read the attribute; print error message and return if it can't be read
     status = LevelControl::Attributes::CurrentLevel::Get(endpoint, currentLevel);
 
-    if (status != EMBER_ZCL_STATUS_SUCCESS || currentLevel.IsNull())
+    if (status != Status::Success || currentLevel.IsNull())
     {
-        ChipLogProgress(Zcl, "ERR: reading current level %x", status);
+        ChipLogProgress(Zcl, "ERR: reading current level %x", to_underlying(status));
         state->callbackSchedule.runTime = System::Clock::Milliseconds32(0);
         writeRemainingTime(endpoint, 0);
         return;
@@ -404,9 +403,9 @@
     ChipLogDetail(Zcl, "(diff %c1)", state->increasing ? '+' : '-');
 
     status = Attributes::CurrentLevel::Set(endpoint, currentLevel);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "ERR: writing current level %x", status);
+        ChipLogProgress(Zcl, "ERR: writing current level %x", to_underlying(status));
         state->callbackSchedule.runTime = System::Clock::Milliseconds32(0);
         writeRemainingTime(endpoint, 0);
         return;
@@ -427,9 +426,9 @@
         {
             uint8_t storedLevel8u = (uint8_t) state->storedLevel;
             status                = Attributes::CurrentLevel::Set(endpoint, storedLevel8u);
-            if (status != EMBER_ZCL_STATUS_SUCCESS)
+            if (status != Status::Success)
             {
-                ChipLogProgress(Zcl, "ERR: writing current level %x", status);
+                ChipLogProgress(Zcl, "ERR: writing current level %x", to_underlying(status));
             }
             else
             {
@@ -469,10 +468,10 @@
         // This is done to ensure that the attribute, in tenths of a second, only
         // goes to zero when the remaining time in milliseconds is actually zero.
         uint16_t remainingTimeDs = static_cast<uint16_t>((remainingTimeMs + 99) / 100);
-        EmberAfStatus status     = LevelControl::Attributes::RemainingTime::Set(endpoint, remainingTimeDs);
-        if (status != EMBER_ZCL_STATUS_SUCCESS)
+        Status status            = LevelControl::Attributes::RemainingTime::Set(endpoint, remainingTimeDs);
+        if (status != Status::Success)
         {
-            ChipLogProgress(Zcl, "ERR: writing remaining time %x", status);
+            ChipLogProgress(Zcl, "ERR: writing remaining time %x", to_underlying(status));
         }
     }
 #endif // IGNORE_LEVEL_CONTROL_CLUSTER_LEVEL_CONTROL_REMAINING_TIME
@@ -515,19 +514,19 @@
         }
 
         LevelControl::Attributes::Options::TypeInfo::Type options;
-        EmberAfStatus status = Attributes::Options::Get(endpoint, &options);
-        if (status != EMBER_ZCL_STATUS_SUCCESS)
+        Status status = Attributes::Options::Get(endpoint, &options);
+        if (status != Status::Success)
         {
-            ChipLogProgress(Zcl, "Unable to read Options attribute: 0x%X", status);
+            ChipLogProgress(Zcl, "Unable to read Options attribute: 0x%X", to_underlying(status));
             // If we can't read the attribute, then we should just assume that it has its
             // default value.
         }
 
         bool on;
         status = OnOff::Attributes::OnOff::Get(endpoint, &on);
-        if (status != EMBER_ZCL_STATUS_SUCCESS)
+        if (status != Status::Success)
         {
-            ChipLogProgress(Zcl, "Unable to read OnOff attribute: 0x%X", status);
+            ChipLogProgress(Zcl, "Unable to read OnOff attribute: 0x%X", to_underlying(status));
             return true;
         }
         // The device is on - hence ExecuteIfOff does not matter
@@ -803,10 +802,10 @@
     // Cancel any currently active command before fiddling with the state.
     cancelEndpointTimerCallback(endpoint);
 
-    EmberAfStatus status = Attributes::CurrentLevel::Get(endpoint, currentLevel);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    Status status = Attributes::CurrentLevel::Get(endpoint, currentLevel);
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "ERR: reading current level %x", status);
+        ChipLogProgress(Zcl, "ERR: reading current level %x", to_underlying(status));
         return status;
     }
 
@@ -869,9 +868,9 @@
         {
             uint16_t onOffTransitionTime = 0;
             status                       = Attributes::OnOffTransitionTime::Get(endpoint, &onOffTransitionTime);
-            if (status != EMBER_ZCL_STATUS_SUCCESS)
+            if (status != Status::Success)
             {
-                ChipLogProgress(Zcl, "ERR: reading on/off transition time %x", status);
+                ChipLogProgress(Zcl, "ERR: reading on/off transition time %x", to_underlying(status));
                 return status;
             }
 
@@ -1243,7 +1242,7 @@
     app::DataModel::Nullable<uint16_t> transitionTime;
 
     uint16_t currentOnOffTransitionTime;
-    EmberAfStatus status;
+    Status status;
     bool useOnLevel = false;
 
     EmberAfLevelControlState * state = getState(endpoint);
@@ -1257,9 +1256,9 @@
 
     // "Temporarily store CurrentLevel."
     status = Attributes::CurrentLevel::Get(endpoint, temporaryCurrentLevelCache);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "ERR: reading current level %x", status);
+        ChipLogProgress(Zcl, "ERR: reading current level %x", to_underlying(status));
         return;
     }
 
@@ -1273,9 +1272,9 @@
     if (emberAfContainsAttribute(endpoint, LevelControl::Id, Attributes::OnLevel::Id))
     {
         status = Attributes::OnLevel::Get(endpoint, resolvedLevel);
-        if (status != EMBER_ZCL_STATUS_SUCCESS)
+        if (status != Status::Success)
         {
-            ChipLogProgress(Zcl, "ERR: reading on level %x", status);
+            ChipLogProgress(Zcl, "ERR: reading on level %x", to_underlying(status));
             return;
         }
 
@@ -1302,9 +1301,9 @@
     if (emberAfContainsAttribute(endpoint, LevelControl::Id, Attributes::OnOffTransitionTime::Id))
     {
         status = Attributes::OnOffTransitionTime::Get(endpoint, &currentOnOffTransitionTime);
-        if (status != EMBER_ZCL_STATUS_SUCCESS)
+        if (status != Status::Success)
         {
-            ChipLogProgress(Zcl, "ERR: reading current level %x", status);
+            ChipLogProgress(Zcl, "ERR: reading current level %x", to_underlying(status));
             return;
         }
         transitionTime.SetNonNull(currentOnOffTransitionTime);
@@ -1322,9 +1321,9 @@
         // If newValue is OnOff::Commands::On::Id...
         // "Set CurrentLevel to minimum level allowed for the device."
         status = Attributes::CurrentLevel::Set(endpoint, minimumLevelAllowedForTheDevice);
-        if (status != EMBER_ZCL_STATUS_SUCCESS)
+        if (status != Status::Success)
         {
-            ChipLogProgress(Zcl, "ERR: reading current level %x", status);
+            ChipLogProgress(Zcl, "ERR: reading current level %x", to_underlying(status));
             return;
         }
 
@@ -1386,8 +1385,8 @@
     }
 
     app::DataModel::Nullable<uint8_t> currentLevel;
-    EmberAfStatus status = Attributes::CurrentLevel::Get(endpoint, currentLevel);
-    if (status == EMBER_ZCL_STATUS_SUCCESS)
+    Status status = Attributes::CurrentLevel::Get(endpoint, currentLevel);
+    if (status == Status::Success)
     {
 #ifndef IGNORE_LEVEL_CONTROL_CLUSTER_START_UP_CURRENT_LEVEL
         // StartUp behavior relies StartUpCurrentLevel attributes being Non Volatile.
@@ -1408,7 +1407,7 @@
 
             app::DataModel::Nullable<uint8_t> startUpCurrentLevel;
             status = Attributes::StartUpCurrentLevel::Get(endpoint, startUpCurrentLevel);
-            if (status == EMBER_ZCL_STATUS_SUCCESS)
+            if (status == Status::Success)
             {
                 if (!startUpCurrentLevel.IsNull())
                 {
@@ -1480,7 +1479,7 @@
 {
     bool success;
     uint32_t featureMap;
-    success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == EMBER_ZCL_STATUS_SUCCESS);
+    success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == Status::Success);
 
     return success ? ((featureMap & to_underlying(feature)) != 0) : false;
 }
diff --git a/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp b/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp
index 144665b..8828332 100644
--- a/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp
+++ b/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp
@@ -30,6 +30,7 @@
 #include <lib/support/logging/CHIPLogging.h>
 #include <platform/DeviceInfoProvider.h>
 #include <platform/PlatformManager.h>
+#include <protocols/interaction_model/StatusCode.h>
 
 using namespace chip;
 using namespace chip::app;
@@ -37,6 +38,8 @@
 using namespace chip::app::Clusters::LocalizationConfiguration;
 using namespace chip::app::Clusters::LocalizationConfiguration::Attributes;
 
+using chip::Protocols::InteractionModel::Status;
+
 namespace {
 
 class LocalizationConfigurationAttrAccess : public AttributeAccessInterface
@@ -163,9 +166,10 @@
 {
     char outBuf[Attributes::ActiveLocale::TypeInfo::MaxLength()];
     MutableCharSpan activeLocale(outBuf);
-    EmberAfStatus status = ActiveLocale::Get(endpoint, activeLocale);
+    Status status = ActiveLocale::Get(endpoint, activeLocale);
 
-    VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Failed to read ActiveLocale with error: 0x%02x", status));
+    VerifyOrReturn(Status::Success == status,
+                   ChipLogError(Zcl, "Failed to read ActiveLocale with error: 0x%02x", to_underlying(status)));
 
     DeviceLayer::DeviceInfoProvider * provider = DeviceLayer::GetDeviceInfoProvider();
 
@@ -208,8 +212,8 @@
         {
             // If initial value is not one of the allowed values, write the valid value it.
             status = ActiveLocale::Set(endpoint, validLocale);
-            VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
-                           ChipLogError(Zcl, "Failed to write active locale with error: 0x%02x", status));
+            VerifyOrReturn(Status::Success == status,
+                           ChipLogError(Zcl, "Failed to write active locale with error: 0x%02x", to_underlying(status)));
         }
     }
 }
diff --git a/src/app/clusters/media-input-server/media-input-server.cpp b/src/app/clusters/media-input-server/media-input-server.cpp
index 02b114c..3fe1398 100644
--- a/src/app/clusters/media-input-server/media-input-server.cpp
+++ b/src/app/clusters/media-input-server/media-input-server.cpp
@@ -92,8 +92,8 @@
     bool hasFeature     = false;
     uint32_t featureMap = 0;
 
-    EmberAfStatus status = Attributes::FeatureMap::Get(endpoint, &featureMap);
-    if (EMBER_ZCL_STATUS_SUCCESS == status)
+    Status status = Attributes::FeatureMap::Get(endpoint, &featureMap);
+    if (Status::Success == status)
     {
         hasFeature = (featureMap & chip::to_underlying(feature));
     }
diff --git a/src/app/clusters/mode-select-server/mode-select-server.cpp b/src/app/clusters/mode-select-server/mode-select-server.cpp
index e2a2590..f8d9947 100644
--- a/src/app/clusters/mode-select-server/mode-select-server.cpp
+++ b/src/app/clusters/mode-select-server/mode-select-server.cpp
@@ -136,8 +136,8 @@
         // attribute are listed below.
 
         DataModel::Nullable<uint8_t> startUpMode;
-        EmberAfStatus status = Attributes::StartUpMode::Get(endpointId, startUpMode);
-        if (status == EMBER_ZCL_STATUS_SUCCESS && !startUpMode.IsNull())
+        Status status = Attributes::StartUpMode::Get(endpointId, startUpMode);
+        if (status == Status::Success && !startUpMode.IsNull())
         {
 #ifdef MATTER_DM_PLUGIN_ON_OFF
             // OnMode with Power Up
@@ -150,9 +150,9 @@
             {
                 Attributes::OnMode::TypeInfo::Type onMode;
                 bool onOffValueForStartUp = false;
-                if (Attributes::OnMode::Get(endpointId, onMode) == EMBER_ZCL_STATUS_SUCCESS &&
+                if (Attributes::OnMode::Get(endpointId, onMode) == Status::Success &&
                     !emberAfIsKnownVolatileAttribute(endpointId, OnOff::Id, OnOff::Attributes::StartUpOnOff::Id) &&
-                    OnOffServer::Instance().getOnOffValueForStartUp(endpointId, onOffValueForStartUp) == EMBER_ZCL_STATUS_SUCCESS)
+                    OnOffServer::Instance().getOnOffValueForStartUp(endpointId, onOffValueForStartUp) == Status::Success)
                 {
                     if (onOffValueForStartUp && !onMode.IsNull())
                     {
@@ -182,12 +182,12 @@
             uint8_t currentMode = 0;
             status              = Attributes::CurrentMode::Get(endpointId, &currentMode);
 
-            if ((status == EMBER_ZCL_STATUS_SUCCESS) && (startUpMode.Value() != currentMode))
+            if ((status == Status::Success) && (startUpMode.Value() != currentMode))
             {
                 status = Attributes::CurrentMode::Set(endpointId, startUpMode.Value());
-                if (status != EMBER_ZCL_STATUS_SUCCESS)
+                if (status != Status::Success)
                 {
-                    ChipLogError(Zcl, "ModeSelect: Error initializing CurrentMode, EmberAfStatus code 0x%02x", status);
+                    ChipLogError(Zcl, "ModeSelect: Error initializing CurrentMode, Status code 0x%02x", to_underlying(status));
                 }
                 else
                 {
diff --git a/src/app/clusters/on-off-server/on-off-server.cpp b/src/app/clusters/on-off-server/on-off-server.cpp
index e5c7ae4..ac1c4a0 100644
--- a/src/app/clusters/on-off-server/on-off-server.cpp
+++ b/src/app/clusters/on-off-server/on-off-server.cpp
@@ -23,6 +23,7 @@
 #include <app/util/af.h>
 #include <app/util/config.h>
 #include <app/util/util.h>
+#include <protocols/interaction_model/StatusCode.h>
 #include <tracing/macros.h>
 
 #ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT
@@ -151,10 +152,10 @@
 
         bool currentValue;
         // read current on/off value
-        EmberAfStatus status = Attributes::OnOff::Get(endpoint, &currentValue);
-        if (status != EMBER_ZCL_STATUS_SUCCESS)
+        Status status = Attributes::OnOff::Get(endpoint, &currentValue);
+        if (status != Status::Success)
         {
-            ChipLogError(Zcl, "ERR: reading on/off %x", status);
+            ChipLogError(Zcl, "ERR: reading on/off %x", to_underlying(status));
             return CHIP_ERROR_READ_FAILED;
         }
 
@@ -311,18 +312,18 @@
 {
     bool success;
     uint32_t featureMap;
-    success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == EMBER_ZCL_STATUS_SUCCESS);
+    success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == Status::Success);
 
     return success ? ((featureMap & to_underlying(feature)) != 0) : false;
 }
 
-EmberAfStatus OnOffServer::getOnOffValue(chip::EndpointId endpoint, bool * currentOnOffValue)
+Status OnOffServer::getOnOffValue(chip::EndpointId endpoint, bool * currentOnOffValue)
 {
     // read current on/off value
-    EmberAfStatus status = Attributes::OnOff::Get(endpoint, currentOnOffValue);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    Status status = Attributes::OnOff::Get(endpoint, currentOnOffValue);
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "ERR: reading on/off %x", status);
+        ChipLogProgress(Zcl, "ERR: reading on/off %x", to_underlying(status));
     }
 
     ChipLogProgress(Zcl, "On/Off ep%d value: %d", endpoint, *currentOnOffValue);
@@ -339,17 +340,17 @@
  * @param command   Ver.: always
  * @param initiatedByLevelChange   Ver.: always
  */
-EmberAfStatus OnOffServer::setOnOffValue(chip::EndpointId endpoint, chip::CommandId command, bool initiatedByLevelChange)
+Status OnOffServer::setOnOffValue(chip::EndpointId endpoint, chip::CommandId command, bool initiatedByLevelChange)
 {
     MATTER_TRACE_SCOPE("setOnOffValue", "OnOff");
-    EmberAfStatus status;
+    Status status;
     bool currentValue, newValue;
 
     // read current on/off value
     status = Attributes::OnOff::Get(endpoint, &currentValue);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "ERR: reading on/off %x", status);
+        ChipLogProgress(Zcl, "ERR: reading on/off %x", to_underlying(status));
         return status;
     }
 
@@ -357,7 +358,7 @@
     if ((!currentValue && command == Commands::Off::Id) || (currentValue && command == Commands::On::Id))
     {
         ChipLogProgress(Zcl, "Endpoint %x On/off already set to new value", endpoint);
-        return EMBER_ZCL_STATUS_SUCCESS;
+        return Status::Success;
     }
 
     // we either got a toggle, or an on when off, or an off when on,
@@ -396,9 +397,9 @@
 
         // write the new on/off value
         status = Attributes::OnOff::Set(endpoint, newValue);
-        if (status != EMBER_ZCL_STATUS_SUCCESS)
+        if (status != Status::Success)
         {
-            ChipLogProgress(Zcl, "ERR: writing on/off %x", status);
+            ChipLogProgress(Zcl, "ERR: writing on/off %x", to_underlying(status));
             return status;
         }
 
@@ -416,7 +417,7 @@
             emberAfContainsAttribute(endpoint, ModeSelect::Id, ModeSelect::Attributes::OnMode::Id))
         {
             ModeSelect::Attributes::OnMode::TypeInfo::Type onMode;
-            if (ModeSelect::Attributes::OnMode::Get(endpoint, onMode) == EMBER_ZCL_STATUS_SUCCESS && !onMode.IsNull())
+            if (ModeSelect::Attributes::OnMode::Get(endpoint, onMode) == Status::Success && !onMode.IsNull())
             {
                 ChipLogProgress(Zcl, "Changing Current Mode to %x", onMode.Value());
                 status = ModeSelect::Attributes::CurrentMode::Set(endpoint, onMode.Value());
@@ -442,9 +443,9 @@
         {
             // write the new on/off value
             status = Attributes::OnOff::Set(endpoint, newValue);
-            if (status != EMBER_ZCL_STATUS_SUCCESS)
+            if (status != Status::Success)
             {
-                ChipLogProgress(Zcl, "ERR: writing on/off %x", status);
+                ChipLogProgress(Zcl, "ERR: writing on/off %x", to_underlying(status));
                 return status;
             }
 
@@ -466,7 +467,7 @@
 
     // The returned status is based solely on the On/Off cluster.  Errors in the
     // Level Control and/or Scenes cluster are ignored.
-    return EMBER_ZCL_STATUS_SUCCESS;
+    return Status::Success;
 }
 
 void OnOffServer::initOnOffServer(chip::EndpointId endpoint)
@@ -494,8 +495,8 @@
         // null       Set the OnOff attribute to its previous value.
 
         bool onOffValueForStartUp = false;
-        EmberAfStatus status      = getOnOffValueForStartUp(endpoint, onOffValueForStartUp);
-        if (status == EMBER_ZCL_STATUS_SUCCESS)
+        Status status             = getOnOffValueForStartUp(endpoint, onOffValueForStartUp);
+        if (status == Status::Success)
         {
             status = setOnOffValue(endpoint, onOffValueForStartUp, true);
         }
@@ -512,7 +513,7 @@
             emberAfContainsAttribute(endpoint, ModeSelect::Id, ModeSelect::Attributes::OnMode::Id))
         {
             ModeSelect::Attributes::OnMode::TypeInfo::Type onMode;
-            if (ModeSelect::Attributes::OnMode::Get(endpoint, onMode) == EMBER_ZCL_STATUS_SUCCESS && !onMode.IsNull())
+            if (ModeSelect::Attributes::OnMode::Get(endpoint, onMode) == Status::Success && !onMode.IsNull())
             {
                 ChipLogProgress(Zcl, "Changing Current Mode to %x", onMode.Value());
                 status = ModeSelect::Attributes::CurrentMode::Set(endpoint, onMode.Value());
@@ -532,16 +533,16 @@
  * @param endpoint   Ver.: always
  * @param onOffValueForStartUp Ver.: always
  */
-EmberAfStatus OnOffServer::getOnOffValueForStartUp(chip::EndpointId endpoint, bool & onOffValueForStartUp)
+Status OnOffServer::getOnOffValueForStartUp(chip::EndpointId endpoint, bool & onOffValueForStartUp)
 {
     app::DataModel::Nullable<OnOff::StartUpOnOffEnum> startUpOnOff;
-    EmberAfStatus status = Attributes::StartUpOnOff::Get(endpoint, startUpOnOff);
-    if (status == EMBER_ZCL_STATUS_SUCCESS)
+    Status status = Attributes::StartUpOnOff::Get(endpoint, startUpOnOff);
+    if (status == Status::Success)
     {
         // Initialise updated value to 0
         bool updatedOnOff = false;
         status            = Attributes::OnOff::Get(endpoint, &updatedOnOff);
-        if (status == EMBER_ZCL_STATUS_SUCCESS)
+        if (status == Status::Success)
         {
             if (!startUpOnOff.IsNull())
             {
@@ -570,7 +571,7 @@
 bool OnOffServer::offCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath)
 {
     MATTER_TRACE_SCOPE("OffCommand", "OnOff");
-    EmberAfStatus status = setOnOffValue(commandPath.mEndpointId, Commands::Off::Id, false);
+    Status status = setOnOffValue(commandPath.mEndpointId, Commands::Off::Id, false);
 
     commandObj->AddStatus(commandPath, status);
     return true;
@@ -579,7 +580,7 @@
 bool OnOffServer::onCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath)
 {
     MATTER_TRACE_SCOPE("OnCommand", "OnOff");
-    EmberAfStatus status = setOnOffValue(commandPath.mEndpointId, Commands::On::Id, false);
+    Status status = setOnOffValue(commandPath.mEndpointId, Commands::On::Id, false);
 
     commandObj->AddStatus(commandPath, status);
     return true;
@@ -588,7 +589,7 @@
 bool OnOffServer::toggleCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath)
 {
     MATTER_TRACE_SCOPE("ToggleCommand", "OnOff");
-    EmberAfStatus status = setOnOffValue(commandPath.mEndpointId, Commands::Toggle::Id, false);
+    Status status = setOnOffValue(commandPath.mEndpointId, Commands::Toggle::Id, false);
 
     commandObj->AddStatus(commandPath, status);
     return true;
diff --git a/src/app/clusters/on-off-server/on-off-server.h b/src/app/clusters/on-off-server/on-off-server.h
index 26e62fb..2cb5b62 100644
--- a/src/app/clusters/on-off-server/on-off-server.h
+++ b/src/app/clusters/on-off-server/on-off-server.h
@@ -24,6 +24,7 @@
 #include <app/util/af-types.h>
 #include <app/util/basic-types.h>
 #include <platform/CHIPDeviceConfig.h>
+#include <protocols/interaction_model/StatusCode.h>
 
 /**********************************************************
  * Defines and Macros
@@ -61,9 +62,10 @@
     bool OnWithTimedOffCommand(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
                                const chip::app::Clusters::OnOff::Commands::OnWithTimedOff::DecodableType & commandData);
     void updateOnOffTimeCommand(chip::EndpointId endpoint);
-    EmberAfStatus getOnOffValue(chip::EndpointId endpoint, bool * currentOnOffValue);
-    EmberAfStatus setOnOffValue(chip::EndpointId endpoint, chip::CommandId command, bool initiatedByLevelChange);
-    EmberAfStatus getOnOffValueForStartUp(chip::EndpointId endpoint, bool & onOffValueForStartUp);
+    chip::Protocols::InteractionModel::Status getOnOffValue(chip::EndpointId endpoint, bool * currentOnOffValue);
+    chip::Protocols::InteractionModel::Status setOnOffValue(chip::EndpointId endpoint, chip::CommandId command,
+                                                            bool initiatedByLevelChange);
+    chip::Protocols::InteractionModel::Status getOnOffValueForStartUp(chip::EndpointId endpoint, bool & onOffValueForStartUp);
 
     bool HasFeature(chip::EndpointId endpoint, Feature feature);
     inline bool SupportsLightingApplications(chip::EndpointId endpointId) { return HasFeature(endpointId, Feature::kLighting); }
diff --git a/src/app/clusters/ota-requestor/DefaultOTARequestor.h b/src/app/clusters/ota-requestor/DefaultOTARequestor.h
index e0e45c2..025dc66 100644
--- a/src/app/clusters/ota-requestor/DefaultOTARequestor.h
+++ b/src/app/clusters/ota-requestor/DefaultOTARequestor.h
@@ -136,7 +136,7 @@
 
             chip::Messaging::SendFlags sendFlags;
             if (!event.msgTypeData.HasMessageType(chip::bdx::MessageType::BlockAckEOF) &&
-                !event.msgTypeData.HasMessageType(chip::Protocols::SecureChannel::MsgType::StatusReport))
+                !event.msgTypeData.HasMessageType(Protocols::SecureChannel::MsgType::StatusReport))
             {
                 sendFlags.Set(chip::Messaging::SendMessageFlags::kExpectResponse);
             }
@@ -162,7 +162,7 @@
             mDownloader->OnMessageReceived(payloadHeader, std::move(payload));
 
             // For a receiver using BDX Protocol, all received messages will require a response except for a StatusReport
-            if (!payloadHeader.HasMessageType(chip::Protocols::SecureChannel::MsgType::StatusReport))
+            if (!payloadHeader.HasMessageType(Protocols::SecureChannel::MsgType::StatusReport))
             {
                 ec->WillSendMessage();
             }
diff --git a/src/app/clusters/ota-requestor/ota-requestor-server.cpp b/src/app/clusters/ota-requestor/ota-requestor-server.cpp
index b5611b7..8f5d132 100644
--- a/src/app/clusters/ota-requestor/ota-requestor-server.cpp
+++ b/src/app/clusters/ota-requestor/ota-requestor-server.cpp
@@ -26,6 +26,7 @@
 #include <app/clusters/ota-requestor/OTARequestorInterface.h>
 #include <app/clusters/ota-requestor/ota-requestor-server.h>
 #include <app/util/attribute-storage.h>
+#include <protocols/interaction_model/StatusCode.h>
 
 using namespace chip;
 using namespace chip::app;
@@ -147,54 +148,54 @@
 
 // -----------------------------------------------------------------------------
 // Global functions
-EmberAfStatus OtaRequestorServerSetUpdateState(OTAUpdateStateEnum value)
+Status OtaRequestorServerSetUpdateState(OTAUpdateStateEnum value)
 {
-    EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+    Status status = Status::Success;
 
     // Find all endpoints that have OtaSoftwareUpdateRequestor implemented
     for (auto endpoint : EnabledEndpointsWithServerCluster(OtaSoftwareUpdateRequestor::Id))
     {
         OTAUpdateStateEnum currentValue;
         status = Attributes::UpdateState::Get(endpoint, &currentValue);
-        VerifyOrDie(EMBER_ZCL_STATUS_SUCCESS == status);
+        VerifyOrDie(Status::Success == status);
 
         if (currentValue != value)
         {
             status = Attributes::UpdateState::Set(endpoint, value);
-            VerifyOrDie(EMBER_ZCL_STATUS_SUCCESS == status);
+            VerifyOrDie(Status::Success == status);
         }
     }
 
     return status;
 }
 
-EmberAfStatus OtaRequestorServerGetUpdateState(chip::EndpointId endpointId, OTAUpdateStateEnum & value)
+Status OtaRequestorServerGetUpdateState(chip::EndpointId endpointId, OTAUpdateStateEnum & value)
 {
     return Attributes::UpdateState::Get(endpointId, &value);
 }
 
-EmberAfStatus OtaRequestorServerSetUpdateStateProgress(app::DataModel::Nullable<uint8_t> value)
+Status OtaRequestorServerSetUpdateStateProgress(app::DataModel::Nullable<uint8_t> value)
 {
-    EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+    Status status = Status::Success;
 
     // Find all endpoints that have OtaSoftwareUpdateRequestor implemented
     for (auto endpoint : EnabledEndpointsWithServerCluster(OtaSoftwareUpdateRequestor::Id))
     {
         app::DataModel::Nullable<uint8_t> currentValue;
         status = Attributes::UpdateStateProgress::Get(endpoint, currentValue);
-        VerifyOrDie(EMBER_ZCL_STATUS_SUCCESS == status);
+        VerifyOrDie(Status::Success == status);
 
         if (currentValue != value)
         {
             status = Attributes::UpdateStateProgress::Set(endpoint, value);
-            VerifyOrDie(EMBER_ZCL_STATUS_SUCCESS == status);
+            VerifyOrDie(Status::Success == status);
         }
     }
 
     return status;
 }
 
-EmberAfStatus OtaRequestorServerGetUpdateStateProgress(chip::EndpointId endpointId, DataModel::Nullable<uint8_t> & value)
+Status OtaRequestorServerGetUpdateStateProgress(chip::EndpointId endpointId, DataModel::Nullable<uint8_t> & value)
 {
     return Attributes::UpdateStateProgress::Get(endpointId, value);
 }
diff --git a/src/app/clusters/ota-requestor/ota-requestor-server.h b/src/app/clusters/ota-requestor/ota-requestor-server.h
index 323cb7b..b8874aa 100644
--- a/src/app/clusters/ota-requestor/ota-requestor-server.h
+++ b/src/app/clusters/ota-requestor/ota-requestor-server.h
@@ -19,13 +19,16 @@
 #pragma once
 
 #include <app-common/zap-generated/attributes/Accessors.h>
+#include <protocols/interaction_model/StatusCode.h>
 
-EmberAfStatus OtaRequestorServerSetUpdateState(chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum value);
-EmberAfStatus OtaRequestorServerGetUpdateState(chip::EndpointId endpointId,
-                                               chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum & value);
-EmberAfStatus OtaRequestorServerSetUpdateStateProgress(chip::app::DataModel::Nullable<uint8_t> value);
-EmberAfStatus OtaRequestorServerGetUpdateStateProgress(chip::EndpointId endpointId,
-                                                       chip::app::DataModel::Nullable<uint8_t> & value);
+chip::Protocols::InteractionModel::Status
+OtaRequestorServerSetUpdateState(chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum value);
+chip::Protocols::InteractionModel::Status
+OtaRequestorServerGetUpdateState(chip::EndpointId endpointId,
+                                 chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum & value);
+chip::Protocols::InteractionModel::Status OtaRequestorServerSetUpdateStateProgress(chip::app::DataModel::Nullable<uint8_t> value);
+chip::Protocols::InteractionModel::Status OtaRequestorServerGetUpdateStateProgress(chip::EndpointId endpointId,
+                                                                                   chip::app::DataModel::Nullable<uint8_t> & value);
 
 void OtaRequestorServerOnStateTransition(chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum previousState,
                                          chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum newState,
diff --git a/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.cpp b/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.cpp
index a7fd3ed..620e113 100644
--- a/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.cpp
+++ b/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.cpp
@@ -40,12 +40,12 @@
     return instance;
 }
 
-EmberAfStatus RefrigeratorAlarmServer::GetMaskValue(EndpointId endpoint, BitMask<AlarmMap> * mask)
+Status RefrigeratorAlarmServer::GetMaskValue(EndpointId endpoint, BitMask<AlarmMap> * mask)
 {
-    EmberAfStatus status = Attributes::Mask::Get(endpoint, mask);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    Status status = Attributes::Mask::Get(endpoint, mask);
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: reading  mask, err:0x%x", status);
+        ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: reading  mask, err:0x%x", to_underlying(status));
     }
     else
     {
@@ -55,12 +55,12 @@
     return status;
 }
 
-EmberAfStatus RefrigeratorAlarmServer::GetStateValue(EndpointId endpoint, BitMask<AlarmMap> * state)
+Status RefrigeratorAlarmServer::GetStateValue(EndpointId endpoint, BitMask<AlarmMap> * state)
 {
-    EmberAfStatus status = Attributes::State::Get(endpoint, state);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    Status status = Attributes::State::Get(endpoint, state);
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: reading state, err:0x%x", status);
+        ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: reading state, err:0x%x", to_underlying(status));
     }
     else
     {
@@ -70,12 +70,12 @@
     return status;
 }
 
-EmberAfStatus RefrigeratorAlarmServer::GetSupportedValue(EndpointId endpoint, BitMask<AlarmMap> * supported)
+Status RefrigeratorAlarmServer::GetSupportedValue(EndpointId endpoint, BitMask<AlarmMap> * supported)
 {
-    EmberAfStatus status = Attributes::Supported::Get(endpoint, supported);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    Status status = Attributes::Supported::Get(endpoint, supported);
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: reading  supported, err:0x%x", status);
+        ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: reading  supported, err:0x%x", to_underlying(status));
     }
     else
     {
@@ -85,13 +85,13 @@
     return status;
 }
 
-EmberAfStatus RefrigeratorAlarmServer::SetMaskValue(EndpointId endpoint, const BitMask<AlarmMap> mask)
+Status RefrigeratorAlarmServer::SetMaskValue(EndpointId endpoint, const BitMask<AlarmMap> mask)
 {
-    EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
-    status               = Attributes::Mask::Set(endpoint, mask);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    Status status = Status::Success;
+    status        = Attributes::Mask::Set(endpoint, mask);
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: writing  mask, err:0x%x", status);
+        ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: writing  mask, err:0x%x", to_underlying(status));
         return status;
     }
 
@@ -100,7 +100,7 @@
     // Whenever there is change in Mask, State should change accordingly.
     BitMask<AlarmMap> state;
     status = GetStateValue(endpoint, &state);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != Status::Success)
     {
         return status;
     }
@@ -113,22 +113,22 @@
     return status;
 }
 
-EmberAfStatus RefrigeratorAlarmServer::SetStateValue(EndpointId endpoint, BitMask<AlarmMap> newState)
+Status RefrigeratorAlarmServer::SetStateValue(EndpointId endpoint, BitMask<AlarmMap> newState)
 {
-    EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+    Status status = Status::Success;
     BitMask<AlarmMap> currentState;
 
     status = Attributes::State::Get(endpoint, &currentState);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: reading  state, err:0x%x", status);
+        ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: reading  state, err:0x%x", to_underlying(status));
         return status;
     }
 
     status = Attributes::State::Set(endpoint, newState);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: writing  state, err:0x%x", status);
+        ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: writing  state, err:0x%x", to_underlying(status));
         return status;
     }
 
@@ -143,7 +143,7 @@
     BitMask<AlarmMap> mask;
 
     status = GetMaskValue(endpoint, &mask);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != Status::Success)
     {
         return status;
     }
@@ -152,13 +152,13 @@
     return status;
 }
 
-EmberAfStatus RefrigeratorAlarmServer::SetSupportedValue(EndpointId endpoint, const BitMask<AlarmMap> supported)
+Status RefrigeratorAlarmServer::SetSupportedValue(EndpointId endpoint, const BitMask<AlarmMap> supported)
 {
-    EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
-    status               = Attributes::Supported::Set(endpoint, supported);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    Status status = Status::Success;
+    status        = Attributes::Supported::Set(endpoint, supported);
+    if (status != Status::Success)
     {
-        ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: writing supported, err:0x%x", status);
+        ChipLogProgress(Zcl, "Refrigerator Alarm: ERR: writing supported, err:0x%x", to_underlying(status));
         return status;
     }
 
@@ -167,7 +167,7 @@
     // Whenever there is change in Supported attribute, Mask, State should change accordingly.
     BitMask<AlarmMap> mask;
     status = GetMaskValue(endpoint, &mask);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != Status::Success)
     {
         return status;
     }
diff --git a/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.h b/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.h
index 1ed6023..65df99d 100644
--- a/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.h
+++ b/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.h
@@ -23,28 +23,31 @@
 #include <app/util/af-types.h>
 #include <app/util/basic-types.h>
 #include <platform/CHIPDeviceConfig.h>
+#include <protocols/interaction_model/StatusCode.h>
 
 class RefrigeratorAlarmServer
 {
 public:
     static RefrigeratorAlarmServer & Instance();
 
-    EmberAfStatus GetMaskValue(chip::EndpointId endpoint, chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> * mask);
-    EmberAfStatus GetStateValue(chip::EndpointId endpoint, chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> * state);
-    EmberAfStatus GetSupportedValue(chip::EndpointId endpoint,
-                                    chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> * suppported);
+    chip::Protocols::InteractionModel::Status GetMaskValue(chip::EndpointId endpoint,
+                                                           chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> * mask);
+    chip::Protocols::InteractionModel::Status
+    GetStateValue(chip::EndpointId endpoint, chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> * state);
+    chip::Protocols::InteractionModel::Status
+    GetSupportedValue(chip::EndpointId endpoint, chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> * suppported);
 
     // A change in mask value will result in a corresponding change in state.
-    EmberAfStatus SetMaskValue(chip::EndpointId endpoint,
-                               const chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> mask);
+    chip::Protocols::InteractionModel::Status
+    SetMaskValue(chip::EndpointId endpoint, const chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> mask);
 
     // When State changes we are generating Notify event.
-    EmberAfStatus SetStateValue(chip::EndpointId endpoint,
-                                chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> newState);
+    chip::Protocols::InteractionModel::Status
+    SetStateValue(chip::EndpointId endpoint, chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> newState);
 
     // A change in supported value will result in a corresponding change in mask and state.
-    EmberAfStatus SetSupportedValue(chip::EndpointId endpoint,
-                                    const chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> supported);
+    chip::Protocols::InteractionModel::Status
+    SetSupportedValue(chip::EndpointId endpoint, const chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmMap> supported);
 
 private:
     static RefrigeratorAlarmServer instance;
diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h
index da17d36..8cdc74f 100644
--- a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h
+++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h
@@ -91,10 +91,10 @@
     bool HasFeature(ResourceMonitoring::Feature aFeature) const;
 
     // Attribute setters
-    chip::Protocols::InteractionModel::Status UpdateCondition(uint8_t aNewCondition);
-    chip::Protocols::InteractionModel::Status UpdateChangeIndication(ChangeIndicationEnum aNewChangeIndication);
-    chip::Protocols::InteractionModel::Status UpdateInPlaceIndicator(bool aNewInPlaceIndicator);
-    chip::Protocols::InteractionModel::Status UpdateLastChangedTime(DataModel::Nullable<uint32_t> aNewLastChangedTime);
+    Protocols::InteractionModel::Status UpdateCondition(uint8_t aNewCondition);
+    Protocols::InteractionModel::Status UpdateChangeIndication(ChangeIndicationEnum aNewChangeIndication);
+    Protocols::InteractionModel::Status UpdateInPlaceIndicator(bool aNewInPlaceIndicator);
+    Protocols::InteractionModel::Status UpdateLastChangedTime(DataModel::Nullable<uint32_t> aNewLastChangedTime);
 
     void SetReplacementProductListManagerInstance(ReplacementProductListManager * instance);
 
@@ -196,7 +196,7 @@
      * @return Status::Success      If the command was handled successfully.
      * @return All Other            PreResetCondition() or PostResetCondition() failed, these are application specific.
      */
-    virtual chip::Protocols::InteractionModel::Status OnResetCondition();
+    virtual Protocols::InteractionModel::Status OnResetCondition();
 
     /**
      * This method may be overwritten by the SDK User, if the SDK User wants to do something before the reset.
@@ -206,7 +206,7 @@
      * @return Status::Success      All good, the reset may proceed.
      * @return All Other            The reset should not proceed. The reset command will fail.
      */
-    virtual chip::Protocols::InteractionModel::Status PreResetCondition();
+    virtual Protocols::InteractionModel::Status PreResetCondition();
 
     /**
      * This method may be overwritten by the SDK User, if the SDK User wants to do something after the reset.
@@ -217,7 +217,7 @@
      * @return All Other            Something went wrong. The attributes will already be updated. But the reset command will report
      *                              the failure.
      */
-    virtual chip::Protocols::InteractionModel::Status PostResetCondition();
+    virtual Protocols::InteractionModel::Status PostResetCondition();
 };
 
 } // namespace ResourceMonitoring
diff --git a/src/app/clusters/scenes-server/scenes-server.cpp b/src/app/clusters/scenes-server/scenes-server.cpp
index 330d7eb..a62427d 100644
--- a/src/app/clusters/scenes-server/scenes-server.cpp
+++ b/src/app/clusters/scenes-server/scenes-server.cpp
@@ -41,6 +41,7 @@
 using SceneTable        = chip::scenes::SceneTable<chip::scenes::ExtensionFieldSetsImpl>;
 using AuthMode          = chip::Access::AuthMode;
 using ScenesServer      = chip::app::Clusters::ScenesManagement::ScenesServer;
+using chip::Protocols::InteractionModel::Status;
 
 namespace chip {
 namespace app {
@@ -74,14 +75,14 @@
     return err;
 }
 
-/// @brief Generate and add a response to a command handler context depending on an EmberAfStatus
+/// @brief Generate and add a response to a command handler context depending on an InteractionModel::Status
 /// @tparam ResponseType Type of response, depends on the command
 /// @param ctx Command Handler context where to add reponse
 /// @param resp Response to add in ctx
 /// @param status Status to verify
-/// @return EmberAfStatus -> CHIP_ERROR
+/// @return InteractionModel::Status -> CHIP_ERROR
 template <typename ResponseType>
-CHIP_ERROR AddResponseOnError(CommandHandlerInterface::HandlerContext & ctx, ResponseType & resp, EmberAfStatus status)
+CHIP_ERROR AddResponseOnError(CommandHandlerInterface::HandlerContext & ctx, ResponseType & resp, Status status)
 {
     return AddResponseOnError(ctx, resp, StatusIB(status).ToChipError());
 }
@@ -90,7 +91,7 @@
 CHIP_ERROR UpdateLastConfiguredBy(HandlerContext & ctx, ResponseType resp)
 {
     Access::SubjectDescriptor descriptor = ctx.mCommandHandler.GetSubjectDescriptor();
-    EmberAfStatus status                 = EMBER_ZCL_STATUS_SUCCESS;
+    Status status                        = Status::Success;
 
     if (AuthMode::kCase == descriptor.authMode)
     {
@@ -102,7 +103,7 @@
     }
 
     // LastConfiguredBy is optional, so we don't want to fail the command if it fails to update
-    VerifyOrReturnValue(!(EMBER_ZCL_STATUS_SUCCESS == status || EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE == status), CHIP_NO_ERROR);
+    VerifyOrReturnValue(!(Status::Success == status || Status::UnsupportedAttribute == status), CHIP_NO_ERROR);
     return AddResponseOnError(ctx, resp, status);
 }
 
@@ -1108,8 +1109,8 @@
 
 void emberAfScenesManagementClusterServerInitCallback(EndpointId endpoint)
 {
-    EmberAfStatus status = Attributes::LastConfiguredBy::SetNull(endpoint);
-    if (EMBER_ZCL_STATUS_SUCCESS != status)
+    Status status = Attributes::LastConfiguredBy::SetNull(endpoint);
+    if (Status::Success != status)
     {
         ChipLogDetail(Zcl, "ERR: setting LastConfiguredBy on Endpoint %hu Status: %x", endpoint, status);
     }
diff --git a/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.cpp b/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.cpp
index 2d5ae5f..5b3da15 100644
--- a/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.cpp
+++ b/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.cpp
@@ -467,11 +467,11 @@
 
 template <typename T>
 bool SmokeCoAlarmServer::GetAttribute(EndpointId endpointId, AttributeId attributeId,
-                                      EmberAfStatus (*getFn)(EndpointId endpointId, T * value), T & value) const
+                                      Status (*getFn)(EndpointId endpointId, T * value), T & value) const
 {
-    EmberAfStatus status   = getFn(endpointId, &value);
-    bool success           = (EMBER_ZCL_STATUS_SUCCESS == status);
-    bool unsupportedStatus = (EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE == status);
+    Status status          = getFn(endpointId, &value);
+    bool success           = (Status::Success == status);
+    bool unsupportedStatus = (Status::UnsupportedAttribute == status);
 
     if (unsupportedStatus)
     {
@@ -487,10 +487,10 @@
 
 template <typename T>
 bool SmokeCoAlarmServer::SetAttribute(EndpointId endpointId, AttributeId attributeId,
-                                      EmberAfStatus (*setFn)(EndpointId endpointId, T value), T value)
+                                      Status (*setFn)(EndpointId endpointId, T value), T value)
 {
-    EmberAfStatus status = setFn(endpointId, value);
-    bool success         = (EMBER_ZCL_STATUS_SUCCESS == status);
+    Status status = setFn(endpointId, value);
+    bool success  = (Status::Success == status);
 
     if (!success)
     {
diff --git a/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.h b/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.h
index 37bd1f6..42efc49 100644
--- a/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.h
+++ b/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.h
@@ -26,6 +26,7 @@
 #include <app-common/zap-generated/cluster-objects.h>
 #include <app/CommandHandler.h>
 #include <app/util/af.h>
+#include <protocols/interaction_model/StatusCode.h>
 
 /**
  * @brief Smoke CO Alarm Server Plugin class
@@ -139,7 +140,7 @@
      */
     template <typename T>
     bool GetAttribute(chip::EndpointId endpointId, chip::AttributeId attributeId,
-                      EmberAfStatus (*getFn)(chip::EndpointId endpointId, T * value), T & value) const;
+                      chip::Protocols::InteractionModel::Status (*getFn)(chip::EndpointId endpointId, T * value), T & value) const;
 
     /**
      * @brief Set generic attribute value
@@ -154,7 +155,7 @@
      */
     template <typename T>
     bool SetAttribute(chip::EndpointId endpointId, chip::AttributeId attributeId,
-                      EmberAfStatus (*setFn)(chip::EndpointId endpointId, T value), T value);
+                      chip::Protocols::InteractionModel::Status (*setFn)(chip::EndpointId endpointId, T value), T value);
 
     friend bool emberAfSmokeCoAlarmClusterSelfTestRequestCallback(
         chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
diff --git a/src/app/clusters/temperature-control-server/temperature-control-server.cpp b/src/app/clusters/temperature-control-server/temperature-control-server.cpp
index 6217288..9194c16 100644
--- a/src/app/clusters/temperature-control-server/temperature-control-server.cpp
+++ b/src/app/clusters/temperature-control-server/temperature-control-server.cpp
@@ -99,7 +99,7 @@
 {
     bool success;
     uint32_t featureMap;
-    success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == EMBER_ZCL_STATUS_SUCCESS);
+    success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == Status::Success);
 
     return success ? ((featureMap & to_underlying(feature)) != 0) : false;
 }
@@ -116,7 +116,6 @@
     auto & targetTemperatureLevel = commandData.targetTemperatureLevel;
     EndpointId endpoint           = commandPath.mEndpointId;
     Status status                 = Status::Success;
-    EmberAfStatus emberAfStatus   = EMBER_ZCL_STATUS_SUCCESS;
 
     if (TemperatureControlHasFeature(endpoint, Feature::kTemperatureNumber) &&
         TemperatureControlHasFeature(endpoint, Feature::kTemperatureLevel))
@@ -130,17 +129,15 @@
         {
             int16_t minTemperature = 0;
             int16_t maxTemperature = 0;
-            emberAfStatus          = MinTemperature::Get(endpoint, &minTemperature);
-            if (emberAfStatus != EMBER_ZCL_STATUS_SUCCESS)
+            status                 = MinTemperature::Get(endpoint, &minTemperature);
+            if (status != Status::Success)
             {
-                status = emberAfStatus;
                 goto exit;
             }
 
-            emberAfStatus = MaxTemperature::Get(endpoint, &maxTemperature);
-            if (emberAfStatus != EMBER_ZCL_STATUS_SUCCESS)
+            status = MaxTemperature::Get(endpoint, &maxTemperature);
+            if (status != Status::Success)
             {
-                status = emberAfStatus;
                 goto exit;
             }
 
@@ -151,11 +148,10 @@
             }
             if (TemperatureControlHasFeature(endpoint, TemperatureControl::Feature::kTemperatureStep))
             {
-                int16_t step  = 0;
-                emberAfStatus = Step::Get(endpoint, &step);
-                if (emberAfStatus != EMBER_ZCL_STATUS_SUCCESS)
+                int16_t step = 0;
+                status       = Step::Get(endpoint, &step);
+                if (status != Status::Success)
                 {
-                    status = emberAfStatus;
                     goto exit;
                 }
 
@@ -165,8 +161,8 @@
                     goto exit;
                 }
             }
-            emberAfStatus = TemperatureSetpoint::Set(endpoint, targetTemperature.Value());
-            if (emberAfStatus != EMBER_ZCL_STATUS_SUCCESS)
+            status = TemperatureSetpoint::Set(endpoint, targetTemperature.Value());
+            if (status != Status::Success)
             {
                 /**
                  * If the server is unable to execute the command at the time the command is received
@@ -199,8 +195,8 @@
 
             if (targetTemperatureLevel.Value() < size)
             {
-                emberAfStatus = SelectedTemperatureLevel::Set(endpoint, targetTemperatureLevel.Value());
-                if (emberAfStatus != EMBER_ZCL_STATUS_SUCCESS)
+                status = SelectedTemperatureLevel::Set(endpoint, targetTemperatureLevel.Value());
+                if (status != Status::Success)
                 {
                     /**
                      * If the server is unable to execute the command at the time the command is received
diff --git a/src/app/clusters/thermostat-server/thermostat-server.cpp b/src/app/clusters/thermostat-server/thermostat-server.cpp
index 780d244..c0e4359 100644
--- a/src/app/clusters/thermostat-server/thermostat-server.cpp
+++ b/src/app/clusters/thermostat-server/thermostat-server.cpp
@@ -82,7 +82,7 @@
     VerifyOrDie(aPath.mClusterId == Thermostat::Id);
 
     uint32_t ourFeatureMap;
-    bool localTemperatureNotExposedSupported = (FeatureMap::Get(aPath.mEndpointId, &ourFeatureMap) == EMBER_ZCL_STATUS_SUCCESS) &&
+    bool localTemperatureNotExposedSupported = (FeatureMap::Get(aPath.mEndpointId, &ourFeatureMap) == imcode::Success) &&
         ((ourFeatureMap & to_underlying(Feature::kLocalTemperatureNotExposed)) != 0);
 
     switch (aPath.mAttributeId)
@@ -97,8 +97,8 @@
         if (localTemperatureNotExposedSupported)
         {
             BitMask<RemoteSensingBitmap> valueRemoteSensing;
-            EmberAfStatus status = RemoteSensing::Get(aPath.mEndpointId, &valueRemoteSensing);
-            if (status != EMBER_ZCL_STATUS_SUCCESS)
+            imcode status = RemoteSensing::Get(aPath.mEndpointId, &valueRemoteSensing);
+            if (status != imcode::Success)
             {
                 StatusIB statusIB(status);
                 return statusIB.ToChipError();
@@ -139,7 +139,7 @@
     VerifyOrDie(aPath.mClusterId == Thermostat::Id);
 
     uint32_t ourFeatureMap;
-    bool localTemperatureNotExposedSupported = (FeatureMap::Get(aPath.mEndpointId, &ourFeatureMap) == EMBER_ZCL_STATUS_SUCCESS) &&
+    bool localTemperatureNotExposedSupported = (FeatureMap::Get(aPath.mEndpointId, &ourFeatureMap) == imcode::Success) &&
         ((ourFeatureMap & to_underlying(Feature::kLocalTemperatureNotExposed)) != 0);
 
     switch (aPath.mAttributeId)
@@ -153,8 +153,7 @@
             {
                 return CHIP_IM_GLOBAL_STATUS(ConstraintError);
             }
-
-            EmberAfStatus status = RemoteSensing::Set(aPath.mEndpointId, valueRemoteSensing);
+            imcode status = RemoteSensing::Set(aPath.mEndpointId, valueRemoteSensing);
             StatusIB statusIB(status);
             return statusIB.ToChipError();
         }
@@ -226,7 +225,7 @@
     bool CoolSupported      = false;
     bool OccupancySupported = false;
 
-    if (FeatureMap::Get(endpoint, &OurFeatureMap) != EMBER_ZCL_STATUS_SUCCESS)
+    if (FeatureMap::Get(endpoint, &OurFeatureMap) != imcode::Success)
         OurFeatureMap = FEATURE_MAP_DEFAULT;
 
     if (OurFeatureMap & 1 << 5) // Bit 5 is Auto Mode supported
@@ -243,60 +242,60 @@
 
     if (AutoSupported)
     {
-        if (MinSetpointDeadBand::Get(endpoint, &DeadBand) != EMBER_ZCL_STATUS_SUCCESS)
+        if (MinSetpointDeadBand::Get(endpoint, &DeadBand) != imcode::Success)
         {
             DeadBand = kDefaultDeadBand;
         }
         DeadBandTemp = static_cast<int16_t>(DeadBand * 10);
     }
 
-    if (AbsMinCoolSetpointLimit::Get(endpoint, &AbsMinCoolSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS)
+    if (AbsMinCoolSetpointLimit::Get(endpoint, &AbsMinCoolSetpointLimit) != imcode::Success)
         AbsMinCoolSetpointLimit = kDefaultAbsMinCoolSetpointLimit;
 
-    if (AbsMaxCoolSetpointLimit::Get(endpoint, &AbsMaxCoolSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS)
+    if (AbsMaxCoolSetpointLimit::Get(endpoint, &AbsMaxCoolSetpointLimit) != imcode::Success)
         AbsMaxCoolSetpointLimit = kDefaultAbsMaxCoolSetpointLimit;
 
-    if (MinCoolSetpointLimit::Get(endpoint, &MinCoolSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS)
+    if (MinCoolSetpointLimit::Get(endpoint, &MinCoolSetpointLimit) != imcode::Success)
         MinCoolSetpointLimit = AbsMinCoolSetpointLimit;
 
-    if (MaxCoolSetpointLimit::Get(endpoint, &MaxCoolSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS)
+    if (MaxCoolSetpointLimit::Get(endpoint, &MaxCoolSetpointLimit) != imcode::Success)
         MaxCoolSetpointLimit = AbsMaxCoolSetpointLimit;
 
-    if (AbsMinHeatSetpointLimit::Get(endpoint, &AbsMinHeatSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS)
+    if (AbsMinHeatSetpointLimit::Get(endpoint, &AbsMinHeatSetpointLimit) != imcode::Success)
         AbsMinHeatSetpointLimit = kDefaultAbsMinHeatSetpointLimit;
 
-    if (AbsMaxHeatSetpointLimit::Get(endpoint, &AbsMaxHeatSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS)
+    if (AbsMaxHeatSetpointLimit::Get(endpoint, &AbsMaxHeatSetpointLimit) != imcode::Success)
         AbsMaxHeatSetpointLimit = kDefaultAbsMaxHeatSetpointLimit;
 
-    if (MinHeatSetpointLimit::Get(endpoint, &MinHeatSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS)
+    if (MinHeatSetpointLimit::Get(endpoint, &MinHeatSetpointLimit) != imcode::Success)
         MinHeatSetpointLimit = AbsMinHeatSetpointLimit;
 
-    if (MaxHeatSetpointLimit::Get(endpoint, &MaxHeatSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS)
+    if (MaxHeatSetpointLimit::Get(endpoint, &MaxHeatSetpointLimit) != imcode::Success)
         MaxHeatSetpointLimit = AbsMaxHeatSetpointLimit;
 
     if (CoolSupported)
-        if (OccupiedCoolingSetpoint::Get(endpoint, &OccupiedCoolingSetpoint) != EMBER_ZCL_STATUS_SUCCESS)
+        if (OccupiedCoolingSetpoint::Get(endpoint, &OccupiedCoolingSetpoint) != imcode::Success)
         {
             ChipLogError(Zcl, "Error: Can not read Occupied Cooling Setpoint");
             return imcode::Failure;
         }
 
     if (HeatSupported)
-        if (OccupiedHeatingSetpoint::Get(endpoint, &OccupiedHeatingSetpoint) != EMBER_ZCL_STATUS_SUCCESS)
+        if (OccupiedHeatingSetpoint::Get(endpoint, &OccupiedHeatingSetpoint) != imcode::Success)
         {
             ChipLogError(Zcl, "Error: Can not read Occupied Heating Setpoint");
             return imcode::Failure;
         }
 
     if (CoolSupported && OccupancySupported)
-        if (UnoccupiedCoolingSetpoint::Get(endpoint, &UnoccupiedCoolingSetpoint) != EMBER_ZCL_STATUS_SUCCESS)
+        if (UnoccupiedCoolingSetpoint::Get(endpoint, &UnoccupiedCoolingSetpoint) != imcode::Success)
         {
             ChipLogError(Zcl, "Error: Can not read Unoccupied Cooling Setpoint");
             return imcode::Failure;
         }
 
     if (HeatSupported && OccupancySupported)
-        if (UnoccupiedHeatingSetpoint::Get(endpoint, &UnoccupiedHeatingSetpoint) != EMBER_ZCL_STATUS_SUCCESS)
+        if (UnoccupiedHeatingSetpoint::Get(endpoint, &UnoccupiedHeatingSetpoint) != imcode::Success)
         {
             ChipLogError(Zcl, "Error: Can not read Unoccupied Heating Setpoint");
             return imcode::Failure;
@@ -434,8 +433,8 @@
 
     case SystemMode::Id: {
         ControlSequenceOfOperationEnum ControlSequenceOfOperation;
-        EmberAfStatus status = ControlSequenceOfOperation::Get(endpoint, &ControlSequenceOfOperation);
-        if (status != EMBER_ZCL_STATUS_SUCCESS)
+        imcode status = ControlSequenceOfOperation::Get(endpoint, &ControlSequenceOfOperation);
+        if (status != imcode::Success)
         {
             return imcode::InvalidValue;
         }
@@ -566,7 +565,7 @@
 
     // Note that the limits are initialized above per the spec limits
     // if they are not present Get() will not update the value so the defaults are used
-    EmberAfStatus status;
+    imcode status;
 
     // https://github.com/CHIP-Specifications/connectedhomeip-spec/issues/3724
     // behavior is not specified when Abs * values are not present and user values are present
@@ -576,24 +575,24 @@
     // if a attribute is not present then it's default shall be used.
 
     status = AbsMinHeatSetpointLimit::Get(endpoint, &AbsMinHeatSetpointLimit);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != imcode::Success)
     {
         ChipLogError(Zcl, "Warning: AbsMinHeatSetpointLimit missing using default");
     }
 
     status = AbsMaxHeatSetpointLimit::Get(endpoint, &AbsMaxHeatSetpointLimit);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != imcode::Success)
     {
         ChipLogError(Zcl, "Warning: AbsMaxHeatSetpointLimit missing using default");
     }
     status = MinHeatSetpointLimit::Get(endpoint, &MinHeatSetpointLimit);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != imcode::Success)
     {
         MinHeatSetpointLimit = AbsMinHeatSetpointLimit;
     }
 
     status = MaxHeatSetpointLimit::Get(endpoint, &MaxHeatSetpointLimit);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != imcode::Success)
     {
         MaxHeatSetpointLimit = AbsMaxHeatSetpointLimit;
     }
@@ -637,7 +636,7 @@
 
     // Note that the limits are initialized above per the spec limits
     // if they are not present Get() will not update the value so the defaults are used
-    EmberAfStatus status;
+    imcode status;
 
     // https://github.com/CHIP-Specifications/connectedhomeip-spec/issues/3724
     // behavior is not specified when Abs * values are not present and user values are present
@@ -647,25 +646,25 @@
     // if a attribute is not present then it's default shall be used.
 
     status = AbsMinCoolSetpointLimit::Get(endpoint, &AbsMinCoolSetpointLimit);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != imcode::Success)
     {
         ChipLogError(Zcl, "Warning: AbsMinCoolSetpointLimit missing using default");
     }
 
     status = AbsMaxCoolSetpointLimit::Get(endpoint, &AbsMaxCoolSetpointLimit);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != imcode::Success)
     {
         ChipLogError(Zcl, "Warning: AbsMaxCoolSetpointLimit missing using default");
     }
 
     status = MinCoolSetpointLimit::Get(endpoint, &MinCoolSetpointLimit);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != imcode::Success)
     {
         MinCoolSetpointLimit = AbsMinCoolSetpointLimit;
     }
 
     status = MaxCoolSetpointLimit::Get(endpoint, &MaxCoolSetpointLimit);
-    if (status != EMBER_ZCL_STATUS_SUCCESS)
+    if (status != imcode::Success)
     {
         MaxCoolSetpointLimit = AbsMaxCoolSetpointLimit;
     }
@@ -702,17 +701,17 @@
     EndpointId aEndpointId = commandPath.mEndpointId;
 
     int16_t HeatingSetpoint = kDefaultHeatingSetpoint, CoolingSetpoint = kDefaultCoolingSetpoint; // Set to defaults to be safe
-    EmberAfStatus status                     = EMBER_ZCL_STATUS_FAILURE;
-    EmberAfStatus WriteCoolingSetpointStatus = EMBER_ZCL_STATUS_FAILURE;
-    EmberAfStatus WriteHeatingSetpointStatus = EMBER_ZCL_STATUS_FAILURE;
-    int16_t DeadBandTemp                     = 0;
-    int8_t DeadBand                          = 0;
+    imcode status                     = imcode::Failure;
+    imcode WriteCoolingSetpointStatus = imcode::Failure;
+    imcode WriteHeatingSetpointStatus = imcode::Failure;
+    int16_t DeadBandTemp              = 0;
+    int8_t DeadBand                   = 0;
     uint32_t OurFeatureMap;
     bool AutoSupported = false;
     bool HeatSupported = false;
     bool CoolSupported = false;
 
-    if (FeatureMap::Get(aEndpointId, &OurFeatureMap) != EMBER_ZCL_STATUS_SUCCESS)
+    if (FeatureMap::Get(aEndpointId, &OurFeatureMap) != imcode::Success)
         OurFeatureMap = FEATURE_MAP_DEFAULT;
 
     if (OurFeatureMap & 1 << 5) // Bit 5 is Auto Mode supported
@@ -726,7 +725,7 @@
 
     if (AutoSupported)
     {
-        if (MinSetpointDeadBand::Get(aEndpointId, &DeadBand) != EMBER_ZCL_STATUS_SUCCESS)
+        if (MinSetpointDeadBand::Get(aEndpointId, &DeadBand) != imcode::Success)
             DeadBand = kDefaultDeadBand;
         DeadBandTemp = static_cast<int16_t>(DeadBand * 10);
     }
@@ -737,13 +736,13 @@
         if (HeatSupported && CoolSupported)
         {
             int16_t DesiredCoolingSetpoint, CoolLimit, DesiredHeatingSetpoint, HeatLimit;
-            if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+            if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == imcode::Success)
             {
                 DesiredCoolingSetpoint = static_cast<int16_t>(CoolingSetpoint + amount * 10);
                 CoolLimit              = static_cast<int16_t>(DesiredCoolingSetpoint -
                                                  EnforceCoolingSetpointLimits(DesiredCoolingSetpoint, aEndpointId));
                 {
-                    if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+                    if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == imcode::Success)
                     {
                         DesiredHeatingSetpoint = static_cast<int16_t>(HeatingSetpoint + amount * 10);
                         HeatLimit              = static_cast<int16_t>(DesiredHeatingSetpoint -
@@ -765,12 +764,12 @@
                                 }
                             }
                             WriteCoolingSetpointStatus = OccupiedCoolingSetpoint::Set(aEndpointId, DesiredCoolingSetpoint);
-                            if (WriteCoolingSetpointStatus != EMBER_ZCL_STATUS_SUCCESS)
+                            if (WriteCoolingSetpointStatus != imcode::Success)
                             {
                                 ChipLogError(Zcl, "Error: SetOccupiedCoolingSetpoint failed!");
                             }
                             WriteHeatingSetpointStatus = OccupiedHeatingSetpoint::Set(aEndpointId, DesiredHeatingSetpoint);
-                            if (WriteHeatingSetpointStatus != EMBER_ZCL_STATUS_SUCCESS)
+                            if (WriteHeatingSetpointStatus != imcode::Success)
                             {
                                 ChipLogError(Zcl, "Error: SetOccupiedHeatingSetpoint failed!");
                             }
@@ -782,12 +781,12 @@
 
         if (CoolSupported && !HeatSupported)
         {
-            if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+            if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == imcode::Success)
             {
                 CoolingSetpoint            = static_cast<int16_t>(CoolingSetpoint + amount * 10);
                 CoolingSetpoint            = EnforceCoolingSetpointLimits(CoolingSetpoint, aEndpointId);
                 WriteCoolingSetpointStatus = OccupiedCoolingSetpoint::Set(aEndpointId, CoolingSetpoint);
-                if (WriteCoolingSetpointStatus != EMBER_ZCL_STATUS_SUCCESS)
+                if (WriteCoolingSetpointStatus != imcode::Success)
                 {
                     ChipLogError(Zcl, "Error: SetOccupiedCoolingSetpoint failed!");
                 }
@@ -796,34 +795,34 @@
 
         if (HeatSupported && !CoolSupported)
         {
-            if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+            if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == imcode::Success)
             {
                 HeatingSetpoint            = static_cast<int16_t>(HeatingSetpoint + amount * 10);
                 HeatingSetpoint            = EnforceHeatingSetpointLimits(HeatingSetpoint, aEndpointId);
                 WriteHeatingSetpointStatus = OccupiedHeatingSetpoint::Set(aEndpointId, HeatingSetpoint);
-                if (WriteHeatingSetpointStatus != EMBER_ZCL_STATUS_SUCCESS)
+                if (WriteHeatingSetpointStatus != imcode::Success)
                 {
                     ChipLogError(Zcl, "Error: SetOccupiedHeatingSetpoint failed!");
                 }
             }
         }
 
-        if ((!HeatSupported || WriteHeatingSetpointStatus == EMBER_ZCL_STATUS_SUCCESS) &&
-            (!CoolSupported || WriteCoolingSetpointStatus == EMBER_ZCL_STATUS_SUCCESS))
-            status = EMBER_ZCL_STATUS_SUCCESS;
+        if ((!HeatSupported || WriteHeatingSetpointStatus == imcode::Success) &&
+            (!CoolSupported || WriteCoolingSetpointStatus == imcode::Success))
+            status = imcode::Success;
         break;
 
     case SetpointRaiseLowerModeEnum::kCool:
         if (CoolSupported)
         {
-            if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+            if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == imcode::Success)
             {
                 CoolingSetpoint = static_cast<int16_t>(CoolingSetpoint + amount * 10);
                 CoolingSetpoint = EnforceCoolingSetpointLimits(CoolingSetpoint, aEndpointId);
                 if (AutoSupported)
                 {
                     // Need to check if we can move the cooling setpoint while maintaining the dead band
-                    if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+                    if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == imcode::Success)
                     {
                         if (CoolingSetpoint - HeatingSetpoint < DeadBandTemp)
                         {
@@ -834,10 +833,10 @@
                             {
                                 // Desired cooling setpoint is enforcable
                                 // Set the new cooling and heating setpoints
-                                if (OccupiedHeatingSetpoint::Set(aEndpointId, HeatingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+                                if (OccupiedHeatingSetpoint::Set(aEndpointId, HeatingSetpoint) == imcode::Success)
                                 {
-                                    if (OccupiedCoolingSetpoint::Set(aEndpointId, CoolingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
-                                        status = EMBER_ZCL_STATUS_SUCCESS;
+                                    if (OccupiedCoolingSetpoint::Set(aEndpointId, CoolingSetpoint) == imcode::Success)
+                                        status = imcode::Success;
                                 }
                                 else
                                     ChipLogError(Zcl, "Error: SetOccupiedHeatingSetpoint failed!");
@@ -845,7 +844,7 @@
                             else
                             {
                                 ChipLogError(Zcl, "Error: Could Not adjust heating setpoint to maintain dead band!");
-                                status = EMBER_ZCL_STATUS_INVALID_COMMAND;
+                                status = imcode::InvalidCommand;
                             }
                         }
                         else
@@ -863,20 +862,20 @@
                 ChipLogError(Zcl, "Error: GetOccupiedCoolingSetpoint failed!");
         }
         else
-            status = EMBER_ZCL_STATUS_INVALID_COMMAND;
+            status = imcode::InvalidCommand;
         break;
 
     case SetpointRaiseLowerModeEnum::kHeat:
         if (HeatSupported)
         {
-            if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+            if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == imcode::Success)
             {
                 HeatingSetpoint = static_cast<int16_t>(HeatingSetpoint + amount * 10);
                 HeatingSetpoint = EnforceHeatingSetpointLimits(HeatingSetpoint, aEndpointId);
                 if (AutoSupported)
                 {
                     // Need to check if we can move the cooling setpoint while maintaining the dead band
-                    if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+                    if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == imcode::Success)
                     {
                         if (CoolingSetpoint - HeatingSetpoint < DeadBandTemp)
                         {
@@ -887,10 +886,10 @@
                             {
                                 // Desired cooling setpoint is enforcable
                                 // Set the new cooling and heating setpoints
-                                if (OccupiedCoolingSetpoint::Set(aEndpointId, CoolingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
+                                if (OccupiedCoolingSetpoint::Set(aEndpointId, CoolingSetpoint) == imcode::Success)
                                 {
-                                    if (OccupiedHeatingSetpoint::Set(aEndpointId, HeatingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
-                                        status = EMBER_ZCL_STATUS_SUCCESS;
+                                    if (OccupiedHeatingSetpoint::Set(aEndpointId, HeatingSetpoint) == imcode::Success)
+                                        status = imcode::Success;
                                 }
                                 else
                                     ChipLogError(Zcl, "Error: SetOccupiedCoolingSetpoint failed!");
@@ -898,7 +897,7 @@
                             else
                             {
                                 ChipLogError(Zcl, "Error: Could Not adjust cooling setpoint to maintain dead band!");
-                                status = EMBER_ZCL_STATUS_INVALID_COMMAND;
+                                status = imcode::InvalidCommand;
                             }
                         }
                         else
@@ -916,11 +915,11 @@
                 ChipLogError(Zcl, "Error: GetOccupiedHeatingSetpoint failed!");
         }
         else
-            status = EMBER_ZCL_STATUS_INVALID_COMMAND;
+            status = imcode::InvalidCommand;
         break;
 
     default:
-        status = EMBER_ZCL_STATUS_INVALID_COMMAND;
+        status = imcode::InvalidCommand;
         break;
     }
 
diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp
index 8539566..08e9020 100644
--- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp
+++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp
@@ -39,6 +39,8 @@
 using namespace chip::app::Clusters::TimeFormatLocalization::Attributes;
 using namespace chip::DeviceLayer;
 
+using chip::Protocols::InteractionModel::Status;
+
 namespace {
 
 class TimeFormatLocalizationAttrAccess : public AttributeAccessInterface
@@ -202,18 +204,18 @@
 {
     CalendarTypeEnum calendarType;
     CalendarTypeEnum validType;
-    EmberAfStatus status = ActiveCalendarType::Get(endpoint, &calendarType);
+    Status status = ActiveCalendarType::Get(endpoint, &calendarType);
 
-    VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
-                   ChipLogError(Zcl, "Failed to read calendar type with error: 0x%02x", status));
+    VerifyOrReturn(Status::Success == status,
+                   ChipLogError(Zcl, "Failed to read calendar type with error: 0x%02x", to_underlying(status)));
 
     // We could have an invalid calendar type value if an OTA update removed support for the value we were using.
     // If initial value is not one of the allowed values, pick one valid value and write it.
     if (!IsSupportedCalendarType(calendarType, validType))
     {
         status = ActiveCalendarType::Set(endpoint, validType);
-        VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
-                       ChipLogError(Zcl, "Failed to write calendar type with error: 0x%02x", status));
+        VerifyOrReturn(Status::Success == status,
+                       ChipLogError(Zcl, "Failed to write calendar type with error: 0x%02x", to_underlying(status)));
     }
 }
 
diff --git a/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp b/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp
index 8e919ef..cc6c3f5 100644
--- a/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp
+++ b/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp
@@ -380,9 +380,9 @@
         }
         return;
     }
-    mGranularity         = granularity;
-    EmberAfStatus status = TimeSource::Set(kRootEndpointId, timeSource);
-    if (!(status == EMBER_ZCL_STATUS_SUCCESS || status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE))
+    mGranularity  = granularity;
+    Status status = TimeSource::Set(kRootEndpointId, timeSource);
+    if (!(status == Status::Success || status == Status::UnsupportedAttribute))
     {
         ChipLogError(Zcl, "Writing TimeSource failed.");
     }
@@ -394,8 +394,8 @@
     {
         mGranularity = GranularityEnum::kMillisecondsGranularity;
         // Non-matter SNTP because we know it's external and there's only one source
-        EmberAfStatus status = TimeSource::Set(kRootEndpointId, TimeSourceEnum::kNonMatterSNTP);
-        if (!(status == EMBER_ZCL_STATUS_SUCCESS || status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE))
+        Status status = TimeSource::Set(kRootEndpointId, TimeSourceEnum::kNonMatterSNTP);
+        if (!(status == Status::Success || status == Status::UnsupportedAttribute))
         {
             ChipLogError(Zcl, "Writing TimeSource failed.");
         }
@@ -777,9 +777,9 @@
         return err;
     }
     GetDelegate()->UTCTimeAvailabilityChanged(utcTime);
-    mGranularity         = granularity;
-    EmberAfStatus status = TimeSource::Set(ep, source);
-    if (!(status == EMBER_ZCL_STATUS_SUCCESS || status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE))
+    mGranularity  = granularity;
+    Status status = TimeSource::Set(ep, source);
+    if (!(status == Status::Success || status == Status::UnsupportedAttribute))
     {
         ChipLogError(Zcl, "Writing TimeSource failed.");
         return CHIP_IM_GLOBAL_STATUS(Failure);
@@ -1264,7 +1264,7 @@
             return true;
         }
         bool dnsResolve;
-        if (EMBER_ZCL_STATUS_SUCCESS != SupportsDNSResolve::Get(commandPath.mEndpointId, &dnsResolve))
+        if (Status::Success != SupportsDNSResolve::Get(commandPath.mEndpointId, &dnsResolve))
         {
             commandObj->AddStatus(commandPath, Status::Failure);
             return true;
diff --git a/src/app/clusters/window-covering-server/window-covering-server.cpp b/src/app/clusters/window-covering-server/window-covering-server.cpp
index 1b47b9c..ba7d74c 100644
--- a/src/app/clusters/window-covering-server/window-covering-server.cpp
+++ b/src/app/clusters/window-covering-server/window-covering-server.cpp
@@ -118,8 +118,8 @@
     bool hasFeature     = false;
     uint32_t featureMap = 0;
 
-    EmberAfStatus status = Attributes::FeatureMap::Get(endpoint, &featureMap);
-    if (EMBER_ZCL_STATUS_SUCCESS == status)
+    Status status = Attributes::FeatureMap::Get(endpoint, &featureMap);
+    if (Status::Success == status)
     {
         hasFeature = (featureMap & chip::to_underlying(feature));
     }
diff --git a/src/app/server/Server.h b/src/app/server/Server.h
index 5e51254..302471b 100644
--- a/src/app/server/Server.h
+++ b/src/app/server/Server.h
@@ -609,7 +609,7 @@
     FabricTable mFabrics;
     secure_channel::MessageCounterManager mMessageCounterManager;
 #if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT
-    chip::Protocols::UserDirectedCommissioning::UserDirectedCommissioningClient * gUDCClient = nullptr;
+    Protocols::UserDirectedCommissioning::UserDirectedCommissioningClient * gUDCClient = nullptr;
     // mUdcTransportMgr is for insecure communication (ex. user directed commissioning)
     // specifically, the commissioner declaration message (sent by commissioner to commissionee)
     UdcTransportMgr * mUdcTransportMgr = nullptr;
diff --git a/src/app/util/af-enums.h b/src/app/util/af-enums.h
index 411f042..50bf0af 100644
--- a/src/app/util/af-enums.h
+++ b/src/app/util/af-enums.h
@@ -23,50 +23,48 @@
 #include <protocols/interaction_model/StatusCode.h>
 #include <stdint.h>
 
-typedef chip::Protocols::InteractionModel::Status EmberAfStatus;
-
-#define EMBER_ZCL_STATUS_SUCCESS chip::Protocols::InteractionModel::Status::Success
-#define EMBER_ZCL_STATUS_FAILURE chip::Protocols::InteractionModel::Status::Failure
-#define EMBER_ZCL_STATUS_INVALID_SUBSCRIPTION chip::Protocols::InteractionModel::Status::InvalidSubscription
-#define EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS chip::Protocols::InteractionModel::Status::UnsupportedAccess
-#define EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT chip::Protocols::InteractionModel::Status::UnsupportedEndpoint
-#define EMBER_ZCL_STATUS_MALFORMED_COMMAND chip::Protocols::InteractionModel::Status::InvalidAction
-#define EMBER_ZCL_STATUS_UNSUPPORTED_COMMAND chip::Protocols::InteractionModel::Status::UnsupportedCommand
-#define EMBER_ZCL_STATUS_DEPRECATED82 chip::Protocols::InteractionModel::Status::Deprecated82
-#define EMBER_ZCL_STATUS_DEPRECATED83 chip::Protocols::InteractionModel::Status::Deprecated83
-#define EMBER_ZCL_STATUS_DEPRECATED84 chip::Protocols::InteractionModel::Status::Deprecated84
-#define EMBER_ZCL_STATUS_INVALID_COMMAND chip::Protocols::InteractionModel::Status::InvalidCommand
-#define EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE chip::Protocols::InteractionModel::Status::UnsupportedAttribute
-#define EMBER_ZCL_STATUS_CONSTRAINT_ERROR chip::Protocols::InteractionModel::Status::ConstraintError
-#define EMBER_ZCL_STATUS_UNSUPPORTED_WRITE chip::Protocols::InteractionModel::Status::UnsupportedWrite
-#define EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED chip::Protocols::InteractionModel::Status::ResourceExhausted
-#define EMBER_ZCL_STATUS_NOT_FOUND chip::Protocols::InteractionModel::Status::NotFound
-#define EMBER_ZCL_STATUS_UNREPORTABLE_ATTRIBUTE chip::Protocols::InteractionModel::Status::UnreportableAttribute
-#define EMBER_ZCL_STATUS_INVALID_DATA_TYPE chip::Protocols::InteractionModel::Status::InvalidDataType
-#define EMBER_ZCL_STATUS_DEPRECATED8E chip::Protocols::InteractionModel::Status::Deprecated8e
-#define EMBER_ZCL_STATUS_UNSUPPORTED_READ chip::Protocols::InteractionModel::Status::UnsupportedRead
-#define EMBER_ZCL_STATUS_DEPRECATED90 chip::Protocols::InteractionModel::Status::Deprecated90
-#define EMBER_ZCL_STATUS_DEPRECATED91 chip::Protocols::InteractionModel::Status::Deprecated91
-#define EMBER_ZCL_STATUS_DATA_VERSION_MISMATCH chip::Protocols::InteractionModel::Status::DataVersionMismatch
-#define EMBER_ZCL_STATUS_DEPRECATED93 chip::Protocols::InteractionModel::Status::Deprecated93
-#define EMBER_ZCL_STATUS_TIMEOUT chip::Protocols::InteractionModel::Status::Timeout
-#define EMBER_ZCL_STATUS_RESERVED95 chip::Protocols::InteractionModel::Status::Reserved95
-#define EMBER_ZCL_STATUS_RESERVED96 chip::Protocols::InteractionModel::Status::Reserved96
-#define EMBER_ZCL_STATUS_RESERVED97 chip::Protocols::InteractionModel::Status::Reserved97
-#define EMBER_ZCL_STATUS_RESERVED98 chip::Protocols::InteractionModel::Status::Reserved98
-#define EMBER_ZCL_STATUS_RESERVED99 chip::Protocols::InteractionModel::Status::Reserved99
-#define EMBER_ZCL_STATUS_RESERVED9A chip::Protocols::InteractionModel::Status::Reserved9a
-#define EMBER_ZCL_STATUS_BUSY chip::Protocols::InteractionModel::Status::Busy
-#define EMBER_ZCL_STATUS_DEPRECATEDC0 chip::Protocols::InteractionModel::Status::Deprecatedc0
-#define EMBER_ZCL_STATUS_DEPRECATEDC1 chip::Protocols::InteractionModel::Status::Deprecatedc1
-#define EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER chip::Protocols::InteractionModel::Status::UnsupportedCluster
-#define EMBER_ZCL_STATUS_DEPRECATEDC4 chip::Protocols::InteractionModel::Status::Deprecatedc4
-#define EMBER_ZCL_STATUS_NO_UPSTREAM_SUBSCRIPTION chip::Protocols::InteractionModel::Status::NoUpstreamSubscription
-#define EMBER_ZCL_STATUS_NEEDS_TIMED_INTERACTION chip::Protocols::InteractionModel::Status::NeedsTimedInteraction
-#define EMBER_ZCL_STATUS_UNSUPPORTED_EVENT chip::Protocols::InteractionModel::Status::UnsupportedEvent
-#define EMBER_ZCL_STATUS_PATHS_EXHAUSTED chip::Protocols::InteractionModel::Status::PathsExhausted
-#define EMBER_ZCL_STATUS_TIMED_REQUEST_MISMATCH chip::Protocols::InteractionModel::Status::TimedRequestMismatch
-#define EMBER_ZCL_STATUS_FAILSAFE_REQUIRED chip::Protocols::InteractionModel::Status::FailsafeRequired
-#define EMBER_ZCL_STATUS_INVALID_IN_STATE chip::Protocols::InteractionModel::Status::InvalidInState
-#define EMBER_ZCL_STATUS_NO_COMMAND_RESPONSE chip::Protocols::InteractionModel::Status::NoCommandResponse
-#define EMBER_ZCL_STATUS_WRITE_IGNORED chip::Protocols::InteractionModel::Status::WriteIgnored // NOT SPEC COMPLIANT FOR TEST ONLY
+#define EMBER_ZCL_STATUS_SUCCESS Protocols::InteractionModel::Status::Success
+#define EMBER_ZCL_STATUS_FAILURE Protocols::InteractionModel::Status::Failure
+#define EMBER_ZCL_STATUS_INVALID_SUBSCRIPTION Protocols::InteractionModel::Status::InvalidSubscription
+#define EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS Protocols::InteractionModel::Status::UnsupportedAccess
+#define EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT Protocols::InteractionModel::Status::UnsupportedEndpoint
+#define EMBER_ZCL_STATUS_MALFORMED_COMMAND Protocols::InteractionModel::Status::InvalidAction
+#define EMBER_ZCL_STATUS_UNSUPPORTED_COMMAND Protocols::InteractionModel::Status::UnsupportedCommand
+#define EMBER_ZCL_STATUS_DEPRECATED82 Protocols::InteractionModel::Status::Deprecated82
+#define EMBER_ZCL_STATUS_DEPRECATED83 Protocols::InteractionModel::Status::Deprecated83
+#define EMBER_ZCL_STATUS_DEPRECATED84 Protocols::InteractionModel::Status::Deprecated84
+#define EMBER_ZCL_STATUS_INVALID_COMMAND Protocols::InteractionModel::Status::InvalidCommand
+#define EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE Protocols::InteractionModel::Status::UnsupportedAttribute
+#define EMBER_ZCL_STATUS_CONSTRAINT_ERROR Protocols::InteractionModel::Status::ConstraintError
+#define EMBER_ZCL_STATUS_UNSUPPORTED_WRITE Protocols::InteractionModel::Status::UnsupportedWrite
+#define EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED Protocols::InteractionModel::Status::ResourceExhausted
+#define EMBER_ZCL_STATUS_NOT_FOUND Protocols::InteractionModel::Status::NotFound
+#define EMBER_ZCL_STATUS_UNREPORTABLE_ATTRIBUTE Protocols::InteractionModel::Status::UnreportableAttribute
+#define EMBER_ZCL_STATUS_INVALID_DATA_TYPE Protocols::InteractionModel::Status::InvalidDataType
+#define EMBER_ZCL_STATUS_DEPRECATED8E Protocols::InteractionModel::Status::Deprecated8e
+#define EMBER_ZCL_STATUS_UNSUPPORTED_READ Protocols::InteractionModel::Status::UnsupportedRead
+#define EMBER_ZCL_STATUS_DEPRECATED90 Protocols::InteractionModel::Status::Deprecated90
+#define EMBER_ZCL_STATUS_DEPRECATED91 Protocols::InteractionModel::Status::Deprecated91
+#define EMBER_ZCL_STATUS_DATA_VERSION_MISMATCH Protocols::InteractionModel::Status::DataVersionMismatch
+#define EMBER_ZCL_STATUS_DEPRECATED93 Protocols::InteractionModel::Status::Deprecated93
+#define EMBER_ZCL_STATUS_TIMEOUT Protocols::InteractionModel::Status::Timeout
+#define EMBER_ZCL_STATUS_RESERVED95 Protocols::InteractionModel::Status::Reserved95
+#define EMBER_ZCL_STATUS_RESERVED96 Protocols::InteractionModel::Status::Reserved96
+#define EMBER_ZCL_STATUS_RESERVED97 Protocols::InteractionModel::Status::Reserved97
+#define EMBER_ZCL_STATUS_RESERVED98 Protocols::InteractionModel::Status::Reserved98
+#define EMBER_ZCL_STATUS_RESERVED99 Protocols::InteractionModel::Status::Reserved99
+#define EMBER_ZCL_STATUS_RESERVED9A Protocols::InteractionModel::Status::Reserved9a
+#define EMBER_ZCL_STATUS_BUSY Protocols::InteractionModel::Status::Busy
+#define EMBER_ZCL_STATUS_DEPRECATEDC0 Protocols::InteractionModel::Status::Deprecatedc0
+#define EMBER_ZCL_STATUS_DEPRECATEDC1 Protocols::InteractionModel::Status::Deprecatedc1
+#define EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER Protocols::InteractionModel::Status::UnsupportedCluster
+#define EMBER_ZCL_STATUS_DEPRECATEDC4 Protocols::InteractionModel::Status::Deprecatedc4
+#define EMBER_ZCL_STATUS_NO_UPSTREAM_SUBSCRIPTION Protocols::InteractionModel::Status::NoUpstreamSubscription
+#define EMBER_ZCL_STATUS_NEEDS_TIMED_INTERACTION Protocols::InteractionModel::Status::NeedsTimedInteraction
+#define EMBER_ZCL_STATUS_UNSUPPORTED_EVENT Protocols::InteractionModel::Status::UnsupportedEvent
+#define EMBER_ZCL_STATUS_PATHS_EXHAUSTED Protocols::InteractionModel::Status::PathsExhausted
+#define EMBER_ZCL_STATUS_TIMED_REQUEST_MISMATCH Protocols::InteractionModel::Status::TimedRequestMismatch
+#define EMBER_ZCL_STATUS_FAILSAFE_REQUIRED Protocols::InteractionModel::Status::FailsafeRequired
+#define EMBER_ZCL_STATUS_INVALID_IN_STATE Protocols::InteractionModel::Status::InvalidInState
+#define EMBER_ZCL_STATUS_NO_COMMAND_RESPONSE Protocols::InteractionModel::Status::NoCommandResponse
+#define EMBER_ZCL_STATUS_WRITE_IGNORED Protocols::InteractionModel::Status::WriteIgnored // NOT SPEC COMPLIANT FOR TEST ONLY
diff --git a/src/app/util/af-types.h b/src/app/util/af-types.h
index 66738e1..f252627 100644
--- a/src/app/util/af-types.h
+++ b/src/app/util/af-types.h
@@ -43,8 +43,6 @@
 #include <app-common/zap-generated/cluster-objects.h>
 #include <protocols/interaction_model/StatusCode.h>
 
-using chip::Protocols::InteractionModel::Status;
-
 /**
  * @brief Type for the cluster mask
  */
@@ -293,8 +291,8 @@
  *
  * This function is called before an attribute changes.
  */
-typedef Status (*EmberAfClusterPreAttributeChangedCallback)(const chip::app::ConcreteAttributePath & attributePath,
-                                                            EmberAfAttributeType attributeType, uint16_t size, uint8_t * value);
+typedef chip::Protocols::InteractionModel::Status (*EmberAfClusterPreAttributeChangedCallback)(
+    const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value);
 
 #define MAX_INT32U_VALUE (0xFFFFFFFFUL)
 #define MAX_INT16U_VALUE (0xFFFF)
diff --git a/src/app/util/af.h b/src/app/util/af.h
index e53b613..f7f772a 100644
--- a/src/app/util/af.h
+++ b/src/app/util/af.h
@@ -31,8 +31,6 @@
 #include <lib/support/SafeInt.h>
 #include <protocols/interaction_model/StatusCode.h>
 
-using chip::Protocols::InteractionModel::Status;
-
 /** @name Attribute Storage */
 // @{
 
@@ -98,8 +96,9 @@
  * data type (as Accessors.h/cpp have this correct by default).
  * TODO: this not checking seems off - what if this is run without Accessors.h ?
  */
-Status emberAfWriteAttribute(chip::EndpointId endpoint, chip::ClusterId cluster, chip::AttributeId attributeID, uint8_t * dataPtr,
-                             EmberAfAttributeType dataType);
+chip::Protocols::InteractionModel::Status emberAfWriteAttribute(chip::EndpointId endpoint, chip::ClusterId cluster,
+                                                                chip::AttributeId attributeID, uint8_t * dataPtr,
+                                                                EmberAfAttributeType dataType);
 
 /**
  * @brief Read the attribute value, performing all the checks.
@@ -110,8 +109,9 @@
  * dataPtr may be NULL, signifying that we don't need the value, just the status
  * (i.e. whether the attribute can be read).
  */
-Status emberAfReadAttribute(chip::EndpointId endpoint, chip::ClusterId cluster, chip::AttributeId attributeID, uint8_t * dataPtr,
-                            uint16_t readLength);
+chip::Protocols::InteractionModel::Status emberAfReadAttribute(chip::EndpointId endpoint, chip::ClusterId cluster,
+                                                               chip::AttributeId attributeID, uint8_t * dataPtr,
+                                                               uint16_t readLength);
 
 /**
  * @brief macro that returns size of attribute in bytes.
diff --git a/src/app/util/attribute-storage.h b/src/app/util/attribute-storage.h
index e68735c..83a3aea 100644
--- a/src/app/util/attribute-storage.h
+++ b/src/app/util/attribute-storage.h
@@ -30,8 +30,6 @@
 
 #include <protocols/interaction_model/StatusCode.h>
 
-using chip::Protocols::InteractionModel::Status;
-
 // If we have fixed number of endpoints, then max is the same.
 #ifdef FIXED_ENDPOINT_COUNT
 #define MAX_ENDPOINT_COUNT (FIXED_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT)
@@ -73,8 +71,9 @@
 // Initial configuration
 void emberAfEndpointConfigure(void);
 
-Status emAfReadOrWriteAttribute(const EmberAfAttributeSearchRecord * attRecord, const EmberAfAttributeMetadata ** metadata,
-                                uint8_t * buffer, uint16_t readLength, bool write);
+chip::Protocols::InteractionModel::Status emAfReadOrWriteAttribute(const EmberAfAttributeSearchRecord * attRecord,
+                                                                   const EmberAfAttributeMetadata ** metadata, uint8_t * buffer,
+                                                                   uint16_t readLength, bool write);
 
 // Check if a cluster is implemented or not. If yes, the cluster is returned.
 //
@@ -134,8 +133,9 @@
 void emAfClusterAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath);
 
 // Calls the attribute changed callback for a specific cluster.
-Status emAfClusterPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath,
-                                              EmberAfAttributeType attributeType, uint16_t size, uint8_t * value);
+chip::Protocols::InteractionModel::Status
+emAfClusterPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType,
+                                       uint16_t size, uint8_t * value);
 
 // Note the difference in for server filtering.
 // This method will return the cluster count for BOTH client and server
diff --git a/src/app/util/attribute-table.h b/src/app/util/attribute-table.h
index 0969e8c..7b86298 100644
--- a/src/app/util/attribute-table.h
+++ b/src/app/util/attribute-table.h
@@ -21,16 +21,15 @@
 
 #include <protocols/interaction_model/StatusCode.h>
 
-using chip::Protocols::InteractionModel::Status;
-
 /**
  * Write an attribute for a request arriving from external sources.
  *
  * This will check attribute writeability and that
  * the provided data type matches the expected data type.
  */
-Status emAfWriteAttributeExternal(chip::EndpointId endpoint, chip::ClusterId cluster, chip::AttributeId attributeID,
-                                  uint8_t * dataPtr, EmberAfAttributeType dataType);
+chip::Protocols::InteractionModel::Status emAfWriteAttributeExternal(chip::EndpointId endpoint, chip::ClusterId cluster,
+                                                                     chip::AttributeId attributeID, uint8_t * dataPtr,
+                                                                     EmberAfAttributeType dataType);
 
 /**
  * @brief write an attribute, performing all the checks.
@@ -62,5 +61,6 @@
  *           the attribute
  * - Status::Success: if the attribute was found and successfully written
  */
-Status emAfWriteAttribute(chip::EndpointId endpoint, chip::ClusterId cluster, chip::AttributeId attributeID, uint8_t * data,
-                          EmberAfAttributeType dataType, bool overrideReadOnlyAndDataType);
+chip::Protocols::InteractionModel::Status emAfWriteAttribute(chip::EndpointId endpoint, chip::ClusterId cluster,
+                                                             chip::AttributeId attributeID, uint8_t * data,
+                                                             EmberAfAttributeType dataType, bool overrideReadOnlyAndDataType);
diff --git a/src/app/util/generic-callback-stubs.cpp b/src/app/util/generic-callback-stubs.cpp
index 21d4085..723c9f2 100644
--- a/src/app/util/generic-callback-stubs.cpp
+++ b/src/app/util/generic-callback-stubs.cpp
@@ -19,6 +19,7 @@
 #include <app/util/basic-types.h>
 #include <lib/support/Span.h>
 #include <protocols/interaction_model/Constants.h>
+#include <protocols/interaction_model/StatusCode.h>
 
 using namespace chip;
 
@@ -34,18 +35,18 @@
     return true;
 }
 
-Status __attribute__((weak))
+chip::Protocols::InteractionModel::Status __attribute__((weak))
 emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId, const EmberAfAttributeMetadata * attributeMetadata,
                                      uint8_t * buffer, uint16_t maxReadLength)
 {
-    return Status::Failure;
+    return chip::Protocols::InteractionModel::Status::Failure;
 }
 
-Status __attribute__((weak))
+chip::Protocols::InteractionModel::Status __attribute__((weak))
 emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId, const EmberAfAttributeMetadata * attributeMetadata,
                                       uint8_t * buffer)
 {
-    return Status::Failure;
+    return chip::Protocols::InteractionModel::Status::Failure;
 }
 
 chip::Protocols::InteractionModel::Status __attribute__((weak))
diff --git a/src/app/util/generic-callbacks.h b/src/app/util/generic-callbacks.h
index 51917e6..4a20138 100644
--- a/src/app/util/generic-callbacks.h
+++ b/src/app/util/generic-callbacks.h
@@ -28,8 +28,6 @@
 #include <lib/support/Span.h>
 #include <protocols/interaction_model/Constants.h>
 
-using chip::Protocols::InteractionModel::Status;
-
 /** @brief Cluster Init
  *
  * This function is called when a specific cluster is initialized. It gives the
@@ -84,9 +82,9 @@
  * EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED. Any other return value indicates the
  * application was not able to read the attribute.
  */
-Status emberAfExternalAttributeReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
-                                            const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
-                                            uint16_t maxReadLength);
+chip::Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
+                                                                               const EmberAfAttributeMetadata * attributeMetadata,
+                                                                               uint8_t * buffer, uint16_t maxReadLength);
 
 /** @brief External Attribute Write
  *
@@ -128,15 +126,17 @@
  * other return value indicates the application was not able to write the
  * attribute.
  */
-Status emberAfExternalAttributeWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
-                                             const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer);
+chip::Protocols::InteractionModel::Status emberAfExternalAttributeWriteCallback(chip::EndpointId endpoint,
+                                                                                chip::ClusterId clusterId,
+                                                                                const EmberAfAttributeMetadata * attributeMetadata,
+                                                                                uint8_t * buffer);
 
 /** @brief Pre Attribute Change
  *
  * This function is called by the application framework before it changes an
  * attribute value.  The value passed into this callback is the value to which
  * the attribute is to be set by the framework.  The application should return
- * chip::Protocols::InteractionModel::Status::Success to permit the change or
+ * Protocols::InteractionModel::Status::Success to permit the change or
  * any other code to reject it.
  */
 chip::Protocols::InteractionModel::Status MatterPreAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath,
diff --git a/src/darwin/Framework/CHIP/ServerEndpoint/MTRIMDispatch.mm b/src/darwin/Framework/CHIP/ServerEndpoint/MTRIMDispatch.mm
index a1f1f47..a96af0a 100644
--- a/src/darwin/Framework/CHIP/ServerEndpoint/MTRIMDispatch.mm
+++ b/src/darwin/Framework/CHIP/ServerEndpoint/MTRIMDispatch.mm
@@ -39,14 +39,14 @@
     // clusters dont use it.
 }
 
-EmberAfStatus emAfWriteAttributeExternal(EndpointId endpoint, ClusterId cluster, AttributeId attributeID, uint8_t * dataPtr,
+Protocols::InteractionModel::Status emAfWriteAttributeExternal(EndpointId endpoint, ClusterId cluster, AttributeId attributeID, uint8_t * dataPtr,
     EmberAfAttributeType dataType)
 {
     assertChipStackLockedByCurrentThread();
 
     // All of our attributes are handled via AttributeAccessInterface, so this
     // should be unreached.
-    return EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE;
+    return Protocols::InteractionModel::Status::UnsupportedAttribute;
 }
 
 namespace chip {
