My latest purchase is a Zigbee 3.0 Puck, that controls the on/off (onoff) state, as well as current power consumption(measure_power) and overall consumption (meter_power) (since installation/factory reset).
The device showed up as a generic device, but the values were all wrong for the “meter_power” capability, and completly missing for measure_power.
Anyway - I wanted to use this as a test device for looking into how to create custom drivers.
So i did an interview with the device, and it shows me all the expected properties, so.i can use readAttributes to get them. I can also customize the registerCapability, with a custom config, and then run getCapabilityValue, and see the finished results on screen.
But, this never gets updated, unless i setup a time interval that constantly polls the device myself.
Homey doesnt seem to respect the pollInterval
property (never polls the device), and the device doesnt seem to respect the min/max interval for reporting the attribute back to me.
I also tried with the event listener directly on the cluster
zclNode?.endpoints[1]?.clusters[CLUSTER.METERING.NAME]?.on(
'attr.currentSummationDelivered',
(val) => {
// handle reported attribute value
console.log('Received currentSummationDelivered: ', val);
}
);
and the configureAttributeReporting
await this.configureAttributeReporting([
{
endpointId: 1,
cluster: CLUSTER.METERING,
attributeName: 'instantaneousDemand',
minInterval: 1,
maxInterval: 61,
minChange: 0,
},
{
endpointId: 1,
cluster: CLUSTER.METERING,
attributeName: 'currentSummationDelivered',
minInterval: 1,
maxInterval: 61,
minChange: 0,
},
]).catch((err: any) => this.error('Error: ', err));
Heres a GIST of the interview done:
and the this.getNode()
result:
------------------------------------------
Node: 56414bc7-626c-4a79-a44f-593bca320106
- Receive when idle: true
- Endpoints: 1
-- Clusters:
--- basic
--- identify
--- groups
--- scenes
--- onOff
--- onOffSwitch
--- metering
--- diagnostics
------------------------------------------
undefined
=================
Any pointers as to what i am doing wrong here? How to i get the capabilities updated by the device itself? Without having to set up a setTimeout/setInterval withing the app that polls it every second?