zcl-id
An utility for getting ZCL identifiers defined by ZigBee Cluster Library.

Table of Contents
- Overview
- Installation
- Usage
- APIs
- Table of Identifiers
- Contributors
1. Overview
zcl-id is a dictionary of identifiers defined by ZigBee Cluster Library Specification.
2. Installation
$ npm install zcl-id --save
3. Usage
zcl-id provides you with APIs to get the key-value pairs of ZCL identifiers, i.e. profile, cluster, foundation and functional command, attribute and attribute data type. Each method returns an item with properties of 'key'
and 'value'
to show you the identifier in string and in number, respectively.
Here are some quick examples:
var zclId = require('zcl-id')
zclId.profile(260).key;
zclId.profile('HA').value;
zclId.profile('no_such_profile');
zclId.cluster(0).key;
zclId.cluster('genBasic').value;
zclId.cluster('no_such_cluster');
zclId.device(260, 10).key;
zclId.device('HA', 'doorLock').value;
zclId.device('HA', 'no_such_device');
zclId.foundation(2).key;
zclId.foundation('write').value;
zclId.foundation('invalid_command');
zclId.functional(3, 0).key;
zclId.functional('genIdentify', 'identify').value;
zclId.functional('genIdentify', 'invalid_command');
zclId.getCmdRsp(9, 0).key;
zclId.getCmdRsp('genAlarms', 'alarm').value;
zclId.getCmdRsp('genAlarms', 'invalid_command');
zclId.attr(0, 3).key;
zclId.attr('genBasic', 'hwVersion').value;
zclId.attr('genBasic', 'no_such_attr');
zclId.attrType(0, 1).key;
zclId.attrType('genBasic', 'appVersion').value;
zclId.attrType('genBasic', 'no_such_attr');
zclId.dataType(33).key;
zclId.dataType('uint16').value;
zclId.dataType('no_such_datatype');
zclId.dataType(133).key;
zclId.dataType('invalidField').value;
zclId.dataType('no_such_status');
4. APIs
.profile(profId)
Returns the profile identifier.
Arguments:
profId
(String | Number): Profile id, which can be given with a string or a number. Notice that a numbered string will be recognized as a number, e.g. '128' is equal to 128.
Returns:
- (Object | Undefined): Returns an item of
{ key: 'sampleId', value: 1234 }
, otherwise returns undefined
if not found.
Examples:
zclId.profile('HA');
zclId.profile('260');
zclId.profile(260);
zclId.profile('no_such_profile');
.cluster(cId)
Returns the cluster identifier.
Arguments:
cId
(String | Number): Cluster id, which can be given with a string or a number. Notice that a numbered string will be recognized as a number, e.g. '128' is equal to 128.
Returns:
- (Object | Undefined): Returns an item of
{ key: 'sampleId', value: 1234 }
, otherwise returns undefined
if not found.
Examples:
zclId.cluster('genAlarms');
zclId.cluster('9');
zclId.cluster(9);
zclId.cluster('no_such_cluster');
.device(profId, devId)
Returns the device identifier under the specified profile.
Arguments:
profId
(String | Number): Profile id, which can be given with a string or a number. A numbered string like '128' will be recognized as a number 128.devId
(String | Number): Device id, which can be given with a string or a number. A numbered string like '128' will be recognized as a number 128.
Returns:
- (Object | Undefined): Returns an item of
{ key: 'sampleId', value: 1234 }
, otherwise returns undefined
if not found.
Examples:
zclId.device('HA', 'simpleSensor');
zclId.device('260', '12');
zclId.device(260, 12);
zclId.device('no_such_profile', 12);
zclId.device('HA', 'no_such_device');
.foundation(cmdId)
Returns the foundation command identifier.
Arguments:
cmdId
(String | Number): Command id, which can be given with a string or a number. A numbered string like '128' will be recognized as a number 128.
Returns:
- (Object | Undefined): Returns an item of
{ key: 'sampleId', value: 1234 }
, otherwise returns undefined
if not found.
Examples:
zclId.foundation('write');
zclId.foundation('2');
zclId.foundation(2);
zclId.foundation('invalid_cmd');
.functional(cId, cmdId)
Returns the functional command identifier under the specified cluster.
Arguments:
cId
(String | Number): Cluster id, which can be given with a string or a number. A numbered string like '128' will be recognized as a number 128.cmdId
(String | Number): Command id, which can be given with a string or a number. A numbered string like '128' will be recognized as a number 128.
Returns:
- (Object | Undefined): Returns an item of
{ key: 'sampleId', value: 1234 }
, otherwise returns undefined
if not found.
Examples:
zclId.functional('genBasic', 'resetFactDefault');
zclId.functional('0', '0');
zclId.functional(0, 0);
zclId.functional('no_such_cluster', 'resetFactDefault');
zclId.functional('genBasic', 'invalid_cmd');
.getCmdRsp(cId, rspId)
Returns the identifier of functional command response under the specified cluster.
Arguments:
cId
(String | Number): Cluster id, which can be given with a string or a number. A numbered string like '128' will be recognized as a number 128.rspId
(String | Number): Response id, which can be given with a string or a number. A numbered string like '128' will be recognized as a number 128.
Returns:
- (Object | Undefined): Returns an item of
{ key: 'sampleId', value: 1234 }
, otherwise returns undefined
if not found.
Examples:
zclId.getCmdRsp('genAlarms', 'alarm');
zclId.getCmdRsp('9', '0');
zclId.getCmdRsp(9, 0);
zclId.getCmdRsp('no_such_cluster', 'alarm');
zclId.getCmdRsp('genAlarms', 'invalid_cmd');
.attr(cId, attrId)
Returns the attribute identifier under the specified cluster.
Arguments:
cId
(String | Number): Cluster id, which can be given with a string or a number. A numbered string like '128' will be recognized as a number 128.attrId
(String | Number): Attribute id, which can be given with a string or a number. A numbered string like '128' will be recognized as a number 128.
Returns:
- (Object | Undefined): Returns an item of
{ key: 'sampleId', value: 1234 }
, otherwise returns undefined
if not found.
Examples:
zclId.attr('genBasic', 'hwVersion');
zclId.attr('0', '3');
zclId.attr(0, 3);
zclId.attr('no_such_cluster', 'hwVersion');
zclId.attr('genBasic', 'no_such_attr');
.attrType(cId, attrId)
Returns the attribute data type identifier under the specified cluster.
Arguments:
cId
(String | Number): Cluster id, which can be given with a string or a number. A numbered string like '128' will be recognized as a number 128.attrId
(String | Number): Attribute id, which can be given with a string or a number. A numbered string like '128' will be recognized as a number 128.
Returns:
- (Object | Undefined): Returns an item of
{ key: 'sampleId', value: 1234 }
, otherwise returns undefined
if not found.
Examples:
zclId.attrType('genBasic', 'appVersion');
zclId.attrType('0', '1');
zclId.attrType(0, 1);
zclId.attrType('no_such_cluster', 'appVersion');
zclId.attrType('genBasic', 'no_such_attr');
.dataType(type)
Returns the data type identifier.
Arguments:
type
(String | Number): Data type, which can be given with a string or a number. A numbered string like '128' will be recognized as a number 128.
Returns:
- (Object | Undefined): Returns an item of
{ key: 'sampleId', value: 1234 }
, otherwise returns undefined
if not found.
Examples:
zclId.dataType('uint16');
zclId.dataType('33');
zclId.dataType(33);
zclId.dataType('invalid_data_type');
.status(status)
Returns the status identifier.
Arguments:
status
(String | Number): Status, which can be given with a string or a number. A numbered string like '128' will be recognized as a number 128.
Returns:
- (Object | Undefined): Returns an item of
{ key: 'sampleId', value: 1234 }
, otherwise returns undefined
if not found.
Examples:
zclId.status('invalidField');
zclId.status('133');
zclId.status(133);
zclId.status('invalid_status');
5. Table of Identifiers
{
"IPM": 257,
"HA": 260,
"CBA": 261,
"TA": 263,
"PHHC": 264,
"SE": 265
}
{
"genBasic": 0,
"genPowerCfg": 1,
"genDeviceTempCfg": 2,
"genIdentify": 3,
"genGroups": 4,
"genScenes": 5,
"genOnOff": 6,
"genOnOffSwitchCfg": 7,
"genLevelCtrl": 8,
"genAlarms": 9,
"genTime": 10,
"genRssiLocation": 11,
"genAnalogInput": 12,
"genAnalogOutput": 13,
"genAnalogValue": 14,
"genBinaryInput": 15,
"genBinaryOutput": 16,
"genBinaryValue": 17,
"genMultistateInput": 18,
"genMultistateOutput": 19,
"genMultistateValue": 20,
"genCommissioning": 21,
"genPartition": 22,
"genOta": 25,
"genPowerProfile": 26,
"genApplianceCtrl": 27,
"genPollCtrl": 32,
"genGreenPowerProxy": 33,
"closuresShadeCfg": 256,
"closuresDoorLock": 257,
"closuresWindowCovering": 258,
"hvacPumpCfgCtrl": 512,
"hvacThermostat": 513,
"hvacFanCtrl": 514,
"hvacDehumidificationCtrl": 515,
"hvacUserInterfaceCfg": 516,
"lightingColorCtrl": 768,
"lightingBallastCfg": 769,
"msIlluminanceMeasurement": 1024,
"msIlluminanceLevelSensing": 1025,
"msTemperatureMeasurement": 1026,
"msPressureMeasurement": 1027,
"msFlowMeasurement": 1028,
"msRelativeHumidity": 1029,
"msOccupancySensing": 1030,
"ssIasZone": 1280,
"ssIasAce": 1281,
"ssIasWd": 1282,
"piGenericTunnel": 1536,
"piBacnetProtocolTunnel": 1537,
"piAnalogInputReg": 1538,
"piAnalogInputExt": 1539,
"piAnalogOutputReg": 1540,
"piAnalogOutputExt": 1541,
"piAnalogValueReg": 1542,
"piAnalogValueExt": 1543,
"piBinaryInputReg": 1544,
"piBinaryInputExt": 1545,
"piBinaryOutputReg": 1546,
"piBinaryOutputExt": 1547,
"piBinaryValueReg": 1548,
"piBinaryValueExt": 1549,
"piMultistateInputReg": 1550,
"piMultistateInputExt": 1551,
"piMultistateOutputReg": 1552,
"piMultistateOutputExt": 1553,
"piMultistateValueReg": 1554,
"piMultistateValueExt": 1555,
"pi11073ProtocolTunnel": 1556,
"sePrice": 1792,
"seDrlc": 1793,
"seMetering": 1794,
"seMessaging": 1795,
"seTunneling": 1796,
"sePrepayment": 1797,
"seEnergyMgmt": 1798,
"seCalendar": 1799,
"seDeviceMgmt": 1800,
"seEvents": 1801,
"seMduPairing": 1802,
"seKeyEstablishment": 2048,
"haApplianceIdentification": 2816,
"haMeterIdentification": 2817,
"haApplianceEventsAlerts": 2818,
"haApplianceStatistics": 2819,
"haElectricalMeasurement": 2820,
"haDiagnostic": 2821,
"lightLink": 4096,
"manuSpecificCluster": 65535
}
{
"noData": 0,
"data8": 8,
"data16": 9,
"data24": 10,
"data32": 11,
"data40": 12,
"data48": 13,
"data56": 14,
"data64": 15,
"boolean": 16,
"bitmap8": 24,
"bitmap16": 25,
"bitmap24": 26,
"bitmap32": 27,
"bitmap40": 28,
"bitmap48": 29,
"bitmap56": 30,
"bitmap64": 31,
"uint8": 32,
"uint16": 33,
"uint24": 34,
"uint32": 35,
"uint40": 36,
"uint48": 37,
"uint56": 38,
"uint64": 39,
"int8": 40,
"int16": 41,
"int24": 42,
"int32": 43,
"int40": 44,
"int48": 45,
"int56": 46,
"int64": 47,
"enum8": 48,
"enum16": 49,
"semiPrec": 56,
"singlePrec": 57,
"doublePrec": 58,
"octetStr": 65,
"charStr": 66,
"longOctetStr": 67,
"longCharStr": 68,
"array": 72,
"struct": 76,
"set": 80,
"bag": 81,
"tod": 224,
"date": 225,
"utc": 226,
"attrId": 233,
"bacOid": 234,
"ieeeAddr": 240,
"secKey": 241,
"unknown": 255
}
{
"success": 0,
"failure": 1,
"notAuthorized": 126,
"malformedCmd": 128,
"unsupClusterCmd": 129,
"unsupGeneralCmd": 130,
"unsupManuClusterCmd": 131,
"unsupManuGeneralCmd": 132,
"invalidField": 133,
"unsupAttribute": 134,
"invalidValue": 135,
"readOnly": 136,
"insufficientSpace": 137,
"duplicateExists": 138,
"notFound": 139,
"unreportableAttribute": 140,
"invalidDataType": 141,
"invalidSelector": 142,
"writeOnly": 143,
"inconsistentStartupState": 144,
"definedOutOfBand": 145,
"inconsistent": 146,
"actionDenied": 147,
"timeout": 148,
"abort": 149,
"invalidImage": 150,
"waitForData": 151,
"noImageAvailable": 152,
"requireMoreImage": 153
}
6. Contributors