Technical Report: ZigbeeDevice Initialization Failure for ID Lock/Datek Module (SDK v3)
Overview Issue: ZigbeeDevice class initialization (constructor/onNodeInit) fails silently after successful driver match App: ID Lock Zigbee Integration (GitHub - ArnBdev/idlock-zigbee: Homey Zigbee app for ID Lock) Date: 2025-04-13 16:37:30 UTC Environment: Homey Pro (Early 2023), FW ≥10.x
Environment Details
- Homey: Pro (Early 2023)
- Firmware: ≥10.x
- Development Environment:
- OS: Windows 11 Pro with WSL 2 (Ubuntu 24.04.2 LTS)
- Node.js: v18.20.8 LTS (via NVM)
- Docker: v4.40.0 (Engine v28.0.4)
- Homey CLI: Latest (globally installed in WSL)
- Key Dependencies:
- homey-zigbeedriver: v2.1.5
- zigbee-clusters: Present (peer dependency)
Device Information
- Manufacturer: Datek
- Model: ID Lock 150
- Endpoint 1 Server Clusters: [0, 1, 3, 257]
- receiveWhenIdle: false
- swBuildId: “0.7”
Current Implementation
app.json (relevant section):
JSON
{
"zigbee": {
"manufacturerName": "Datek",
"modelId": ["ID Lock 150", "ID Lock 202"],
"productId": ["ID Lock 150", "ID Lock 202"],
"deviceId": 10,
"profileId": 260,
"endpoints": {
"1": {
"clusters": [0, 1, 3, 257],
"bindings": [1, 257]
}
}
}
}
device.js:
JavaScript
'use strict';
const { debug } = require('zigbee-clusters');
debug(true);
const { ZigbeeDevice, CLUSTER } = require('homey-zigbeedriver');
function zigbeeLockStateToHomeyLockedState(lockState) {
const isLocked = (lockState === 1);
return isLocked;
}
class IdLockZigbeeDeviceInstance extends ZigbeeDevice {
constructor(...args) {
super(...args);
this.log('CONSTRUCTOR CALLED - Device instance created');
}
async onNodeInit({ zclNode }) {
this.log('STEP 1: Starting onNodeInit...');
try {
this.printNode();
this.log(`Device info: Mfr: ${this.getManufacturerName()}, Model: ${this.getModelId()}`);
} catch (error) {
this.error('Initialization error:', error);
}
}
}
module.exports = IdLockZigbeeDeviceInstance;
Issue Description
Symptoms:
- Driver matching works correctly (device is recognized)
- After successful match, no logs appear from:
- Constructor
- onNodeInit
- zigbee-clusters debug output
- Homey mobile app either:
- Hangs on “adding device…” (“takes longer than usual”)
- Adds non-functional device tile
Troubleshooting Steps Taken:
- Environment Verification:
- Clean WSL 2 environment
- Node.js v18.20.8 LTS via NVM
- Fresh npm install with latest compatible dependencies
- Verified zigbee-clusters peer dependency
- Code Simplification:
- Reduced onNodeInit to basic logging
- Removed all active communication calls
- Added extensive debug logging
- Simplified capability registration
- Test Methods:
- homey app run --remote
- homey app run (Docker)
- Both methods fail at the same point
- Debug Attempts:
- Enabled zigbee-clusters debugging
- Monitored Homey System Logs
- Added constructor logging
- Added process-level error handlers
Key Observations:
- Driver match succeeds (verified in Dev Tools)
- No logs from constructor or onNodeInit appear
- No errors in Homey System Logs
- Issue persists across both remote and Docker execution
- Problem occurs before any user code execution
Technical Questions:
- What SDK/platform events should occur between driver match and ZigbeeDevice instantiation?
- Are there known issues with homey-zigbeedriver v2.1.5 and devices reporting receiveWhenIdle: false?
- Could the Zigbee interview process be failing silently due to the device’s specific signature?
- Are there additional debug flags or diagnostics available for the device initialization phase?
Request for Assistance:
- Guidance on additional debugging methods for the initialization phase
- Known issues with similar device signatures
- Possible workarounds or alternative initialization approaches
- SDK team input on the silent failure between driver match and class instantiation
Technical Contact:
- GitHub: @ArnBdev
- App Repository: GitHub - ArnBdev/idlock-zigbee: Homey Zigbee app for ID Lock
Thank you for any assistance in resolving this initialization issue.