Skip to content

Conversation

@Chris971991
Copy link

@Chris971991 Chris971991 commented Aug 30, 2025

Summary

This PR introduces user-configurable delay settings for bed occupancy detection, allowing independent control over "occupied" and "clear" state transitions with an extended range of 0-300 seconds (5 minutes).

What's Changed

  • ✨ Added configurable "Occupied Delay" and "Clear Delay" for each sensor side (Left/Right)
  • ⏱️ Extended delay range from fixed presets to 0-300 seconds (0-5 minutes)
  • 🎛️ Added "Custom" option to Response Speed selector
  • 📊 Created separate number entities for fine-grained control (0.5s steps)
  • 📝 Added comprehensive documentation

Why This Feature?

Users needed more flexibility than the fixed Fast/Normal/Slow presets to:

  • Prevent false positives when briefly sitting on the bed
  • Prevent false negatives during restless sleep
  • Customize delays based on individual sleep patterns
  • Support advanced automations requiring longer confirmation periods

Key Benefits

  • Flexible Configuration: 0-300 second range (5 minutes max)
  • Independent Control: Separate delays for occupied vs clear states
  • Per-Side Settings: Left and right sensors can have different delays
  • Backward Compatible: Existing modes remain unchanged
  • Persistent Settings: Values survive restarts

Files Modified

  • bed-presence-mk1/sensor.yaml - Core implementation
  • bed-presence-mk1/base.yaml - Added "Custom" response speed
  • bed-presence-mk1.yaml - Added inline documentation

Breaking Changes

None - Fully backward compatible

Testing Checklist

  • YAML validation passes
  • Backward compatibility verified
  • Hardware testing completed

Added "Normal", "Slow", and "Custom" variants for Both sensors
Added "Normal", "Slow", and "Custom" variants for Either sensors
Modified main "Bed Occupied Both" and "Bed Occupied Either" to switch between all modes (Fast/Normal/Slow/Custom)
@stephenpapierski stephenpapierski self-assigned this Nov 6, 2025
@stephenpapierski stephenpapierski added this to the v2.0 milestone Nov 6, 2025
@stephenpapierski stephenpapierski added the enhancement New feature or request label Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants