// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

enum AreaTypeTag : enum8 {
  kAisle = 0;
  kAttic = 1;
  kBackDoor = 2;
  kBackYard = 3;
  kBalcony = 4;
  kBallroom = 5;
  kBathroom = 6;
  kBedroom = 7;
  kBorder = 8;
  kBoxroom = 9;
  kBreakfastRoom = 10;
  kCarport = 11;
  kCellar = 12;
  kCloakroom = 13;
  kCloset = 14;
  kConservatory = 15;
  kCorridor = 16;
  kCraftRoom = 17;
  kCupboard = 18;
  kDeck = 19;
  kDen = 20;
  kDining = 21;
  kDrawingRoom = 22;
  kDressingRoom = 23;
  kDriveway = 24;
  kElevator = 25;
  kEnsuite = 26;
  kEntrance = 27;
  kEntryway = 28;
  kFamilyRoom = 29;
  kFoyer = 30;
  kFrontDoor = 31;
  kFrontYard = 32;
  kGameRoom = 33;
  kGarage = 34;
  kGarageDoor = 35;
  kGarden = 36;
  kGardenDoor = 37;
  kGuestBathroom = 38;
  kGuestBedroom = 39;
  kGuestRoom = 41;
  kGym = 42;
  kHallway = 43;
  kHearthRoom = 44;
  kKidsRoom = 45;
  kKidsBedroom = 46;
  kKitchen = 47;
  kLaundryRoom = 49;
  kLawn = 50;
  kLibrary = 51;
  kLivingRoom = 52;
  kLounge = 53;
  kMediaTVRoom = 54 [spec_name = "Media/TV Room"];
  kMudRoom = 55;
  kMusicRoom = 56;
  kNursery = 57;
  kOffice = 58;
  kOutdoorKitchen = 59;
  kOutside = 60;
  kPantry = 61;
  kParkingLot = 62;
  kParlor = 63;
  kPatio = 64;
  kPlayRoom = 65;
  kPoolRoom = 66;
  kPorch = 67;
  kPrimaryBathroom = 68;
  kPrimaryBedroom = 69;
  kRamp = 70;
  kReceptionRoom = 71;
  kRecreationRoom = 72;
  kRoof = 74;
  kSauna = 75;
  kScullery = 76;
  kSewingRoom = 77;
  kShed = 78;
  kSideDoor = 79;
  kSideYard = 80;
  kSittingRoom = 81;
  kSnug = 82;
  kSpa = 83;
  kStaircase = 84;
  kSteamRoom = 85;
  kStorageRoom = 86;
  kStudio = 87;
  kStudy = 88;
  kSunRoom = 89;
  kSwimmingPool = 90;
  kTerrace = 91;
  kUtilityRoom = 92;
  kWard = 93;
  kWorkshop = 94;
  kToilet = 95;
}

enum AtomicRequestTypeEnum : enum8 {
  kBeginWrite = 0;
  kCommitWrite = 1;
  kRollbackWrite = 2;
}

enum LandmarkTag : enum8 {
  kAirConditioner = 0;
  kAirPurifier = 1;
  kBackDoor = 2;
  kBarStool = 3;
  kBathMat = 4;
  kBathtub = 5;
  kBed = 6;
  kBookshelf = 7;
  kChair = 8;
  kChristmasTree = 9;
  kCoatRack = 10;
  kCoffeeTable = 11;
  kCookingRange = 12;
  kCouch = 13;
  kCountertop = 14;
  kCradle = 15;
  kCrib = 16;
  kDesk = 17;
  kDiningTable = 18;
  kDishwasher = 19;
  kDoor = 20;
  kDresser = 21;
  kLaundryDryer = 22;
  kFan = 23;
  kFireplace = 24;
  kFreezer = 25;
  kFrontDoor = 26;
  kHighChair = 27;
  kKitchenIsland = 28;
  kLamp = 29;
  kLitterBox = 30;
  kMirror = 31;
  kNightstand = 32;
  kOven = 33;
  kPetBed = 34;
  kPetBowl = 35;
  kPetCrate = 36;
  kRefrigerator = 37;
  kScratchingPost = 38;
  kShoeRack = 39;
  kShower = 40;
  kSideDoor = 41;
  kSink = 42;
  kSofa = 43;
  kStove = 44;
  kTable = 45;
  kToilet = 46;
  kTrashCan = 47;
  kLaundryWasher = 48;
  kWindow = 49;
  kWineCooler = 50;
}

enum LocationTag : enum8 {
  kIndoor = 0;
  kOutdoor = 1;
  kInside = 2;
  kOutside = 3;
}

enum MeasurementTypeEnum : enum16 {
  kUnspecified = 0;
  kVoltage = 1;
  kActiveCurrent = 2;
  kReactiveCurrent = 3;
  kApparentCurrent = 4;
  kActivePower = 5;
  kReactivePower = 6;
  kApparentPower = 7;
  kRMSVoltage = 8;
  kRMSCurrent = 9;
  kRMSPower = 10;
  kFrequency = 11;
  kPowerFactor = 12;
  kNeutralCurrent = 13;
  kElectricalEnergy = 14;
  kReactiveEnergy = 15;
  kApparentEnergy = 16;
  kSoilMoisture = 17;
}

enum PositionTag : enum8 {
  kLeft = 0;
  kRight = 1;
  kTop = 2;
  kBottom = 3;
  kMiddle = 4;
  kRow = 5;
  kColumn = 6;
}

enum PowerThresholdSourceEnum : enum8 {
  kContract = 0;
  kRegulator = 1;
  kEquipment = 2;
}

enum RelativePositionTag : enum8 {
  kUnder = 0;
  kNextTo = 1;
  kAround = 2;
  kOn = 3;
  kAbove = 4;
  kFrontOf = 5;
  kBehind = 6;
}

enum StreamUsageEnum : enum8 {
  kInternal = 0;
  kRecording = 1;
  kAnalysis = 2;
  kLiveView = 3;
}

enum TariffPriceTypeEnum : enum8 {
  kStandard = 0;
  kCritical = 1;
  kVirtual = 2;
  kIncentive = 3;
  kIncentiveSignal = 4;
}

enum TariffUnitEnum : enum8 {
  kKWh = 0;
  kKVAh = 1;
}

enum TestGlobalEnum : enum8 {
  kSomeValue = 0;
  kSomeOtherValue = 1;
  kFinalValue = 2;
}

enum ThreeLevelAutoEnum : enum8 {
  kAuto = 0;
  kLow = 1;
  kMedium = 2;
  kHigh = 3;
}

enum WebRTCEndReasonEnum : enum8 {
  kIceFailed = 0;
  kIceTimeout = 1;
  kUserHangup = 2;
  kUserBusy = 3;
  kReplaced = 4;
  kNoUserMedia = 5;
  kInviteTimeout = 6;
  kAnsweredElsewhere = 7;
  kOutOfResources = 8;
  kMediaTimeout = 9;
  kLowPower = 10;
  kUnknownReason = 11;
}

bitmap TestGlobalBitmap : bitmap32 {
  kFirstBit = 0x1;
  kSecondBit = 0x2;
}

struct CurrencyStruct {
  int16u currency = 0;
  int8u decimalPoints = 1;
}

struct PriceStruct {
  money amount = 0;
  CurrencyStruct currency = 1;
}

struct MeasurementAccuracyRangeStruct {
  int64s rangeMin = 0;
  int64s rangeMax = 1;
  optional percent100ths percentMax = 2;
  optional percent100ths percentMin = 3;
  optional percent100ths percentTypical = 4;
  optional int64u fixedMax = 5;
  optional int64u fixedMin = 6;
  optional int64u fixedTypical = 7;
}

struct MeasurementAccuracyStruct {
  MeasurementTypeEnum measurementType = 0;
  boolean measured = 1;
  int64s minMeasuredValue = 2;
  int64s maxMeasuredValue = 3;
  MeasurementAccuracyRangeStruct accuracyRanges[] = 4;
}

struct AtomicAttributeStatusStruct {
  attrib_id attributeID = 0;
  status statusCode = 1;
}

struct ICECandidateStruct {
  char_string candidate = 0;
  nullable char_string SDPMid = 1;
  nullable int16u SDPMLineIndex = 2;
}

struct ICEServerStruct {
  char_string URLs[] = 0;
  optional long_char_string<508> username = 1;
  optional long_char_string<512> credential = 2;
  optional int16u caid = 3;
}

struct LocationDescriptorStruct {
  char_string<128> locationName = 0;
  nullable int16s floorNumber = 1;
  nullable AreaTypeTag areaType = 2;
}

struct PowerThresholdStruct {
  optional power_mw powerThreshold = 0;
  optional power_mva apparentPowerThreshold = 1;
  nullable PowerThresholdSourceEnum powerThresholdSource = 2;
}

struct TestGlobalStruct {
  char_string<128> name = 0;
  nullable TestGlobalBitmap myBitmap = 1;
  optional nullable TestGlobalEnum myEnum = 2;
}

struct ViewportStruct {
  int16u x1 = 0;
  int16u y1 = 1;
  int16u x2 = 2;
  int16u y2 = 3;
}

fabric_scoped struct WebRTCSessionStruct {
  int16u id = 0;
  node_id peerNodeID = 1;
  endpoint_no peerEndpointID = 2;
  StreamUsageEnum streamUsage = 3;
  nullable int16u videoStreamID = 4;
  nullable int16u audioStreamID = 5;
  optional boolean metadataEnabled = 6;
  fabric_idx fabricIndex = 254;
}

/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */
cluster Identify = 3 {
  revision 5;

  enum EffectIdentifierEnum : enum8 {
    kBlink = 0;
    kBreathe = 1;
    kOkay = 2;
    kChannelChange = 11;
    kFinishEffect = 254;
    kStopEffect = 255;
  }

  enum EffectVariantEnum : enum8 {
    kDefault = 0;
  }

  enum IdentifyTypeEnum : enum8 {
    kNone = 0;
    kLightOutput = 1;
    kVisibleIndicator = 2;
    kAudibleBeep = 3;
    kDisplay = 4;
    kActuator = 5;
  }

  attribute int16u identifyTime = 0;
  readonly attribute IdentifyTypeEnum identifyType = 1;
  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;

  request struct IdentifyRequest {
    int16u identifyTime = 0;
  }

  request struct TriggerEffectRequest {
    EffectIdentifierEnum effectIdentifier = 0;
    EffectVariantEnum effectVariant = 1;
  }

  /** This command starts or stops the receiving device identifying itself. */
  command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0;
  /** This command allows the support of feedback to the user, such as a certain light effect. */
  command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64;
}

