---
title: "readAttribute(withController:nodeId:endpointId:clusterId:attributeId:params:completion:)"
framework: matter
role: symbol
role_heading: Instance Method
path: "matter/mtrdevicecontrollerserverprotocol/readattribute(withcontroller:nodeid:endpointid:clusterid:attributeid:params:completion:)"
---

# readAttribute(withController:nodeId:endpointId:clusterId:attributeId:params:completion:)

## Declaration

```swift
func readAttribute(withController controller: Any?, nodeId: UInt64, endpointId: NSNumber?, clusterId: NSNumber?, attributeId: NSNumber?, params: [String : Any]?, completion: @escaping @Sendable (Any?, (any Error)?) -> Void)
```

```swift
func readAttribute(withController controller: Any?, nodeId: UInt64, endpointId: NSNumber?, clusterId: NSNumber?, attributeId: NSNumber?, params: [String : Any]?) async throws -> Any
```
