Area Occupancy Detection Documentation¶
Area Occupancy Detection aims to improve occupancy accuracy beyond single motion detectors by considering various environmental factors, device states, and historical data. It starts from what is usual for each area at that hour, learned from your history, and adds weighted evidence from each active sensor to calculate the probability that the area is occupied.

Features¶
Core Features¶
- Probability Calculation: Combines the learned prior with weighted sensor evidence in log-odds to calculate occupancy probability
- Dual-Model Approach: Presence indicators set the probability; environmental support adjusts it at 20% influence
- Historical Learning: Automatically learns from your sensor history to improve accuracy
- Probability Decay: Gradually reduces probability when no activity is detected
- Multiple Sensor Types: Supports motion, media, door, lock, window, cover, appliance, and environmental sensors (temperature, humidity, illuminance, CO2, sound pressure, atmospheric pressure, air quality, VOC, PM2.5, PM10)
- Wasp in Box: Special logic for rooms with single entry/exit points
- Adjacent Areas: Learns transitions between physically-connected rooms to boost neighbouring probabilities and slow decay when the only known exit has been quiet
- All Areas Aggregation: Automatically aggregates occupancy data across all configured areas for whole-home detection
Advanced Features¶
- Activity Detection: Identifies what activity is happening in a room (showering, cooking, watching TV, sleeping, etc.)
- Sleep Presence Detection: Detects when people are sleeping using HA Person entities and phone sleep confidence
- Sensor Likelihoods: Learns how reliable each sensor is for occupancy detection
- Purpose-Based Configuration: Automatic configuration based on room purpose
- Sensor Health Monitoring: Flags stuck, offline, or silently misconfigured sensors through Home Assistant Repairs so degraded occupancy detection doesn't go unnoticed
- Diagnostics Export: One-click JSON snapshot of priors, weights, evidence, decay state, correlations, and health for fast triage and bug reports
User Interface¶
- Services: Available service calls for automation and control
- Entities: Created entities and their attributes
Getting Started¶
Installation¶
- Installation Guide: How to install the integration from the Marketplace (Home Assistant 2026.11+), HACS or manually
Configuration¶
- Configuration Guide: Step-by-step configuration instructions
- Basic Usage: How to use the integration after setup
Key Concepts¶
Probability¶
The integration combines four things into one occupancy probability:
- Prior: Baseline probability of occupancy for this hour and day of the week (learned from history)
- Sensor Evidence: Which configured sensors are active, or fading after being active
- Sensor Strength: How reliable each sensor is (learned from history) and its type's weight
- Result: The prior and each sensor's weighted contribution are added in log-odds (a logistic model), then converted back to a probability. Inactive sensors add nothing rather than counting against occupancy.
See Probability Calculation for the formula and a worked example.
Sensor Types¶
The integration supports multiple sensor types with different default weights:
- Motion Sensors (1.00): Highest reliability, ground truth for occupancy detection
- Sleep (0.90): Very high reliability for overnight occupancy
- Media Devices (0.85): High reliability indicator of active use
- Wasp in Box (0.80): High reliability virtual sensor for single-entry rooms
- Cover Sensors (0.50): Moderate reliability for blinds, shades, shutters, garage doors
- Appliances (0.40): Moderate reliability
- Door Sensors (0.30): Lower reliability, but useful for entry/exit
- Lock Sensors (0.30): Smart locks (e.g. Nuki) — unlocking indicates active entry/exit
- Power Sensors (0.30): Power consumption indicating active device usage
- Window Sensors (0.20): Minimal influence
- Environmental Sensors (0.10): Very low influence (temperature, humidity, illuminance, CO2, sound pressure, atmospheric pressure, air quality, VOC, PM2.5, PM10)
Example Use Cases¶
Living Room¶
- Sensors: Motion sensors, TV, door sensors
- Patterns: High occupancy in evenings, low during work hours
- Automation: Turn on lights when occupied, dim when low probability
Office¶
- Sensors: Motion sensors, computer, door sensors
- Patterns: High occupancy during work hours, low on weekends
- Automation: Turn on/off lights based on occupancy, adjust HVAC
Bathroom¶
- Sensors: Motion sensors, door sensors, humidity; ideally water flow, shower power or mmWave
- Closed-door hold: Maintain occupancy when the door is closed
- See Bathrooms and Showers for keeping a shower occupied
- Automation: Turn on lights when occupied, turn off when unoccupied
Challenges with Basic Motion Sensors¶
- Lights turning off while you're still: If you sit still for too long, a basic motion sensor assumes the room is empty.
- False triggers: A pet walking through might trigger occupancy.
- Limited context: Simple motion doesn't know if you're watching TV, working at a desk, or just passing through.
How Area Occupancy Detection Helps¶
This integration provides enhanced room occupancy detection for Home Assistant by intelligently combining data from multiple sensor inputs. Unlike simple motion sensors, it combines a learned baseline with weighted evidence from environmental cues and device states, leading to more accurate and resilient occupancy detection.
- Increased Accuracy: By fusing data from multiple sensor types (motion, doors, media, etc.), the system gains a much richer understanding of the area's status.
- Probabilistic Approach: Instead of a simple ON/OFF state, it calculates an occupancy probability. You decide how certain the system must be before declaring occupancy.
- Adaptability: The prior probability learning feature analyses how your sensors correlate with actual occupancy, learning which sensors are reliable indicators.
- Reduced False Negatives/Positives: The combination of multi-sensor input, learned probabilities and decay logic significantly reduces incorrect occupancy states.
Key Features¶
- Multi-Sensor Fusion: Combines inputs from motion/occupancy sensors, media players, doors, windows, covers, appliances, power sensors, sleep presence, and environmental sensors (temperature, humidity, illuminance, CO2, sound pressure, atmospheric pressure, air quality, VOC, PM2.5, PM10).
- Probabilistic Model: Calculates the probability of occupancy from the learned prior and the current state of configured sensors, weighted by their learned reliability.
- Prior Probability Learning: Automatically learns how sensor states relate to actual occupancy (using motion sensors as ground truth) over a configurable history period.
- Configurable Weights: Assign weights to different sensor types to influence their impact on the overall probability.
- Probability Decay: Gradually decreases the occupancy probability when sensors indicate inactivity, providing a natural transition to "unoccupied".
- Purpose-Based Decay: Choosing a room purpose automatically sets a decay half life suited to the space.
- Configurable Threshold: Define the probability percentage required to consider the area "occupied".
- Exposed Entities:
- Occupancy Probability Sensor (%) - per area and aggregated "All Areas"
- Occupancy Status Binary Sensor (on/off) - per area and aggregated "All Areas"
- Presence Confidence Sensor (%) - per area and aggregated "All Areas"
- Environmental Confidence Sensor (%) - per area and aggregated "All Areas"
- Prior Probability Sensor (%) - per area and aggregated "All Areas"
- Evidence Sensor - per area only
- Decay Status Sensor (%) - per area and aggregated "All Areas"
- Detected Activity Sensor (enum) - per area only
- Activity Confidence Sensor (%) - per area only
- Sleeping Binary Sensor (on/off) - per area only (when people configured)
- Occupancy Threshold Number Input - per area only
- All Areas Aggregation: Automatically creates aggregated entities across all configured areas for whole-home occupancy detection.
- UI Configuration: Easy setup and management through the Home Assistant UI.
- Manual Prior Update Service: Trigger the prior learning process on demand.
How It Works¶
- Configuration: You select various sensors associated with an area (motion, doors, media players, etc.) and configure parameters like weights and the history period for learning.
- Prior Learning: The integration analyses the history of your selected sensors against all configured motion sensors. It calculates:
- P(Sensor Active | Area Occupied): How likely is a sensor to be active when the area is truly occupied?
- P(Sensor Active | Area Not Occupied): How likely is a sensor to be active when the area is not occupied?
- P(Area Occupied): The baseline (prior) probability of the area being occupied, derived from motion sensor history. These learned probabilities (or defaults if history is insufficient) are stored and used in calculations.
- Real-time Calculation: As your sensor states change, the integration starts from the prior in log-odds and adds one term for each active sensor, sized by its learned reliability and its type's weight.
- Weighted Combination: The sum is converted back to a probability with a sigmoid. Environmental sensors add a smaller, damped adjustment on top.
- Output: The final calculated probability is exposed. If it crosses the configured threshold, the Occupancy Status sensor turns "on".
- Decay: If the probability starts decreasing (fewer active sensors), an exponential decay function gradually lowers the probability over a configured time window, unless new sensor activity pushes it back up.
Common Issues¶
-
No Occupancy Detection:
-
Verify sensors are working correctly
- Check threshold setting
- Ensure sensors are properly configured
-
Adjust sensor weights
-
False Positives:
-
Lower weights for less reliable sensors
- Increase occupancy threshold
- Adjust decay settings
-
Review time-based priors
-
False Negatives:
- Increase weights for reliable sensors
- Lower occupancy threshold
- Add additional sensors
- Check time-based prior patterns
Support¶
- GitHub Issues: Report bugs and request features
- Community Discussion: Ask questions and share experiences
- GitHub Releases: Check for updates and changelog
- Roadmap: See what's planned for each release