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

Improvement to W599001 Smoke Alarm #8393

Merged
merged 6 commits into from
Dec 3, 2024
Merged

Improvement to W599001 Smoke Alarm #8393

merged 6 commits into from
Dec 3, 2024

Conversation

mattbyte
Copy link
Contributor

@mattbyte mattbyte commented Nov 28, 2024

Adding support to expose heat alarm and hush mode bringing support closer to parity with that of the manufacturer hub and app. The heat alarm is for detecting fires and will sound the device siren, therefore, it is important that it be exposed for use. I used fzLocal as the hush bit is appears to be manufacturer specific (not specified in ZCL).

@@ -565,6 +565,26 @@ const fzLocal = {
return ret;
},
} satisfies Fz.Converter,
ias_smoke_alarm_1_heat_alarm_2_with_hush: {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you extend and use:

export function iasZoneAlarm(args: IasArgs): ModernExtend {
instead?

Example usage:

iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}),

Copy link
Contributor Author

@mattbyte mattbyte Nov 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in make a local version of the iasZoneAlarm modern extend that can do the hush mode bit decode or add the functionality to modernExtend.ts?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the functionality to modernExtend.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, done! Have tested and it correctly configures the reporting and binding as before. Only slight negative is no ability to tell the user that the second alarm is heat while the first is smoke.

image

One option would be to add a new argument maybe called secondaryZoneType?

export interface IasArgs {
zoneType: iasZoneType;
zoneAttributes: iasZoneAttribute[];
alarmTimeout?: boolean;
zoneStatusReporting?: boolean;
description?: string;
}

I think it is also acceptable as is, at least both alarms are exposed.

@@ -1574,6 +1576,9 @@ export function iasZoneAlarm(args: IasArgs): ModernExtend {
if (args.zoneAttributes.includes('battery_defect')) {
payload = {battery_defect: (zoneStatus & (1 << 9)) > 0, ...payload};
}
if (args.zoneAttributes.includes('hush')) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reliase now that this option is device specific, therefore it cannot be put directly here. I think we should allow passing custom attributes to iasZoneAlarm instead.

@mattbyte
Copy link
Contributor Author

mattbyte commented Dec 2, 2024

Have had a go at implementing passing of custom (manufacturer) zone attributes to iasZoneAlarm. Not yet fully tested as I wanted to confirm I'm on the right track first. Based on the binary modern extend of course.

@Koenkk Koenkk merged commit 098daba into Koenkk:master Dec 3, 2024
2 checks passed
@Koenkk
Copy link
Owner

Koenkk commented Dec 3, 2024

Well done, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants