BoundCluster

Class which represents a bound cluster, which is a cluster implementation on Homey's side. This should be used for situations where remote nodes send commands to a cluster on Homey. In order to use the bound cluster it must be bound the the node's endpoint (see: Endpoint.bind).

Constructor

BoundCluster

new BoundCluster()

Create a new BoundCluster instance.

Example

const { BoundCluster } = require('zigbee-clusters');

class MyBoundCluster extends BoundCluster {
  toggle() {
    // Do something when node sends `toggle` command to Homey
  }
}

zclNode.endpoints[1].bind('onOff', new MyBoundCluster());

Properties

logId

logId

Returns log id string for this bound cluster.

Methods

discoverAttributes

(async) discoverAttributes(optionsopt): Promise.<DiscoverAttributesResponse>

This method handles an incoming discoverAttributes command send from the remote node to the controller. It assembles the cluster's attributes which are implemented on this bound cluster and returns a response.

Parameters

Name Type Description
options
object <optional>
startValue
number <optional>
default:0
maxResults
number <optional>
default:250
}

Returns

discoverAttributesExtended

(async) discoverAttributesExtended(optionsopt): Promise.<DiscoverAttributesExtendedResponse>

This method handles an incoming discoverAttributesExtended command send from the remote node to the controller. It assembles the cluster's attributes which are implemented on this bound cluster and returns a response.

Parameters

Name Type Description
options
object <optional>
startValue
number <optional>
default:0
maxResults
number <optional>
default:250
}

Returns

discoverCommandsGenerated

(async) discoverCommandsGenerated(optionsopt): Promise.<{commandIds: Array.<number>, lastResponse: boolean}>

This method handles an incoming discoverCommandsGenerated command send from the remote node to the controller. It assembles the cluster's commands which are implemented on this bound cluster (i.e. commands it can send).

Parameters

Name Type Description
options
object <optional>
startValue
number <optional>
default:0
maxResults
number <optional>
default:250
}

Returns

Promise.<{commandIds: Array.<number>, lastResponse: boolean}>

discoverCommandsReceived

(async) discoverCommandsReceived(optionsopt): Promise.<{commandIds: Array.<number>, lastResponse: boolean}>

This method handles an incoming discoverCommandsReceived command send from the remote node to the controller. It assembles the cluster's commands which are implemented on this bound cluster (i.e. commands it can receive) and returns a response to the remote node.

Parameters

Name Type Description
options
object <optional>
startValue
number <optional>
default:0
maxResults
number <optional>
default:250
}

Returns

Promise.<{commandIds: Array.<number>, lastResponse: boolean}>

readAttributes

(async) readAttributes(options): Promise.<{attributes: Buffer}>

This method handles an incoming readAttributes command send from the remote node to the controller. It assembles attribute values by reading this[attr.name] for all supported attributes of this cluster and sends the response to the remote node.

Parameters

Name Type Description
options
object
attributes
Array.<string>
}

Returns

Promise.<{attributes: Buffer}>

writeAttributes

(async) writeAttributes(optionsopt): Promise.<{attributes}>

This method handles an incoming writeAttributes command send from the remote node to the controller. It sets the received attribute values on this[attr.name] and returns a response to the remote node.

Parameters

Name Type Description
options
object <optional>
attributes
Array.<object>
}

Returns

Promise.<{attributes}>