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

fix: Prevent IKEA PARASOLL and BADRING being stuck on a previously reported state after it rapidly changes back and forth. #8174

Conversation

marazmarci
Copy link
Contributor

Credit goes to @legsim for discovering that configuring reporting for the ssIasZone cluster's zoneStatus attribute with minimumReportInterval: 0 fixes a common problem with the PARASOLL and BADRING sensors where their state can become stuck on a previously reported state after it rapidly changes back and forth.

…d state after it rapidly changes back and forth.

Configure reporting with minimumReportInterval=0 for the ssIasZone cluster's zoneStatus attribute.
@marazmarci marazmarci force-pushed the fix/ikea-parasoll-badring-state-stuck-after-rapid-change branch from d55f9f1 to 9f0c9d7 Compare October 23, 2024 12:49
@marazmarci
Copy link
Contributor Author

marazmarci commented Oct 23, 2024

@Koenkk, please add the hacktoberfest-accepted label to the PR. 🙏

@marazmarci marazmarci changed the title Prevent IKEA PARASOLL and BADRING being stuck on a previously reported state after it rapidly changes back and forth. fix: Prevent IKEA PARASOLL and BADRING being stuck on a previously reported state after it rapidly changes back and forth. Oct 23, 2024
@@ -931,6 +932,13 @@ const definitions: DefinitionWithExtend[] = [
battery(),
ikeaOta(),
],
configure: async (device) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This can probably extracted into a modernExtend quirk and added for these 2 devices.

e.g.

export function quirkCheckinInterval(timeout: number | keyof typeof timeLookup): ModernExtend {
const configure: Configure[] = [
async (device, coordinatorEndpoint, definition) => {
device.checkinInterval = typeof timeout == 'number' ? timeout : timeLookup[timeout];
device.save();
},
];
return {configure, isModernExtend: true};
}
is quirk that also adds an addition configure step.

Copy link
Owner

Choose a reason for hiding this comment

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

I think it would be better to add this to the already existing iasZoneAlarm, @marazmarci is this something you could change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Koenkk, I implemented the changes you requested. I'm no TypeScript dev, but I hope it is good and it works.

I didn't yet have time to actually test it, so I'm marking the PR as a draft in the meantime.

Copy link
Owner

Choose a reason for hiding this comment

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

Made some small updates, let me know if this work!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested it, and it worked both for PARASOLL and BADRING! I saw the zoneStatus attribute with the correct endpoint on the Reporting tab.

@marazmarci marazmarci marked this pull request as draft October 25, 2024 18:42
@marazmarci marazmarci marked this pull request as ready for review October 26, 2024 08:09
@Koenkk Koenkk merged commit 94e554b into Koenkk:master Oct 26, 2024
2 checks passed
@Koenkk
Copy link
Owner

Koenkk commented Oct 26, 2024

thanks!

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

Successfully merging this pull request may close these issues.

3 participants