/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */
cluster Descriptor = 29 {
  revision 3;

  bitmap Feature : bitmap32 {
    kTagList = 0x1;
  }

  struct DeviceTypeStruct {
    devtype_id deviceType = 0;
    int16u revision = 1;
  }

  struct SemanticTagStruct {
    nullable vendor_id mfgCode = 0;
    enum8 namespaceID = 1;
    enum8 tag = 2;
    optional nullable char_string<64> label = 3;
  }

  readonly attribute DeviceTypeStruct deviceTypeList[] = 0;
  readonly attribute cluster_id serverList[] = 1;
  readonly attribute cluster_id clientList[] = 2;
  readonly attribute endpoint_no partsList[] = 3;
  readonly attribute optional SemanticTagStruct tagList[] = 4;
  readonly attribute optional char_string<32> endpointUniqueID = 5;
  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;
}

/** The Binding Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for supporting the binding table. */
cluster Binding = 30 {
  revision 1;

  fabric_scoped struct TargetStruct {
    optional node_id node = 1;
    optional group_id group = 2;
    optional endpoint_no endpoint = 3;
    optional cluster_id cluster = 4;
    fabric_idx fabricIndex = 254;
  }

  attribute access(write: manage) TargetStruct binding[] = 0;
  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;
}

/** The Access Control Cluster exposes a data model view of a
      Node's Access Control List (ACL), which codifies the rules used to manage
      and enforce Access Control for the Node's endpoints and their associated
      cluster instances. */
cluster AccessControl = 31 {
  revision 2;

  enum AccessControlEntryAuthModeEnum : enum8 {
    kPASE = 1 [spec_name = "PASE"];
    kCASE = 2 [spec_name = "CASE"];
    kGroup = 3;
  }

  enum AccessControlEntryPrivilegeEnum : enum8 {
    kView = 1;
    kProxyView = 2;
    kOperate = 3;
    kManage = 4;
    kAdminister = 5;
  }

  enum AccessRestrictionTypeEnum : enum8 {
    kAttributeAccessForbidden = 0;
    kAttributeWriteForbidden = 1;
    kCommandForbidden = 2;
    kEventForbidden = 3;
  }

  enum ChangeTypeEnum : enum8 {
    kChanged = 0;
    kAdded = 1;
    kRemoved = 2;
  }

  bitmap Feature : bitmap32 {
    kExtension = 0x1;
    kManagedDevice = 0x2;
  }

  struct AccessRestrictionStruct {
    AccessRestrictionTypeEnum type = 0;
    nullable int32u id = 1;
  }

  struct CommissioningAccessRestrictionEntryStruct {
    endpoint_no endpoint = 0;
    cluster_id cluster = 1;
    AccessRestrictionStruct restrictions[] = 2;
  }

  fabric_scoped struct AccessRestrictionEntryStruct {
    fabric_sensitive endpoint_no endpoint = 0;
    fabric_sensitive cluster_id cluster = 1;
    fabric_sensitive AccessRestrictionStruct restrictions[] = 2;
    fabric_idx fabricIndex = 254;
  }

  struct AccessControlTargetStruct {
    nullable cluster_id cluster = 0;
    nullable endpoint_no endpoint = 1;
    nullable devtype_id deviceType = 2;
  }

  fabric_scoped struct AccessControlEntryStruct {
    fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1;
    fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2;
    nullable fabric_sensitive int64u subjects[] = 3;
    nullable fabric_sensitive AccessControlTargetStruct targets[] = 4;
    fabric_idx fabricIndex = 254;
  }

  fabric_scoped struct AccessControlExtensionStruct {
    fabric_sensitive octet_string<128> data = 1;
    fabric_idx fabricIndex = 254;
  }

  fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 {
    nullable node_id adminNodeID = 1;
    nullable int16u adminPasscodeID = 2;
    ChangeTypeEnum changeType = 3;
    nullable AccessControlEntryStruct latestValue = 4;
    fabric_idx fabricIndex = 254;
  }

  fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 {
    nullable node_id adminNodeID = 1;
    nullable int16u adminPasscodeID = 2;
    ChangeTypeEnum changeType = 3;
    nullable AccessControlExtensionStruct latestValue = 4;
    fabric_idx fabricIndex = 254;
  }

  fabric_sensitive info event access(read: administer) FabricRestrictionReviewUpdate = 2 {
    int64u token = 0;
    optional long_char_string instruction = 1;
    optional long_char_string ARLRequestFlowUrl = 2;
    fabric_idx fabricIndex = 254;
  }

  attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0;
  attribute access(read: administer, write: administer) optional AccessControlExtensionStruct extension[] = 1;
  readonly attribute int16u subjectsPerAccessControlEntry = 2;
  readonly attribute int16u targetsPerAccessControlEntry = 3;
  readonly attribute int16u accessControlEntriesPerFabric = 4;
  readonly attribute optional CommissioningAccessRestrictionEntryStruct commissioningARL[] = 5;
  readonly attribute optional AccessRestrictionEntryStruct arl[] = 6;
  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;

  request struct ReviewFabricRestrictionsRequest {
    CommissioningAccessRestrictionEntryStruct arl[] = 0;
  }

  response struct ReviewFabricRestrictionsResponse = 1 {
    int64u token = 0;
  }

  /** This command signals to the service associated with the device vendor that the fabric administrator would like a review of the current restrictions on the accessing fabric. */
  fabric command access(invoke: administer) ReviewFabricRestrictions(ReviewFabricRestrictionsRequest): ReviewFabricRestrictionsResponse = 0;
}

/** This cluster provides attributes and events for determining basic information about Nodes, which supports both
      Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number,
      which apply to the whole Node. Also allows setting user device information such as location. */
cluster BasicInformation = 40 {
  revision 5;

  enum ColorEnum : enum8 {
    kBlack = 0;
    kNavy = 1;
    kGreen = 2;
    kTeal = 3;
    kMaroon = 4;
    kPurple = 5;
    kOlive = 6;
    kGray = 7;
    kBlue = 8;
    kLime = 9;
    kAqua = 10;
    kRed = 11;
    kFuchsia = 12;
    kYellow = 13;
    kWhite = 14;
    kNickel = 15;
    kChrome = 16;
    kBrass = 17;
    kCopper = 18;
    kSilver = 19;
    kGold = 20;
  }

  enum ProductFinishEnum : enum8 {
    kOther = 0;
    kMatte = 1;
    kSatin = 2;
    kPolished = 3;
    kRugged = 4;
    kFabric = 5;
  }

  struct CapabilityMinimaStruct {
    int16u caseSessionsPerFabric = 0;
    int16u subscriptionsPerFabric = 1;
  }

  struct ProductAppearanceStruct {
    ProductFinishEnum finish = 0;
    nullable ColorEnum primaryColor = 1;
  }

  critical event StartUp = 0 {
    int32u softwareVersion = 0;
  }

  critical event ShutDown = 1 {
  }

  info event Leave = 2 {
    fabric_idx fabricIndex = 0;
  }

  info event ReachableChanged = 3 {
    boolean reachableNewValue = 0;
  }

  readonly attribute int16u dataModelRevision = 0;
  readonly attribute char_string<32> vendorName = 1;
  readonly attribute vendor_id vendorID = 2;
  readonly attribute char_string<32> productName = 3;
  readonly attribute int16u productID = 4;
  attribute access(write: manage) char_string<32> nodeLabel = 5;
  attribute access(write: administer) char_string<2> location = 6;
  readonly attribute int16u hardwareVersion = 7;
  readonly attribute char_string<64> hardwareVersionString = 8;
  readonly attribute int32u softwareVersion = 9;
  readonly attribute char_string<64> softwareVersionString = 10;
  readonly attribute optional char_string<16> manufacturingDate = 11;
  readonly attribute optional char_string<32> partNumber = 12;
  readonly attribute optional long_char_string<256> productURL = 13;
  readonly attribute optional char_string<64> productLabel = 14;
  readonly attribute optional char_string<32> serialNumber = 15;
  attribute access(write: manage) optional boolean localConfigDisabled = 16;
  readonly attribute optional boolean reachable = 17;
  readonly attribute char_string<32> uniqueID = 18;
  readonly attribute CapabilityMinimaStruct capabilityMinima = 19;
  readonly attribute optional ProductAppearanceStruct productAppearance = 20;
  readonly attribute int32u specificationVersion = 21;
  readonly attribute int16u maxPathsPerInvoke = 22;
  readonly attribute int32u configurationVersion = 24;
  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;

  command MfgSpecificPing(): DefaultSuccess = 0;
}

/** Provides an interface for providing OTA software updates */
cluster OtaSoftwareUpdateProvider = 41 {
  revision 1; // NOTE: Default/not specifically set

  enum ApplyUpdateActionEnum : enum8 {
    kProceed = 0;
    kAwaitNextAction = 1;
    kDiscontinue = 2;
  }

  enum DownloadProtocolEnum : enum8 {
    kBDXSynchronous = 0;
    kBDXAsynchronous = 1;
    kHTTPS = 2 [spec_name = "HTTPS"];
    kVendorSpecific = 3;
  }

  enum StatusEnum : enum8 {
    kUpdateAvailable = 0;
    kBusy = 1;
    kNotAvailable = 2;
    kDownloadProtocolNotSupported = 3;
  }

  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;

  request struct QueryImageRequest {
    vendor_id vendorID = 0;
    int16u productID = 1;
    int32u softwareVersion = 2;
    DownloadProtocolEnum protocolsSupported[] = 3;
    optional int16u hardwareVersion = 4;
    optional char_string<2> location = 5;
    optional boolean requestorCanConsent = 6;
    optional octet_string<512> metadataForProvider = 7;
  }

  response struct QueryImageResponse = 1 {
    StatusEnum status = 0;
    optional int32u delayedActionTime = 1;
    optional char_string<256> imageURI = 2;
    optional int32u softwareVersion = 3;
    optional char_string<64> softwareVersionString = 4;
    optional octet_string<32> updateToken = 5;
    optional boolean userConsentNeeded = 6;
    optional octet_string<512> metadataForRequestor = 7;
  }

  request struct ApplyUpdateRequestRequest {
    octet_string<32> updateToken = 0;
    int32u newVersion = 1;
  }

  response struct ApplyUpdateResponse = 3 {
    ApplyUpdateActionEnum action = 0;
    int32u delayedActionTime = 1;
  }

  request struct NotifyUpdateAppliedRequest {
    octet_string<32> updateToken = 0;
    int32u softwareVersion = 1;
  }

  /** Determine availability of a new Software Image */
  command QueryImage(QueryImageRequest): QueryImageResponse = 0;
  /** Determine next action to take for a downloaded Software Image */
  command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2;
  /** Notify OTA Provider that an update was applied */
  command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4;
}

/** Provides an interface for downloading and applying OTA software updates */
cluster OtaSoftwareUpdateRequestor = 42 {
  revision 1; // NOTE: Default/not specifically set

  enum AnnouncementReasonEnum : enum8 {
    kSimpleAnnouncement = 0;
    kUpdateAvailable = 1;
    kUrgentUpdateAvailable = 2;
  }

  enum ChangeReasonEnum : enum8 {
    kUnknown = 0;
    kSuccess = 1;
    kFailure = 2;
    kTimeOut = 3;
    kDelayByProvider = 4;
  }

  enum UpdateStateEnum : enum8 {
    kUnknown = 0;
    kIdle = 1;
    kQuerying = 2;
    kDelayedOnQuery = 3;
    kDownloading = 4;
    kApplying = 5;
    kDelayedOnApply = 6;
    kRollingBack = 7;
    kDelayedOnUserConsent = 8;
  }

  fabric_scoped struct ProviderLocation {
    node_id providerNodeID = 1;
    endpoint_no endpoint = 2;
    fabric_idx fabricIndex = 254;
  }

  info event StateTransition = 0 {
    UpdateStateEnum previousState = 0;
    UpdateStateEnum newState = 1;
    ChangeReasonEnum reason = 2;
    nullable int32u targetSoftwareVersion = 3;
  }

  critical event VersionApplied = 1 {
    int32u softwareVersion = 0;
    int16u productID = 1;
  }

  info event DownloadError = 2 {
    int32u softwareVersion = 0;
    int64u bytesDownloaded = 1;
    nullable int8u progressPercent = 2;
    nullable int64s platformCode = 3;
  }

  attribute access(write: administer) ProviderLocation defaultOTAProviders[] = 0;
  readonly attribute boolean updatePossible = 1;
  readonly attribute UpdateStateEnum updateState = 2;
  readonly attribute nullable int8u updateStateProgress = 3;
  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;

  request struct AnnounceOTAProviderRequest {
    node_id providerNodeID = 0;
    vendor_id vendorID = 1;
    AnnouncementReasonEnum announcementReason = 2;
    optional octet_string<512> metadataForNode = 3;
    endpoint_no endpoint = 4;
  }

  /** Announce the presence of an OTA Provider */
  command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0;
}

/** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */
cluster PowerSource = 47 {
  revision 1; // NOTE: Default/not specifically set

  enum BatApprovedChemistryEnum : enum16 {
    kUnspecified = 0;
    kAlkaline = 1;
    kLithiumCarbonFluoride = 2;
    kLithiumChromiumOxide = 3;
    kLithiumCopperOxide = 4;
    kLithiumIronDisulfide = 5;
    kLithiumManganeseDioxide = 6;
    kLithiumThionylChloride = 7;
    kMagnesium = 8;
    kMercuryOxide = 9;
    kNickelOxyhydride = 10;
    kSilverOxide = 11;
    kZincAir = 12;
    kZincCarbon = 13;
    kZincChloride = 14;
    kZincManganeseDioxide = 15;
    kLeadAcid = 16;
    kLithiumCobaltOxide = 17;
    kLithiumIon = 18;
    kLithiumIonPolymer = 19;
    kLithiumIronPhosphate = 20;
    kLithiumSulfur = 21;
    kLithiumTitanate = 22;
    kNickelCadmium = 23;
    kNickelHydrogen = 24;
    kNickelIron = 25;
    kNickelMetalHydride = 26;
    kNickelZinc = 27;
    kSilverZinc = 28;
    kSodiumIon = 29;
    kSodiumSulfur = 30;
    kZincBromide = 31;
    kZincCerium = 32;
  }

  enum BatChargeFaultEnum : enum8 {
    kUnspecified = 0;
    kAmbientTooHot = 1;
    kAmbientTooCold = 2;
    kBatteryTooHot = 3;
    kBatteryTooCold = 4;
    kBatteryAbsent = 5;
    kBatteryOverVoltage = 6;
    kBatteryUnderVoltage = 7;
    kChargerOverVoltage = 8;
    kChargerUnderVoltage = 9;
    kSafetyTimeout = 10;
  }

  enum BatChargeLevelEnum : enum8 {
    kOK = 0 [spec_name = "OK"];
    kWarning = 1;
    kCritical = 2;
  }

  enum BatChargeStateEnum : enum8 {
    kUnknown = 0;
    kIsCharging = 1;
    kIsAtFullCharge = 2;
    kIsNotCharging = 3;
  }

  enum BatCommonDesignationEnum : enum16 {
    kUnspecified = 0;
    kAAA = 1 [spec_name = "AAA"];
    kAA = 2 [spec_name = "AA"];
    kC = 3;
    kD = 4;
    k4v5 = 5;
    k6v0 = 6;
    k9v0 = 7;
    k12AA = 8 [spec_name = "1_2AA"];
    kAAAA = 9 [spec_name = "AAAA"];
    kA = 10;
    kB = 11;
    kF = 12;
    kN = 13;
    kNo6 = 14;
    kSubC = 15;
    kA23 = 16;
    kA27 = 17;
    kBA5800 = 18 [spec_name = "BA5800"];
    kDuplex = 19;
    k4SR44 = 20 [spec_name = "4SR44"];
    k523 = 21;
    k531 = 22;
    k15v0 = 23;
    k22v5 = 24;
    k30v0 = 25;
    k45v0 = 26;
    k67v5 = 27;
    kJ = 28;
    kCR123A = 29 [spec_name = "CR123A"];
    kCR2 = 30 [spec_name = "CR2"];
    k2CR5 = 31 [spec_name = "2CR5"];
    kCRP2 = 32 [spec_name = "CR_P2"];
    kCRV3 = 33 [spec_name = "CR_V3"];
    kSR41 = 34 [spec_name = "SR41"];
    kSR43 = 35 [spec_name = "SR43"];
    kSR44 = 36 [spec_name = "SR44"];
    kSR45 = 37 [spec_name = "SR45"];
    kSR48 = 38 [spec_name = "SR48"];
    kSR54 = 39 [spec_name = "SR54"];
    kSR55 = 40 [spec_name = "SR55"];
    kSR57 = 41 [spec_name = "SR57"];
    kSR58 = 42 [spec_name = "SR58"];
    kSR59 = 43 [spec_name = "SR59"];
    kSR60 = 44 [spec_name = "SR60"];
    kSR63 = 45 [spec_name = "SR63"];
    kSR64 = 46 [spec_name = "SR64"];
    kSR65 = 47 [spec_name = "SR65"];
    kSR66 = 48 [spec_name = "SR66"];
    kSR67 = 49 [spec_name = "SR67"];
    kSR68 = 50 [spec_name = "SR68"];
    kSR69 = 51 [spec_name = "SR69"];
    kSR516 = 52 [spec_name = "SR516"];
    kSR731 = 53 [spec_name = "SR731"];
    kSR712 = 54 [spec_name = "SR712"];
    kLR932 = 55 [spec_name = "LR932"];
    kA5 = 56;
    kA10 = 57;
    kA13 = 58;
    kA312 = 59;
    kA675 = 60;
    kAC41E = 61 [spec_name = "AC41E"];
    k10180 = 62;
    k10280 = 63;
    k10440 = 64;
    k14250 = 65;
    k14430 = 66;
    k14500 = 67;
    k14650 = 68;
    k15270 = 69;
    k16340 = 70;
    kRCR123A = 71 [spec_name = "RCR123A"];
    k17500 = 72;
    k17670 = 73;
    k18350 = 74;
    k18500 = 75;
    k18650 = 76;
    k19670 = 77;
    k25500 = 78;
    k26650 = 79;
    k32600 = 80;
  }

  enum BatFaultEnum : enum8 {
    kUnspecified = 0;
    kOverTemp = 1;
    kUnderTemp = 2;
  }

  enum BatReplaceabilityEnum : enum8 {
    kUnspecified = 0;
    kNotReplaceable = 1;
    kUserReplaceable = 2;
    kFactoryReplaceable = 3;
  }

  enum PowerSourceStatusEnum : enum8 {
    kUnspecified = 0;
    kActive = 1;
    kStandby = 2;
    kUnavailable = 3;
  }

  enum WiredCurrentTypeEnum : enum8 {
    kAC = 0 [spec_name = "AC"];
    kDC = 1 [spec_name = "DC"];
  }

  enum WiredFaultEnum : enum8 {
    kUnspecified = 0;
    kOverVoltage = 1;
    kUnderVoltage = 2;
  }

  bitmap Feature : bitmap32 {
    kWired = 0x1;
    kBattery = 0x2;
    kRechargeable = 0x4;
    kReplaceable = 0x8;
  }

  struct BatChargeFaultChangeType {
    BatChargeFaultEnum current[] = 0;
    BatChargeFaultEnum previous[] = 1;
  }

  struct BatFaultChangeType {
    BatFaultEnum current[] = 0;
    BatFaultEnum previous[] = 1;
  }

  struct WiredFaultChangeType {
    WiredFaultEnum current[] = 0;
    WiredFaultEnum previous[] = 1;
  }

  info event WiredFaultChange = 0 {
    WiredFaultEnum current[] = 0;
    WiredFaultEnum previous[] = 1;
  }

  info event BatFaultChange = 1 {
    BatFaultEnum current[] = 0;
    BatFaultEnum previous[] = 1;
  }

  info event BatChargeFaultChange = 2 {
    BatChargeFaultEnum current[] = 0;
    BatChargeFaultEnum previous[] = 1;
  }

  readonly attribute PowerSourceStatusEnum status = 0;
  readonly attribute int8u order = 1;
  readonly attribute char_string<60> description = 2;
  readonly attribute optional nullable int32u wiredAssessedInputVoltage = 3;
  readonly attribute optional nullable int16u wiredAssessedInputFrequency = 4;
  readonly attribute optional WiredCurrentTypeEnum wiredCurrentType = 5;
  readonly attribute optional nullable int32u wiredAssessedCurrent = 6;
  readonly attribute optional int32u wiredNominalVoltage = 7;
  readonly attribute optional int32u wiredMaximumCurrent = 8;
  readonly attribute optional boolean wiredPresent = 9;
  readonly attribute optional WiredFaultEnum activeWiredFaults[] = 10;
  readonly attribute optional nullable int32u batVoltage = 11;
  readonly attribute optional nullable int8u batPercentRemaining = 12;
  readonly attribute optional nullable int32u batTimeRemaining = 13;
  readonly attribute optional BatChargeLevelEnum batChargeLevel = 14;
  readonly attribute optional boolean batReplacementNeeded = 15;
  readonly attribute optional BatReplaceabilityEnum batReplaceability = 16;
  readonly attribute optional boolean batPresent = 17;
  readonly attribute optional BatFaultEnum activeBatFaults[] = 18;
  readonly attribute optional char_string<60> batReplacementDescription = 19;
  readonly attribute optional BatCommonDesignationEnum batCommonDesignation = 20;
  readonly attribute optional char_string<20> batANSIDesignation = 21;
  readonly attribute optional char_string<20> batIECDesignation = 22;
  readonly attribute optional BatApprovedChemistryEnum batApprovedChemistry = 23;
  readonly attribute optional int32u batCapacity = 24;
  readonly attribute optional int8u batQuantity = 25;
  readonly attribute optional BatChargeStateEnum batChargeState = 26;
  readonly attribute optional nullable int32u batTimeToFullCharge = 27;
  readonly attribute optional boolean batFunctionalWhileCharging = 28;
  readonly attribute optional nullable int32u batChargingCurrent = 29;
  readonly attribute optional BatChargeFaultEnum activeBatChargeFaults[] = 30;
  readonly attribute endpoint_no endpointList[] = 31;
  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;
}

