fix: alarm sensor false-positive when alarm code is 0 - #19
Open
chrisjohnson00 wants to merge 1 commit into
Open
Conversation
The Alarm binary sensor OR'd an unreliable top-level "alarm" API flag with the alarm_code bitfield, so a truthy-but-benign top-level flag could report PROBLEM even when alarm_code (s20) was 0 (no fault). Drop the top-level flag and derive the sensor solely from alarm_code. Fixes SPD13#17
chrisjohnson00
marked this pull request as ready for review
July 17, 2026 01:40
Contributor
Author
|
@SPD13 - ready for review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
alarmAPI flag with thealarm_code(s20) fault bitfield via OR, so a truthy-but-benign top-level flag could report PROBLEM even whenalarm_codewas 0 (no fault).alarm_code != 0, matching how the referencepypentairlibrary treats this same cloud API (no top-levelalarmkey;s20is the authoritative fault code).alarmfield entirely (init, population, debug logging) so it can't be misread again.Fixes #17
Proof of test
I replaced the modified files, locally, and now the alarm sensor shows off, and my dashboard shows "OK"