Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develco MOSZB-153: Fix illuminance reporting & unlock LED, timeout control #8223

Merged
merged 3 commits into from
Oct 31, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions src/devices/develco.ts
Original file line number Diff line number Diff line change
Expand Up @@ -684,10 +684,8 @@ const definitions: DefinitionWithExtend[] = [
toZigbee: [develco.tz.led_control, develco.tz.ias_occupancy_timeout],
exposes: (device, options) => {
const dynExposes = [];
if (Number(device?.softwareBuildID?.split('.')[0]) >= 3) {
if (device && device.softwareBuildID && Number(device.softwareBuildID.split('.')[0]) >= 2) {
dynExposes.push(e.numeric('occupancy_timeout', ea.ALL).withUnit('s').withValueMin(5).withValueMax(65535));
}
if (Number(device?.softwareBuildID?.split('.')[0]) >= 4) {
dynExposes.push(
e.enum('led_control', ea.ALL, ['off', 'fault_only', 'motion_only', 'both']).withDescription('Control LED indicator usage.'),
);
Expand All @@ -703,16 +701,21 @@ const definitions: DefinitionWithExtend[] = [
develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(),
develcoModernExtend.readGenBasicPrimaryVersions(),
develcoModernExtend.temperature(),
illuminance(),
battery(),
iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'battery_low', 'tamper']}),
illuminance({reporting: {min: 60, max: 3600, change: 500}}),
battery({
voltageToPercentage: {min: 2500, max: 3000},
percentage: true,
voltage: true,
lowStatus: false,
voltageReporting: true,
percentageReporting: false,
}),
iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1']}),
],
configure: async (device, coordinatorEndpoint) => {
const endpoint35 = device.getEndpoint(35);
if (Number(device?.softwareBuildID?.split('.')[0]) >= 3) {
if (device && device.softwareBuildID && Number(device.softwareBuildID.split('.')[0]) >= 2) {
const endpoint35 = device.getEndpoint(35);
await endpoint35.read('ssIasZone', ['develcoAlarmOffDelay'], manufacturerOptions);
}
if (Number(device?.softwareBuildID?.split('.')[0]) >= 4) {
await endpoint35.read('genBasic', ['develcoLedControl'], manufacturerOptions);
}
},
Expand Down
Loading