/** This cluster is used to manage global aspects of the Commissioning flow. */
cluster GeneralCommissioning = 48 {
  revision 2;

  enum CommissioningErrorEnum : enum8 {
    kOK = 0 [spec_name = "OK"];
    kValueOutsideRange = 1;
    kInvalidAuthentication = 2;
    kNoFailSafe = 3;
    kBusyWithOtherAdmin = 4;
    kRequiredTCNotAccepted = 5;
    kTCAcknowledgementsNotReceived = 6;
    kTCMinVersionNotMet = 7;
  }

  enum NetworkRecoveryReasonEnum : enum8 {
    kUnspecified = 0;
    kAuth = 1;
    kVisibility = 2;
  }

  enum RegulatoryLocationTypeEnum : enum8 {
    kIndoor = 0;
    kOutdoor = 1;
    kIndoorOutdoor = 2;
  }

  bitmap Feature : bitmap32 {
    kTermsAndConditions = 0x1;
    kNetworkRecovery = 0x2;
  }

  struct BasicCommissioningInfo {
    int16u failSafeExpiryLengthSeconds = 0;
    int16u maxCumulativeFailsafeSeconds = 1;
  }

  attribute access(write: administer) int64u breadcrumb = 0;
  readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1;
  readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2;
  readonly attribute RegulatoryLocationTypeEnum locationCapability = 3;
  readonly attribute boolean supportsConcurrentConnection = 4;
  provisional readonly attribute access(read: administer) optional int16u TCAcceptedVersion = 5;
  provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6;
  provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7;
  provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8;
  provisional readonly attribute access(read: administer) optional nullable int32u TCUpdateDeadline = 9;
  provisional readonly attribute access(read: manage) optional octet_string<8> recoveryIdentifier = 10;
  provisional readonly attribute access(read: manage) optional nullable NetworkRecoveryReasonEnum networkRecoveryReason = 11;
  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;

  request struct ArmFailSafeRequest {
    int16u expiryLengthSeconds = 0;
    int64u breadcrumb = 1;
  }

  response struct ArmFailSafeResponse = 1 {
    CommissioningErrorEnum errorCode = 0;
    char_string<128> debugText = 1;
  }

  request struct SetRegulatoryConfigRequest {
    RegulatoryLocationTypeEnum newRegulatoryConfig = 0;
    char_string<2> countryCode = 1;
    int64u breadcrumb = 2;
  }

  response struct SetRegulatoryConfigResponse = 3 {
    CommissioningErrorEnum errorCode = 0;
    char_string debugText = 1;
  }

  response struct CommissioningCompleteResponse = 5 {
    CommissioningErrorEnum errorCode = 0;
    char_string debugText = 1;
  }

  request struct SetTCAcknowledgementsRequest {
    int16u TCVersion = 0;
    bitmap16 TCUserResponse = 1;
  }

  response struct SetTCAcknowledgementsResponse = 7 {
    CommissioningErrorEnum errorCode = 0;
  }

  /** This command is used to arm or disarm the fail-safe timer. */
  command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0;
  /** This command is used to set the regulatory configuration for the device. */
  command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2;
  /** This command is used to indicate that the commissioning process is complete. */
  fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4;
  /** This command is used to set the user acknowledgements received in the Enhanced Setup Flow Terms & Conditions into the node. */
  command access(invoke: administer) SetTCAcknowledgements(SetTCAcknowledgementsRequest): SetTCAcknowledgementsResponse = 6;
}

/** Functionality to configure, enable, disable network credentials and access on a Matter device. */
cluster NetworkCommissioning = 49 {
  revision 2;

  enum NetworkCommissioningStatusEnum : enum8 {
    kSuccess = 0;
    kOutOfRange = 1;
    kBoundsExceeded = 2;
    kNetworkIDNotFound = 3;
    kDuplicateNetworkID = 4;
    kNetworkNotFound = 5;
    kRegulatoryError = 6;
    kAuthFailure = 7;
    kUnsupportedSecurity = 8;
    kOtherConnectionFailure = 9;
    kIPV6Failed = 10;
    kIPBindFailed = 11;
    kUnknownError = 12;
  }

  enum WiFiBandEnum : enum8 {
    k2G4 = 0 [spec_name = "2G4"];
    k3G65 = 1 [spec_name = "3G65"];
    k5G = 2 [spec_name = "5G"];
    k6G = 3 [spec_name = "6G"];
    k60G = 4 [spec_name = "60G"];
    k1G = 5 [spec_name = "1G"];
  }

  bitmap Feature : bitmap32 {
    kWiFiNetworkInterface = 0x1;
    kThreadNetworkInterface = 0x2;
    kEthernetNetworkInterface = 0x4;
    kPerDeviceCredentials = 0x8;
  }

  bitmap ThreadCapabilitiesBitmap : bitmap16 {
    kIsBorderRouterCapable = 0x1;
    kIsRouterCapable = 0x2;
    kIsSleepyEndDeviceCapable = 0x4;
    kIsFullThreadDevice = 0x8;
    kIsSynchronizedSleepyEndDeviceCapable = 0x10;
  }

  bitmap WiFiSecurityBitmap : bitmap8 {
    kUnencrypted = 0x1;
    kWEP = 0x2 [spec_name = "WEP"];
    kWPAPersonal = 0x4 [spec_name = "WPA-PERSONAL"];
    kWPA2Personal = 0x8 [spec_name = "WPA2-PERSONAL"];
    kWPA3Personal = 0x10 [spec_name = "WPA3-PERSONAL"];
    kWPA3MatterPDC = 0x20 [spec_name = "WPA3-Matter-PDC"];
  }

  struct NetworkInfoStruct {
    octet_string<32> networkID = 0;
    boolean connected = 1;
    optional nullable octet_string<20> networkIdentifier = 2;
    optional nullable octet_string<20> clientIdentifier = 3;
  }

  struct ThreadInterfaceScanResultStruct {
    int16u panId = 0;
    int64u extendedPanId = 1;
    char_string<16> networkName = 2;
    int16u channel = 3;
    int8u version = 4;
    octet_string<8> extendedAddress = 5;
    int8s rssi = 6;
    int8u lqi = 7;
  }

  struct WiFiInterfaceScanResultStruct {
    WiFiSecurityBitmap security = 0;
    octet_string<32> ssid = 1;
    octet_string<6> bssid = 2;
    int16u channel = 3;
    WiFiBandEnum wiFiBand = 4;
    int8s rssi = 5;
  }

  readonly attribute access(read: administer) int8u maxNetworks = 0;
  readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1;
  readonly attribute optional int8u scanMaxTimeSeconds = 2;
  readonly attribute optional int8u connectMaxTimeSeconds = 3;
  attribute access(write: administer) boolean interfaceEnabled = 4;
  readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5;
  readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6;
  readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7;
  provisional readonly attribute optional WiFiBandEnum supportedWiFiBands[] = 8;
  provisional readonly attribute optional ThreadCapabilitiesBitmap supportedThreadFeatures = 9;
  provisional readonly attribute optional int16u threadVersion = 10;
  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;

  request struct ScanNetworksRequest {
    optional nullable octet_string<32> ssid = 0;
    optional int64u breadcrumb = 1;
  }

  response struct ScanNetworksResponse = 1 {
    NetworkCommissioningStatusEnum networkingStatus = 0;
    optional char_string debugText = 1;
    optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2;
    optional ThreadInterfaceScanResultStruct threadScanResults[] = 3;
  }

  request struct AddOrUpdateWiFiNetworkRequest {
    octet_string<32> ssid = 0;
    octet_string<64> credentials = 1;
    optional int64u breadcrumb = 2;
    optional octet_string<140> networkIdentity = 3;
    optional octet_string<20> clientIdentifier = 4;
    optional octet_string<32> possessionNonce = 5;
  }

  request struct AddOrUpdateThreadNetworkRequest {
    octet_string<254> operationalDataset = 0;
    optional int64u breadcrumb = 1;
  }

  request struct RemoveNetworkRequest {
    octet_string<32> networkID = 0;
    optional int64u breadcrumb = 1;
  }

  response struct NetworkConfigResponse = 5 {
    NetworkCommissioningStatusEnum networkingStatus = 0;
    optional char_string<512> debugText = 1;
    optional int8u networkIndex = 2;
    optional octet_string<140> clientIdentity = 3;
    optional octet_string<64> possessionSignature = 4;
  }

  request struct ConnectNetworkRequest {
    octet_string<32> networkID = 0;
    optional int64u breadcrumb = 1;
  }

  response struct ConnectNetworkResponse = 7 {
    NetworkCommissioningStatusEnum networkingStatus = 0;
    optional char_string debugText = 1;
    nullable int32s errorValue = 2;
  }

  request struct ReorderNetworkRequest {
    octet_string<32> networkID = 0;
    int8u networkIndex = 1;
    optional int64u breadcrumb = 2;
  }

  request struct QueryIdentityRequest {
    octet_string<20> keyIdentifier = 0;
    optional octet_string<32> possessionNonce = 1;
  }

  response struct QueryIdentityResponse = 10 {
    octet_string<140> identity = 0;
    optional octet_string<64> possessionSignature = 1;
  }

  /** Detemine the set of networks the device sees as available. */
  command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0;
  /** Add or update the credentials for a given Wi-Fi network. */
  command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2;
  /** Add or update the credentials for a given Thread network. */
  command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3;
  /** Remove the definition of a given network (including its credentials). */
  command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4;
  /** Connect to the specified network, using previously-defined credentials. */
  command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6;
  /** Modify the order in which networks will be presented in the Networks attribute. */
  command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8;
  /** Retrieve details about and optionally proof of possession of a network client identity. */
  command access(invoke: administer) QueryIdentity(QueryIdentityRequest): QueryIdentityResponse = 9;
}

/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
cluster GeneralDiagnostics = 51 {
  revision 2;

  enum BootReasonEnum : enum8 {
    kUnspecified = 0;
    kPowerOnReboot = 1;
    kBrownOutReset = 2;
    kSoftwareWatchdogReset = 3;
    kHardwareWatchdogReset = 4;
    kSoftwareUpdateCompleted = 5;
    kSoftwareReset = 6;
  }

  enum HardwareFaultEnum : enum8 {
    kUnspecified = 0;
    kRadio = 1;
    kSensor = 2;
    kResettableOverTemp = 3;
    kNonResettableOverTemp = 4;
    kPowerSource = 5;
    kVisualDisplayFault = 6;
    kAudioOutputFault = 7;
    kUserInterfaceFault = 8;
    kNonVolatileMemoryError = 9;
    kTamperDetected = 10;
  }

  enum InterfaceTypeEnum : enum8 {
    kUnspecified = 0;
    kWiFi = 1;
    kEthernet = 2;
    kCellular = 3;
    kThread = 4;
  }

  enum NetworkFaultEnum : enum8 {
    kUnspecified = 0;
    kHardwareFailure = 1;
    kNetworkJammed = 2;
    kConnectionFailed = 3;
  }

  enum RadioFaultEnum : enum8 {
    kUnspecified = 0;
    kWiFiFault = 1;
    kCellularFault = 2;
    kThreadFault = 3;
    kNFCFault = 4;
    kBLEFault = 5;
    kEthernetFault = 6;
  }

  bitmap Feature : bitmap32 {
    kDataModelTest = 0x1;
  }

  struct NetworkInterface {
    char_string<32> name = 0;
    boolean isOperational = 1;
    nullable boolean offPremiseServicesReachableIPv4 = 2;
    nullable boolean offPremiseServicesReachableIPv6 = 3;
    octet_string<8> hardwareAddress = 4;
    octet_string IPv4Addresses[] = 5;
    octet_string IPv6Addresses[] = 6;
    InterfaceTypeEnum type = 7;
  }

  critical event HardwareFaultChange = 0 {
    HardwareFaultEnum current[] = 0;
    HardwareFaultEnum previous[] = 1;
  }

  critical event RadioFaultChange = 1 {
    RadioFaultEnum current[] = 0;
    RadioFaultEnum previous[] = 1;
  }

  critical event NetworkFaultChange = 2 {
    NetworkFaultEnum current[] = 0;
    NetworkFaultEnum previous[] = 1;
  }

  critical event BootReason = 3 {
    BootReasonEnum bootReason = 0;
  }

  readonly attribute NetworkInterface networkInterfaces[] = 0;
  readonly attribute int16u rebootCount = 1;
  readonly attribute optional int64u upTime = 2;
  readonly attribute optional int32u totalOperationalHours = 3;
  readonly attribute optional BootReasonEnum bootReason = 4;
  readonly attribute optional HardwareFaultEnum activeHardwareFaults[] = 5;
  readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6;
  readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7;
  readonly attribute boolean testEventTriggersEnabled = 8;
  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;

  request struct TestEventTriggerRequest {
    octet_string<16> enableKey = 0;
    int64u eventTrigger = 1;
  }

  response struct TimeSnapshotResponse = 2 {
    systime_ms systemTimeMs = 0;
    nullable posix_ms posixTimeMs = 1;
  }

  request struct PayloadTestRequestRequest {
    octet_string<16> enableKey = 0;
    int8u value = 1;
    int16u count = 2;
  }

  response struct PayloadTestResponse = 4 {
    octet_string payload = 0;
  }

  /** Provide a means for certification tests to trigger some test-plan-specific events */
  command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
  /** Take a snapshot of system time and epoch time. */
  command TimeSnapshot(): TimeSnapshotResponse = 1;
  /** Request a variable length payload response. */
  command access(invoke: manage) PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
}

/** Accurate time is required for a number of reasons, including scheduling, display and validating security materials. */
cluster TimeSynchronization = 56 {
  revision 2;

  enum GranularityEnum : enum8 {
    kNoTimeGranularity = 0;
    kMinutesGranularity = 1;
    kSecondsGranularity = 2;
    kMillisecondsGranularity = 3;
    kMicrosecondsGranularity = 4;
  }

  enum StatusCode : enum8 {
    kTimeNotAccepted = 2;
  }

  enum TimeSourceEnum : enum8 {
    kNone = 0;
    kUnknown = 1;
    kAdmin = 2;
    kNodeTimeCluster = 3;
    kNonMatterSNTP = 4;
    kNonMatterNTP = 5;
    kMatterSNTP = 6;
    kMatterNTP = 7;
    kMixedNTP = 8;
    kNonMatterSNTPNTS = 9;
    kNonMatterNTPNTS = 10;
    kMatterSNTPNTS = 11;
    kMatterNTPNTS = 12;
    kMixedNTPNTS = 13;
    kCloudSource = 14;
    kPTP = 15 [spec_name = "PTP"];
    kGNSS = 16 [spec_name = "GNSS"];
  }

  enum TimeZoneDatabaseEnum : enum8 {
    kFull = 0;
    kPartial = 1;
    kNone = 2;
  }

  bitmap Feature : bitmap32 {
    kTimeZone = 0x1;
    kNTPClient = 0x2;
    kNTPServer = 0x4;
    kTimeSyncClient = 0x8;
  }

  struct DSTOffsetStruct {
    int32s offset = 0;
    epoch_us validStarting = 1;
    nullable epoch_us validUntil = 2;
  }

  struct FabricScopedTrustedTimeSourceStruct {
    node_id nodeID = 0;
    endpoint_no endpoint = 1;
  }

  struct TimeZoneStruct {
    int32s offset = 0;
    epoch_us validAt = 1;
    optional char_string<64> name = 2;
  }

  struct TrustedTimeSourceStruct {
    fabric_idx fabricIndex = 0;
    node_id nodeID = 1;
    endpoint_no endpoint = 2;
  }

  info event DSTTableEmpty = 0 {
  }

  info event DSTStatus = 1 {
    boolean DSTOffsetActive = 0;
  }

  info event TimeZoneStatus = 2 {
    int32s offset = 0;
    optional char_string name = 1;
  }

  info event TimeFailure = 3 {
  }

  info event MissingTrustedTimeSource = 4 {
  }

  readonly attribute nullable epoch_us UTCTime = 0;
  readonly attribute GranularityEnum granularity = 1;
  readonly attribute optional TimeSourceEnum timeSource = 2;
  readonly attribute optional nullable TrustedTimeSourceStruct trustedTimeSource = 3;
  readonly attribute optional nullable char_string<128> defaultNTP = 4;
  readonly attribute optional TimeZoneStruct timeZone[] = 5;
  readonly attribute optional DSTOffsetStruct DSTOffset[] = 6;
  readonly attribute optional nullable epoch_us localTime = 7;
  readonly attribute optional TimeZoneDatabaseEnum timeZoneDatabase = 8;
  readonly attribute optional boolean NTPServerAvailable = 9;
  readonly attribute optional int8u timeZoneListMaxSize = 10;
  readonly attribute optional int8u DSTOffsetListMaxSize = 11;
  readonly attribute optional boolean supportsDNSResolve = 12;
  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;

  request struct SetUTCTimeRequest {
    epoch_us UTCTime = 0;
    GranularityEnum granularity = 1;
    optional TimeSourceEnum timeSource = 2;
  }

  request struct SetTrustedTimeSourceRequest {
    nullable FabricScopedTrustedTimeSourceStruct trustedTimeSource = 0;
  }

  request struct SetTimeZoneRequest {
    TimeZoneStruct timeZone[] = 0;
  }

  response struct SetTimeZoneResponse = 3 {
    boolean DSTOffsetRequired = 0;
  }

  request struct SetDSTOffsetRequest {
    DSTOffsetStruct DSTOffset[] = 0;
  }

  request struct SetDefaultNTPRequest {
    nullable char_string<128> defaultNTP = 0;
  }

  /** This command MAY be issued by Administrator to set the time. */
  command access(invoke: administer) SetUTCTime(SetUTCTimeRequest): DefaultSuccess = 0;
  /** This command SHALL set TrustedTimeSource. */
  fabric command access(invoke: administer) SetTrustedTimeSource(SetTrustedTimeSourceRequest): DefaultSuccess = 1;
  /** This command SHALL set TimeZone. */
  command access(invoke: manage) SetTimeZone(SetTimeZoneRequest): SetTimeZoneResponse = 2;
  /** This command SHALL set DSTOffset. */
  command access(invoke: manage) SetDSTOffset(SetDSTOffsetRequest): DefaultSuccess = 4;
  /** This command is used to set DefaultNTP. */
  command access(invoke: administer) SetDefaultNTP(SetDefaultNTPRequest): DefaultSuccess = 5;
}

/** Commands to trigger a Node to allow a new Administrator to commission it. */
cluster AdministratorCommissioning = 60 {
  revision 1; // NOTE: Default/not specifically set

  enum CommissioningWindowStatusEnum : enum8 {
    kWindowNotOpen = 0;
    kEnhancedWindowOpen = 1;
    kBasicWindowOpen = 2;
  }

  enum StatusCode : enum8 {
    kBusy = 2;
    kPAKEParameterError = 3;
    kWindowNotOpen = 4;
  }

  bitmap Feature : bitmap32 {
    kBasic = 0x1;
  }

  readonly attribute CommissioningWindowStatusEnum windowStatus = 0;
  readonly attribute nullable fabric_idx adminFabricIndex = 1;
  readonly attribute nullable vendor_id adminVendorId = 2;
  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;

  request struct OpenCommissioningWindowRequest {
    int16u commissioningTimeout = 0;
    octet_string PAKEPasscodeVerifier = 1;
    int16u discriminator = 2;
    int32u iterations = 3;
    octet_string<32> salt = 4;
  }

  request struct OpenBasicCommissioningWindowRequest {
    int16u commissioningTimeout = 0;
  }

  /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using enhanced commissioning method. */
  timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
  /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using basic commissioning method, if the node supports it. */
  timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
  /** This command is used by a current Administrator to instruct a Node to revoke any active Open Commissioning Window or Open Basic Commissioning Window command. */
  timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2;
}

