Hi, I’ve implemented a custom cluster for the device, and I can send commands perfectly fine on the new cluster. Like the setAreaLight command is processed correctly when called on the cluster. I tried removing and readding the device twice.
'use strict';
const { ZCLDataTypes, Cluster } = require('zigbee-clusters');
const ATTRIBUTES = {
chargerStatus: {
id: 0x0000,
type: ZCLDataTypes.enum8({
0x00: 'Idle',
0x01: 'Charging',
0x02: 'Charged',
0x03: 'Fault',
}),
},
...
tagID: { id: 0x000F, type: ZCLDataTypes.string },
...
};
const COMMANDS = {
...
setAreaLight: {
id: 0xC2,
args: {
state: ZCLDataTypes.enum8({
0x00: 'Off',
0x01: 'On',
}),
},
},
...
};
class NewDeviceCluster extends Cluster {
static get ID() {
return 0xF12C;
}
static get NAME() {
return 'newDeviceName';
}
static get ATTRIBUTES() {
return ATTRIBUTES;
}
static get COMMANDS() {
return COMMANDS;
}
}
module.exports = QudoChargerCluster;
I had to add it as a capability like this
{
"type": "boolean",
"title": {"en" : "new device name"},
"units": {"en" : ""},
"getable": true,
"setable": false,
"uiComponent": null,
"uiQuickAction": false,
"icon": "/assets/icon.svg"
}
Calling the cluster like this to see what attributes I could work with…
const attributes = await zclNode.endpoints[1].clusters.newDeviceName.discoverAttributes();
this.log('Attributes:', attributes);
const result = await zclNode.endpoints[1].clusters.newDeviceName.readAttributes([
'chargerStatus',
]).catch((err) => {
this.error(err);
});
But for some reason I just get empty data back. All of these attributes should have read permissions on them.
zigbee-clusters:cluster ep: 1, cl: newDeviceName(61740) send frame ZCLStandardHeader {
frameControl: [],
data: newDeviceName.discoverAttributes { startValue: 0, maxResults: 255 },
cmdId: 12,
trxSequenceNumber: 1
} +1ms
zigbee-clusters:cluster ep: 1, cl: newDeviceName(61740) received frame discoverAttributes.response newDeviceName.discoverAttributes.response {
lastResponse: true,
attributes: []
} +460ms
zigbee-clusters:cluster ep: 1, cl: newDeviceName(61740) discover attributes [] +0ms
2024-06-13T12:54:45.959Z [log] [Homey:665877af2fb1e463cd51143e] [ManagerDrivers] [Driver:qudo] [Device:2ba120f3-5f85-4412-b4dd-435646a9f32a] Attributes: []
zigbee-clusters:cluster ep: 1, cl: newDeviceName(61740) read attributes [ 0 ] +1ms
zigbee-clusters:cluster ep: 1, cl: newDeviceName(61740) send frame ZCLStandardHeader {
frameControl: [],
data: newDeviceName.readAttributes { attributes: [ 0 ] },
cmdId: 0,
trxSequenceNumber: 2
} +0ms
zigbee-clusters:cluster ep: 1, cl: newDeviceName(61740) received frame readAttributesStructured.response newDeviceName.readAttributesStructured.response {
attributes: <Buffer 00 00 86>
} +404ms
zigbee-clusters:cluster ep: 1, cl: newDeviceName(61740) read attributes result { attributes: <Buffer 00 00 86> } +0ms
2024-06-13T12:54:46.363Z [log] [Homey:665877af2fb1e463cd51143e] [ManagerDrivers] [Driver:qudo] [Device:2ba120f3-5f85-4412-b4dd-435646a9f32a] Connector lock state: {}