Fix for door contact sensors stuck in open state#192
Open
Fix for door contact sensors stuck in open state#192
Conversation
- Problem: Multi-sensor operations caused sensors to remain stuck open - Root cause: Flawed tamper detection logic interfering with status updates - Solution: Improved both open() and closed() methods with better logic Changes: - open(): Enhanced tamper detection using rapid-sequence timing (0.5s window) - closed(): Always updates status to prevent stuck-open states - Maintains tamper detection while prioritizing actual state changes - More robust handling of simultaneous sensor operations Tested with multiple door sensors in various open/close combinations.
Owner
Could you explain this? Would you be able to confirm which panel and panel version you are using? qolsysgw/docs/qolsys-panel-interactions.md Lines 311 to 320 in 29797da This means that
Is not exactly what I observed. An open sensor being tampered will only send another open message. |
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.
Problem
Door contact sensors get stuck in the "open" state when multiple doors are opened/closed simultaneously. The existing tamper detection logic interferes with normal sensor state updates, causing sensors to remain permanently stuck.
Root Cause Analysis
The issue occurs in the
QolsysSensor.open()andclosed()methods:closed()method fails to update sensor statusComprehensive Solution
Enhanced
open()method:Enhanced
closed()method:Benefits
Testing Performed
Files Changed
apps/qolsysgw/qolsys/sensors.py: Enhancedopen()andclosed()methodsThis comprehensive fix resolves the core sensor state management issues while improving the overall robustness of the sensor handling system.