/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */
cluster OperationalCredentials = 62 {
  revision 2;

  enum CertificateChainTypeEnum : enum8 {
    kDACCertificate = 1;
    kPAICertificate = 2;
  }

  enum NodeOperationalCertStatusEnum : enum8 {
    kOK = 0 [spec_name = "OK"];
    kInvalidPublicKey = 1;
    kInvalidNodeOpId = 2;
    kInvalidNOC = 3;
    kMissingCsr = 4;
    kTableFull = 5;
    kInvalidAdminSubject = 6;
    kFabricConflict = 9;
    kLabelConflict = 10;
    kInvalidFabricIndex = 11;
  }

  fabric_scoped struct FabricDescriptorStruct {
    octet_string<65> rootPublicKey = 1;
    vendor_id vendorID = 2;
    fabric_id fabricID = 3;
    node_id nodeID = 4;
    char_string<32> label = 5;
    optional octet_string<85> VIDVerificationStatement = 6;
    fabric_idx fabricIndex = 254;
  }

  fabric_scoped struct NOCStruct {
    octet_string<400> noc = 1;
    nullable octet_string<400> icac = 2;
    optional octet_string<400> vvsc = 3;
    fabric_idx fabricIndex = 254;
  }

  readonly attribute access(read: administer) NOCStruct NOCs[] = 0;
  readonly attribute FabricDescriptorStruct fabrics[] = 1;
  readonly attribute int8u supportedFabrics = 2;
  readonly attribute int8u commissionedFabrics = 3;
  readonly attribute octet_string trustedRootCertificates[] = 4;
  readonly attribute int8u currentFabricIndex = 5;
  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;

  request struct AttestationRequestRequest {
    octet_string<32> attestationNonce = 0;
  }

  response struct AttestationResponse = 1 {
    octet_string attestationElements = 0;
    octet_string<64> attestationSignature = 1;
  }

  request struct CertificateChainRequestRequest {
    CertificateChainTypeEnum certificateType = 0;
  }

  response struct CertificateChainResponse = 3 {
    octet_string<600> certificate = 0;
  }

  request struct CSRRequestRequest {
    octet_string<32> CSRNonce = 0;
    optional boolean isForUpdateNOC = 1;
  }

  response struct CSRResponse = 5 {
    octet_string NOCSRElements = 0;
    octet_string<64> attestationSignature = 1;
  }

  request struct AddNOCRequest {
    octet_string<400> NOCValue = 0;
    optional octet_string<400> ICACValue = 1;
    octet_string<16> IPKValue = 2;
    int64u caseAdminSubject = 3;
    vendor_id adminVendorId = 4;
  }

  request struct UpdateNOCRequest {
    octet_string<400> NOCValue = 0;
    optional octet_string<400> ICACValue = 1;
  }

  response struct NOCResponse = 8 {
    NodeOperationalCertStatusEnum statusCode = 0;
    optional fabric_idx fabricIndex = 1;
    optional char_string<128> debugText = 2;
  }

  request struct UpdateFabricLabelRequest {
    char_string<32> label = 0;
  }

  request struct RemoveFabricRequest {
    fabric_idx fabricIndex = 0;
  }

  request struct AddTrustedRootCertificateRequest {
    octet_string<400> rootCACertificate = 0;
  }

  request struct SetVIDVerificationStatementRequest {
    optional vendor_id vendorID = 0;
    optional octet_string<85> VIDVerificationStatement = 1;
    optional octet_string<400> vvsc = 2;
  }

  request struct SignVIDVerificationRequestRequest {
    fabric_idx fabricIndex = 0;
    octet_string<32> clientChallenge = 1;
  }

  response struct SignVIDVerificationResponse = 14 {
    fabric_idx fabricIndex = 0;
    int8u fabricBindingVersion = 1;
    octet_string signature = 2;
  }

  /** Sender is requesting attestation information from the receiver. */
  command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0;
  /** Sender is requesting a device attestation certificate from the receiver. */
  command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2;
  /** Sender is requesting a certificate signing request (CSR) from the receiver. */
  command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4;
  /** Sender is requesting to add the new node operational certificates. */
  command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6;
  /** This command SHALL replace the NOC and optional associated ICAC (if present) scoped under the accessing fabric upon successful validation of all arguments and preconditions. */
  fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7;
  /** This command SHALL be used by an Administrative Node to set the user-visible Label field for a given Fabric, as reflected by entries in the Fabrics attribute. */
  fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9;
  /** This command is used by Administrative Nodes to remove a given fabric index and delete all associated fabric-scoped data. */
  command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10;
  /** This command SHALL add a Trusted Root CA Certificate, provided as its CHIP Certificate representation. */
  command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11;
  /** This command SHALL be used to update any of the accessing fabric's associated VendorID, VidVerificatioNStatement or VVSC (Vendor Verification Signing Certificate). */
  fabric command access(invoke: administer) SetVIDVerificationStatement(SetVIDVerificationStatementRequest): DefaultSuccess = 12;
  /** This command SHALL be used to request that the server authenticate the fabric associated with the FabricIndex given. */
  command access(invoke: administer) SignVIDVerificationRequest(SignVIDVerificationRequestRequest): SignVIDVerificationResponse = 13;
}

/** The Group Key Management Cluster is the mechanism by which group keys are managed. */
cluster GroupKeyManagement = 63 {
  revision 1; // NOTE: Default/not specifically set

  enum GroupKeySecurityPolicyEnum : enum8 {
    kTrustFirst = 0;
    kCacheAndSync = 1;
  }

  bitmap Feature : bitmap32 {
    kCacheAndSync = 0x1;
  }

  fabric_scoped struct GroupInfoMapStruct {
    group_id groupId = 1;
    endpoint_no endpoints[] = 2;
    optional char_string<16> groupName = 3;
    fabric_idx fabricIndex = 254;
  }

  fabric_scoped struct GroupKeyMapStruct {
    group_id groupId = 1;
    int16u groupKeySetID = 2;
    fabric_idx fabricIndex = 254;
  }

  struct GroupKeySetStruct {
    int16u groupKeySetID = 0;
    GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1;
    nullable octet_string<16> epochKey0 = 2;
    nullable epoch_us epochStartTime0 = 3;
    nullable octet_string<16> epochKey1 = 4;
    nullable epoch_us epochStartTime1 = 5;
    nullable octet_string<16> epochKey2 = 6;
    nullable epoch_us epochStartTime2 = 7;
  }

  attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0;
  readonly attribute GroupInfoMapStruct groupTable[] = 1;
  readonly attribute int16u maxGroupsPerFabric = 2;
  readonly attribute int16u maxGroupKeysPerFabric = 3;
  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;

  request struct KeySetWriteRequest {
    GroupKeySetStruct groupKeySet = 0;
  }

  request struct KeySetReadRequest {
    int16u groupKeySetID = 0;
  }

  response struct KeySetReadResponse = 2 {
    GroupKeySetStruct groupKeySet = 0;
  }

  request struct KeySetRemoveRequest {
    int16u groupKeySetID = 0;
  }

  response struct KeySetReadAllIndicesResponse = 5 {
    int16u groupKeySetIDs[] = 0;
  }

  /** Write a new set of keys for the given key set id. */
  fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0;
  /** Read the keys for a given key set id. */
  fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1;
  /** Revoke a Root Key from a Group */
  fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3;
  /** Return the list of Group Key Sets associated with the accessing fabric */
  fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4;
}

/** This cluster provides an interface to a boolean state called StateValue. */
cluster BooleanState = 69 {
  revision 1;

  info event StateChange = 0 {
    boolean stateValue = 0;
  }

  readonly attribute boolean stateValue = 0;
  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;
}

/** This cluster is used to configure a boolean sensor. */
cluster BooleanStateConfiguration = 128 {
  revision 1;

  bitmap AlarmModeBitmap : bitmap8 {
    kVisual = 0x1;
    kAudible = 0x2;
  }

  bitmap Feature : bitmap32 {
    kVisual = 0x1;
    kAudible = 0x2;
    kAlarmSuppress = 0x4;
    kSensitivityLevel = 0x8;
  }

  bitmap SensorFaultBitmap : bitmap16 {
    kGeneralFault = 0x1;
  }

  info event AlarmsStateChanged = 0 {
    AlarmModeBitmap alarmsActive = 0;
    optional AlarmModeBitmap alarmsSuppressed = 1;
  }

  info event SensorFault = 1 {
    SensorFaultBitmap sensorFault = 0;
  }

  attribute optional int8u currentSensitivityLevel = 0;
  readonly attribute optional int8u supportedSensitivityLevels = 1;
  readonly attribute optional int8u defaultSensitivityLevel = 2;
  readonly attribute optional AlarmModeBitmap alarmsActive = 3;
  readonly attribute optional AlarmModeBitmap alarmsSuppressed = 4;
  readonly attribute optional AlarmModeBitmap alarmsEnabled = 5;
  readonly attribute optional AlarmModeBitmap alarmsSupported = 6;
  readonly attribute optional SensorFaultBitmap sensorFault = 7;
  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;

  request struct SuppressAlarmRequest {
    AlarmModeBitmap alarmsToSuppress = 0;
  }

  request struct EnableDisableAlarmRequest {
    AlarmModeBitmap alarmsToEnableDisable = 0;
  }

  /** This command is used to suppress the specified alarm mode. */
  command SuppressAlarm(SuppressAlarmRequest): DefaultSuccess = 0;
  /** This command is used to enable or disable the specified alarm mode. */
  command EnableDisableAlarm(EnableDisableAlarmRequest): DefaultSuccess = 1;
}

/** This cluster is used to configure a valve. */
cluster ValveConfigurationAndControl = 129 {
  revision 2;

  enum StatusCodeEnum : enum8 {
    kFailureDueToFault = 2;
  }

  enum ValveStateEnum : enum8 {
    kClosed = 0;
    kOpen = 1;
    kTransitioning = 2;
  }

  bitmap Feature : bitmap32 {
    kTimeSync = 0x1;
    kLevel = 0x2;
  }

  bitmap ValveFaultBitmap : bitmap16 {
    kGeneralFault = 0x1;
    kBlocked = 0x2;
    kLeaking = 0x4;
    kNotConnected = 0x8;
    kShortCircuit = 0x10;
    kCurrentExceeded = 0x20;
  }

  info event ValveStateChanged = 0 {
    ValveStateEnum valveState = 0;
    optional percent valveLevel = 1;
  }

  info event ValveFault = 1 {
    ValveFaultBitmap valveFault = 0;
  }

  readonly attribute nullable elapsed_s openDuration = 0;
  attribute nullable elapsed_s defaultOpenDuration = 1;
  readonly attribute optional nullable epoch_us autoCloseTime = 2;
  readonly attribute nullable elapsed_s remainingDuration = 3;
  readonly attribute nullable ValveStateEnum currentState = 4;
  readonly attribute nullable ValveStateEnum targetState = 5;
  readonly attribute optional nullable percent currentLevel = 6;
  readonly attribute optional nullable percent targetLevel = 7;
  attribute optional percent defaultOpenLevel = 8;
  readonly attribute optional ValveFaultBitmap valveFault = 9;
  readonly attribute optional int8u levelStep = 10;
  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;

  request struct OpenRequest {
    optional nullable elapsed_s openDuration = 0;
    optional percent targetLevel = 1;
  }

  /** This command is used to set the valve to its open position. */
  command Open(OpenRequest): DefaultSuccess = 0;
  /** This command is used to set the valve to its closed position. */
  command Close(): DefaultSuccess = 1;
}

/** Attributes and commands for configuring the measurement of flow, and reporting flow measurements. */
cluster FlowMeasurement = 1028 {
  revision 3;

  readonly attribute nullable int16u measuredValue = 0;
  readonly attribute nullable int16u minMeasuredValue = 1;
  readonly attribute nullable int16u maxMeasuredValue = 2;
  readonly attribute optional int16u tolerance = 3;
  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;
}

