About
Bayesian is a built-in integration that creates binary sensors from probability calculations. Each sensor starts from a prior, the baseline chance that it is on, and updates that chance from a set of observations. Observations can be based on an entity's state, a numeric range with optional upper and lower bounds, or a template that evaluates to true or false. A probability threshold sets the level above which the sensor shows as on, and a device class can be chosen for it. It works locally, is set up in the UI, and has an action to reload sensors defined in YAML. Repair notices can appear when a YAML configuration needs a manual fix.
Automatic summary of Home Assistant's source code. Something wrong? Get in touch
Supports
Works locally Talks to your devices on your own network. No vendor cloud in between.
Set up in the UI Add it in Settings, Devices and services. Nothing to download.
Updated with Home Assistant Ships and updates with every Home Assistant release.
Setting it up
It is added under Settings, Devices and services, with Add integration.
Add a Bayesian sensor
- Device classChoose the device class you would like the sensor to show as.
- Name
- PriorThe baseline probability the sensor should be 'on', this is usually the percentage of time it is true. For example, for a sensor 'Everyone sleeping' it might be 8 hours a day, 33%.
- Probability thresholdThe probability above which the sensor will show as 'on'. 50% should produce the most accurate result. Use numbers greater than 50% if avoiding false positives is important, or vice-versa.
Add a Bayesian sensor
- AboveOptional - the lower end of the numeric range. Values exactly matching this will not count
- BelowOptional - the upper end of the numeric range. Values exactly matching this will only count if more than one range is configured for the same entity.
- Entity
- NameThis name will be used for to identify this observation for editing in the future.
Add a Bayesian sensor
- Entity
- NameThis name will be used for to identify this observation for editing in the future.
- To stateThe state of the sensor for which the observation will be considered True.
Add a Bayesian sensor
- NameThis name will be used for to identify this observation for editing in the future.
- TemplateA template that evaluates to True will update the prior accordingly, A template that returns False or None will update the prior with inverse probabilities. A template that returns an error will not update probabilities. Results are coerced into being True or False
After setup
- Device class
- Name
- PriorThe baseline probability the sensor should be 'on', this is usually the percentage of time it is true. For example, for a sensor 'Everyone sleeping' it might be 8 hours a day, 33%.
- Probability thresholdThe probability above which the sensor will show as 'on'. 50% should produce the most accurate result. Use numbers greater than 50% if avoiding false positives is important, or vice-versa.
Texts from Home Assistant's source code, Apache License 2.0.
Actions
- ReloadReloads Bayesian sensors from the YAML-configuration.
Troubleshooting
- Repair noticesNotices it can show in Settings, Repairs:Manual YAML fix required for Bayesian, Manual YAML addition required for Bayesian
Shows in Vulpo
Apple Watch.Information
- Installs
- 1.4k sharing analytics
- Connection
- Works locally
- Upkeep
- Part of Home Assistant
- Category
- Helpers, Calculate a value
- Kind
- Built-in integration
- Needs
- Built into Home Assistant
- Domain
bayesian