/** cluster for controlling and receiving data of water valves */
cluster WaterValveData = 4294048769 {
  revision 1; // NOTE: Default/not specifically set

  enum ValveSessionOperationEnum : enum8 {
    kDisable = 0;
    kEnable = 1;
    kRemove = 2;
  }

  enum ValveSessionStateEnum : enum8 {
    kDisable = 0;
    kEnable = 1;
    kRunning = 2;
  }

  enum WaterStatsEnum : enum8 {
    kHour = 0;
    kDay = 1;
    kMonth = 2;
    kYear = 3;
  }

  struct ValveSessionStruct {
    int8u weekdays = 0;
    int8u hour = 1;
    int8u minute = 2;
    int32u volume = 3;
    int32u duration = 4;
  }

  struct ValveSessionStateStruct {
    ValveSessionStruct session = 0;
    ValveSessionStateEnum state = 1;
  }

  struct ValveFreezeStateStruct {
    boolean freezed = 0;
    int32u timestamp = 1;
  }

  struct ValveSessionLogStruct {
    int32u begin = 0;
    int32u end = 1;
    int32u volume = 2;
  }

  struct ValveTemperatureStateStruct {
    int16u temperature = 0;
    int32u timestamp = 1;
  }

  struct WaterStatsStruct {
    int32u timestamp = 0;
    int32u volume = 1;
  }

  struct WaterUsageStruct {
    int32u hour = 0;
    int32u today = 1;
    int32u yesterday = 2;
    int32u currentWeek = 3;
    int32u lastWeek = 4;
    int32u currentMonth = 5;
    int32u lastMonth = 6;
    int32u currentYear = 7;
    int32u lastYear = 8;
    int32u timestamp = 9;
  }

  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;
  attribute int32u volume = 4293984256;
  attribute int32u volumeRemaining = 4293984257;
  attribute int16u aquaValue = 4293984258;
  attribute boolean childLock = 4293984259;
  attribute int16s temperature = 4293984260;
  attribute int8s temperatureAdjust = 4293984261;
  attribute int8s freezeThreshold = 4293984262;
  attribute boolean enableIrrigationEffect = 4293984263;

  request struct GetValveSessionLogsRequest {
    int8u page = 0;
  }

  response struct GetValveSessionLogsResponse = 4293984257 {
    int16u total = 0;
    ValveSessionLogStruct data[] = 1;
  }

  request struct SetValveSessionRequest {
    ValveSessionStruct session = 0;
    ValveSessionOperationEnum operation = 1;
  }

  response struct SetValveSessionResponse = 4293984259 {
    int16u total = 0;
    ValveSessionStateStruct data[] = 1;
  }

  response struct GetAllValveSessionResponse = 4293984261 {
    int16u total = 0;
    ValveSessionStateStruct data[] = 1;
  }

  response struct GetWaterUsageResponse = 4293984263 {
    int16u total = 0;
    WaterUsageStruct data[] = 1;
  }

  request struct GetWaterStatsRequest {
    int32u start = 0;
    int32u end = 1;
    WaterStatsEnum type = 2;
  }

  response struct GetWaterStatsResponse = 4293984265 {
    int16u total = 0;
    WaterStatsStruct data[] = 1;
  }

  request struct GetValveFreezeRecordRequest {
    int8u page = 0;
  }

  response struct GetValveFreezeRecordResponse = 4293984267 {
    int16u total = 0;
    ValveFreezeStateStruct data[] = 1;
  }

  request struct GetValveTemperatureRecordRequest {
    int8u page = 0;
  }

  response struct GetValveTemperatureRecordResponse = 4293984269 {
    int16u total = 0;
    ValveTemperatureStateStruct data[] = 1;
  }

  request struct OpenValveWithVolumeRequest {
    int32u volume = 0;
  }

  /** get the valve session logs */
  command GetValveSessionLogs(GetValveSessionLogsRequest): GetValveSessionLogsResponse = 4293984256;
  /** set the valve timer session */
  command SetValveSession(SetValveSessionRequest): SetValveSessionResponse = 4293984258;
  /** get the valve session logs */
  command GetAllValveSession(): GetAllValveSessionResponse = 4293984260;
  /** get the water usage */
  command GetWaterUsage(): GetWaterUsageResponse = 4293984262;
  /** get the water stats */
  command GetWaterStats(GetWaterStatsRequest): GetWaterStatsResponse = 4293984264;
  /** get the valve freeze record */
  command GetValveFreezeRecord(GetValveFreezeRecordRequest): GetValveFreezeRecordResponse = 4293984266;
  /** get the valve temperature record */
  command GetValveTemperatureRecord(GetValveTemperatureRecordRequest): GetValveTemperatureRecordResponse = 4293984268;
  /** open the valve with voluem */
  command OpenValveWithVolume(OpenValveWithVolumeRequest): DefaultSuccess = 4293984270;
}

/** cluster for controlling and receiving data of water valves */
cluster WaterValveData = 4294048769 {
  revision 1; // NOTE: Default/not specifically set

  enum ValveSessionOperationEnum : enum8 {
    kDisable = 0;
    kEnable = 1;
    kRemove = 2;
  }

  enum ValveSessionStateEnum : enum8 {
    kDisable = 0;
    kEnable = 1;
    kRunning = 2;
  }

  enum WaterStatsEnum : enum8 {
    kHour = 0;
    kDay = 1;
    kMonth = 2;
    kYear = 3;
  }

  struct ValveSessionStruct {
    int8u weekdays = 0;
    int8u hour = 1;
    int8u minute = 2;
    int32u volume = 3;
    int32u duration = 4;
  }

  struct ValveSessionStateStruct {
    ValveSessionStruct session = 0;
    ValveSessionStateEnum state = 1;
  }

  struct ValveFreezeStateStruct {
    boolean freezed = 0;
    int32u timestamp = 1;
  }

  struct ValveSessionLogStruct {
    int32u begin = 0;
    int32u end = 1;
    int32u volume = 2;
  }

  struct ValveTemperatureStateStruct {
    int16u temperature = 0;
    int32u timestamp = 1;
  }

  struct WaterStatsStruct {
    int32u timestamp = 0;
    int32u volume = 1;
  }

  struct WaterUsageStruct {
    int32u hour = 0;
    int32u today = 1;
    int32u yesterday = 2;
    int32u currentWeek = 3;
    int32u lastWeek = 4;
    int32u currentMonth = 5;
    int32u lastMonth = 6;
    int32u currentYear = 7;
    int32u lastYear = 8;
    int32u timestamp = 9;
  }

  readonly attribute command_id generatedCommandList[] = 65528;
  readonly attribute command_id acceptedCommandList[] = 65529;
  readonly attribute attrib_id attributeList[] = 65531;
  readonly attribute bitmap32 featureMap = 65532;
  readonly attribute int16u clusterRevision = 65533;
  attribute int32u volume = 4293984256;
  attribute int32u volumeRemaining = 4293984257;
  attribute int16u aquaValue = 4293984258;
  attribute boolean childLock = 4293984259;
  attribute int16s temperature = 4293984260;
  attribute int8s temperatureAdjust = 4293984261;
  attribute int8s freezeThreshold = 4293984262;
  attribute boolean enableIrrigationEffect = 4293984263;

  request struct GetValveSessionLogsRequest {
    int8u page = 0;
  }

  response struct GetValveSessionLogsResponse = 4293984257 {
    int16u total = 0;
    ValveSessionLogStruct data[] = 1;
  }

  request struct SetValveSessionRequest {
    ValveSessionStruct session = 0;
    ValveSessionOperationEnum operation = 1;
  }

  response struct SetValveSessionResponse = 4293984259 {
    int16u total = 0;
    ValveSessionStateStruct data[] = 1;
  }

  response struct GetAllValveSessionResponse = 4293984261 {
    int16u total = 0;
    ValveSessionStateStruct data[] = 1;
  }

  response struct GetWaterUsageResponse = 4293984263 {
    int16u total = 0;
    WaterUsageStruct data[] = 1;
  }

  request struct GetWaterStatsRequest {
    int32u start = 0;
    int32u end = 1;
    WaterStatsEnum type = 2;
  }

  response struct GetWaterStatsResponse = 4293984265 {
    int16u total = 0;
    WaterStatsStruct data[] = 1;
  }

  request struct GetValveFreezeRecordRequest {
    int8u page = 0;
  }

  response struct GetValveFreezeRecordResponse = 4293984267 {
    int16u total = 0;
    ValveFreezeStateStruct data[] = 1;
  }

  request struct GetValveTemperatureRecordRequest {
    int8u page = 0;
  }

  response struct GetValveTemperatureRecordResponse = 4293984269 {
    int16u total = 0;
    ValveTemperatureStateStruct data[] = 1;
  }

  request struct OpenValveWithVolumeRequest {
    int32u volume = 0;
  }

  /** get the valve session logs */
  command GetValveSessionLogs(GetValveSessionLogsRequest): GetValveSessionLogsResponse = 4293984256;
  /** set the valve timer session */
  command SetValveSession(SetValveSessionRequest): SetValveSessionResponse = 4293984258;
  /** get the valve session logs */
  command GetAllValveSession(): GetAllValveSessionResponse = 4293984260;
  /** get the water usage */
  command GetWaterUsage(): GetWaterUsageResponse = 4293984262;
  /** get the water stats */
  command GetWaterStats(GetWaterStatsRequest): GetWaterStatsResponse = 4293984264;
  /** get the valve freeze record */
  command GetValveFreezeRecord(GetValveFreezeRecordRequest): GetValveFreezeRecordResponse = 4293984266;
  /** get the valve temperature record */
  command GetValveTemperatureRecord(GetValveTemperatureRecordRequest): GetValveTemperatureRecordResponse = 4293984268;
  /** open the valve with voluem */
  command OpenValveWithVolume(OpenValveWithVolumeRequest): DefaultSuccess = 4293984270;
}

endpoint 0 {
  device type ma_rootdevice = 22, version 3;
  device type ma_otarequestor = 18, version 1;

  binding cluster OtaSoftwareUpdateProvider;

  server cluster Descriptor {
    callback attribute deviceTypeList;
    callback attribute serverList;
    callback attribute clientList;
    callback attribute partsList;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    callback attribute featureMap;
    callback attribute clusterRevision;
  }

  server cluster AccessControl {
    emits event AccessControlEntryChanged;
    emits event AccessControlExtensionChanged;
    callback attribute acl;
    callback attribute extension;
    callback attribute subjectsPerAccessControlEntry;
    callback attribute targetsPerAccessControlEntry;
    callback attribute accessControlEntriesPerFabric;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    callback attribute featureMap;
    callback attribute clusterRevision;
  }

  server cluster BasicInformation {
    emits event StartUp;
    emits event ShutDown;
    emits event Leave;
    callback attribute dataModelRevision;
    callback attribute vendorName;
    callback attribute vendorID;
    callback attribute productName;
    callback attribute productID;
    persist  attribute nodeLabel;
    callback attribute location;
    callback attribute hardwareVersion;
    callback attribute hardwareVersionString;
    callback attribute softwareVersion;
    callback attribute softwareVersionString;
    callback attribute manufacturingDate;
    callback attribute serialNumber;
    callback attribute uniqueID;
    callback attribute capabilityMinima;
    callback attribute specificationVersion;
    callback attribute maxPathsPerInvoke;
    ram      attribute configurationVersion default = 1;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 0;
    ram      attribute clusterRevision default = 4;
  }

  server cluster OtaSoftwareUpdateRequestor {
    emits event StateTransition;
    emits event VersionApplied;
    emits event DownloadError;
    callback attribute defaultOTAProviders;
    ram      attribute updatePossible default = 1;
    ram      attribute updateState default = 0;
    ram      attribute updateStateProgress;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 0;
    ram      attribute clusterRevision default = 1;

    handle command AnnounceOTAProvider;
  }

  server cluster GeneralCommissioning {
    ram      attribute breadcrumb default = 0x0000000000000000;
    callback attribute basicCommissioningInfo;
    callback attribute regulatoryConfig;
    callback attribute locationCapability;
    callback attribute supportsConcurrentConnection;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 0;
    ram      attribute clusterRevision default = 2;

    handle command ArmFailSafe;
    handle command ArmFailSafeResponse;
    handle command SetRegulatoryConfig;
    handle command SetRegulatoryConfigResponse;
    handle command CommissioningComplete;
    handle command CommissioningCompleteResponse;
  }

  server cluster NetworkCommissioning {
    callback attribute maxNetworks;
    callback attribute networks;
    callback attribute scanMaxTimeSeconds;
    callback attribute connectMaxTimeSeconds;
    callback attribute interfaceEnabled;
    callback attribute lastNetworkingStatus;
    callback attribute lastNetworkID;
    callback attribute lastConnectErrorValue;
    callback attribute supportedWiFiBands;
    callback attribute supportedThreadFeatures;
    callback attribute threadVersion;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    callback attribute featureMap;
    callback attribute clusterRevision;

    handle command ScanNetworks;
    handle command ScanNetworksResponse;
    handle command AddOrUpdateWiFiNetwork;
    handle command AddOrUpdateThreadNetwork;
    handle command RemoveNetwork;
    handle command NetworkConfigResponse;
    handle command ConnectNetwork;
    handle command ConnectNetworkResponse;
    handle command ReorderNetwork;
  }

  server cluster GeneralDiagnostics {
    callback attribute networkInterfaces;
    callback attribute rebootCount;
    callback attribute upTime;
    callback attribute totalOperationalHours;
    callback attribute bootReason;
    callback attribute testEventTriggersEnabled default = 0;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    callback attribute featureMap;
    callback attribute clusterRevision;

    handle command TestEventTrigger;
    handle command TimeSnapshot;
    handle command TimeSnapshotResponse;
  }

  server cluster TimeSynchronization {
    callback attribute UTCTime;
    callback attribute granularity;
    ram      attribute timeSource default = 0x00;
    callback attribute trustedTimeSource;
    callback attribute defaultNTP;
    callback attribute timeZone;
    callback attribute DSTOffset;
    callback attribute localTime;
    ram      attribute timeZoneDatabase default = 2;
    callback attribute timeZoneListMaxSize;
    callback attribute DSTOffsetListMaxSize;
    ram      attribute supportsDNSResolve;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 11;
    ram      attribute clusterRevision default = 2;

    handle command SetUTCTime;
    handle command SetTrustedTimeSource;
    handle command SetTimeZone;
    handle command SetTimeZoneResponse;
    handle command SetDSTOffset;
    handle command SetDefaultNTP;
  }

  server cluster AdministratorCommissioning {
    callback attribute windowStatus;
    callback attribute adminFabricIndex;
    callback attribute adminVendorId;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 1;
    callback attribute clusterRevision;

    handle command OpenCommissioningWindow;
    handle command OpenBasicCommissioningWindow;
    handle command RevokeCommissioning;
  }

  server cluster OperationalCredentials {
    callback attribute NOCs;
    callback attribute fabrics;
    callback attribute supportedFabrics;
    callback attribute commissionedFabrics;
    callback attribute trustedRootCertificates;
    callback attribute currentFabricIndex;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 0;
    ram      attribute clusterRevision default = 1;

    handle command AttestationRequest;
    handle command AttestationResponse;
    handle command CertificateChainRequest;
    handle command CertificateChainResponse;
    handle command CSRRequest;
    handle command CSRResponse;
    handle command AddNOC;
    handle command UpdateNOC;
    handle command NOCResponse;
    handle command UpdateFabricLabel;
    handle command RemoveFabric;
    handle command AddTrustedRootCertificate;
    handle command SetVIDVerificationStatement;
    handle command SignVIDVerificationRequest;
    handle command SignVIDVerificationResponse;
  }

  server cluster GroupKeyManagement {
    callback attribute groupKeyMap;
    callback attribute groupTable;
    callback attribute maxGroupsPerFabric;
    callback attribute maxGroupKeysPerFabric;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    callback attribute featureMap;
    callback attribute clusterRevision;

    handle command KeySetWrite;
    handle command KeySetRead;
    handle command KeySetReadResponse;
    handle command KeySetRemove;
    handle command KeySetReadAllIndices;
    handle command KeySetReadAllIndicesResponse;
  }
}
endpoint 1 {
  device type ma_powersource = 17, version 1;
  device type ma_water_valve = 66, version 1;


  server cluster Identify {
    ram      attribute identifyTime default = 0x0;
    ram      attribute identifyType;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 0;
    ram      attribute clusterRevision default = 6;

    handle command Identify;
  }

  server cluster Descriptor {
    callback attribute deviceTypeList;
    callback attribute serverList;
    callback attribute clientList;
    callback attribute partsList;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    callback attribute featureMap;
    callback attribute clusterRevision;
  }

  server cluster Binding {
    callback attribute binding;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 0;
    ram      attribute clusterRevision default = 1;
  }

  server cluster PowerSource {
    ram      attribute status;
    ram      attribute order default = 0;
    ram      attribute description;
    ram      attribute batVoltage;
    ram      attribute batPercentRemaining;
    ram      attribute batChargeLevel;
    ram      attribute batReplacementNeeded;
    ram      attribute batReplaceability default = 2;
    ram      attribute batReplacementDescription default = "CR123A 3V";
    ram      attribute batCommonDesignation default = 29;
    ram      attribute batQuantity default = 1;
    callback attribute endpointList;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 10;
    ram      attribute clusterRevision default = 3;
  }

  server cluster ValveConfigurationAndControl {
    ram      attribute openDuration;
    ram      attribute defaultOpenDuration default = 600;
    ram      attribute autoCloseTime;
    callback attribute remainingDuration;
    ram      attribute currentState;
    ram      attribute targetState;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 1;
    ram      attribute clusterRevision default = 1;

    handle command Open;
    handle command Close;
  }
}
endpoint 2 {
  device type ma_flowsensor = 774, version 2;


  server cluster Identify {
    ram      attribute identifyTime default = 0x0;
    ram      attribute identifyType;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 0;
    ram      attribute clusterRevision default = 6;

    handle command Identify;
    handle command TriggerEffect;
  }

  server cluster Descriptor {
    callback attribute deviceTypeList;
    callback attribute serverList;
    callback attribute clientList;
    callback attribute partsList;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    callback attribute featureMap;
    callback attribute clusterRevision;
  }

  server cluster FlowMeasurement {
    ram      attribute measuredValue;
    ram      attribute minMeasuredValue default = 1;
    ram      attribute maxMeasuredValue default = 50;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 0;
    ram      attribute clusterRevision default = 3;
  }
}
endpoint 3 {
  device type ma_water_freeze_detector = 65, version 1;


  server cluster Identify {
    ram      attribute identifyTime default = 0x0;
    ram      attribute identifyType;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 0;
    ram      attribute clusterRevision default = 6;

    handle command Identify;
  }

  server cluster Descriptor {
    callback attribute deviceTypeList;
    callback attribute serverList;
    callback attribute clientList;
    callback attribute partsList;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    callback attribute featureMap;
    callback attribute clusterRevision;
  }

  server cluster BooleanState {
    ram      attribute stateValue;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 0;
    ram      attribute clusterRevision default = 1;
  }

  server cluster BooleanStateConfiguration {
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 0;
    ram      attribute clusterRevision default = 1;
  }
}
endpoint 4 {
  device type ma_water_leak_detector = 67, version 1;


  server cluster Identify {
    ram      attribute identifyTime default = 0x0;
    ram      attribute identifyType;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 0;
    ram      attribute clusterRevision default = 6;

    handle command Identify;
  }

  server cluster Descriptor {
    callback attribute deviceTypeList;
    callback attribute serverList;
    callback attribute clientList;
    callback attribute partsList;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    callback attribute featureMap;
    callback attribute clusterRevision;
  }

  server cluster BooleanState {
    ram      attribute stateValue;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 0;
    ram      attribute clusterRevision default = 1;
  }

  server cluster BooleanStateConfiguration {
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 0;
    ram      attribute clusterRevision default = 1;
  }
}
endpoint 5 {
  device type water_valve_data_device = 4293984257, version 1;

  binding cluster WaterValveData;

  server cluster Identify {
    ram      attribute identifyTime default = 0x0;
    ram      attribute identifyType;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 0;
    ram      attribute clusterRevision default = 6;

    handle command Identify;
  }

  server cluster Descriptor {
    callback attribute deviceTypeList;
    callback attribute serverList;
    callback attribute clientList;
    callback attribute partsList;
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    callback attribute featureMap;
    callback attribute clusterRevision;
  }

  server cluster WaterValveData {
    callback attribute generatedCommandList;
    callback attribute acceptedCommandList;
    callback attribute attributeList;
    ram      attribute featureMap default = 0;
    ram      attribute clusterRevision default = 1;
    ram      attribute volume default = 0x00;
    ram      attribute volumeRemaining default = 0x00;
    ram      attribute aquaValue default = 0x00;
    ram      attribute childLock default = false;
    ram      attribute temperature default = 0x00;
    ram      attribute temperatureAdjust default = 0x00;
    ram      attribute freezeThreshold default = 0x28;
    ram      attribute enableIrrigationEffect default = true;

    handle command GetValveSessionLogs;
    handle command GetValveSessionLogsResponse;
    handle command SetValveSession;
    handle command SetValveSessionResponse;
    handle command GetAllValveSession;
    handle command GetAllValveSessionResponse;
    handle command GetWaterUsage;
    handle command GetWaterUsageResponse;
    handle command GetWaterStats;
    handle command GetWaterStatsResponse;
    handle command GetValveFreezeRecord;
    handle command GetValveFreezeRecordResponse;
    handle command GetValveTemperatureRecord;
    handle command GetValveTemperatureRecordResponse;
    handle command OpenValveWithVolume;
  }
}


