-``BAYESIAN`` This type replicates Home Assistant's `Bayesian sensor <https://www.home-assistant.io/integrations/bayesian/>`__. Based on the observation states, this sensor returns the Bayesian probability of a particular event occurring. The configured ``prior:`` probability is the likelihood that the Bayesian event is true, ignoring all external influences. Every observation has its own ``prob_given_true`` and ``prob_given_false`` parameters. The ``prob_given_true:`` value is the probability that the observation's binary sensor is ``ON`` when the Bayesian event is ``true``. The ``prob_given_false:`` value is the probability that the observation's binary sensor is ``ON`` when the Bayesian event is ``false``. Use an :doc:`/components/binary_sensor/analog_threshold` to convert this sensor's probability to a binary ``ON`` or ``OFF`` by setting an appropriate threshold.
..code-block:: yaml
# Example configuration entry
sensor:
- platform: binary_sensor_map
id: bayesian_prob
name: 'Bayesian Event Probability'
type: bayesian
prior: 0.4
observations:
- binary_sensor: binary_sensor_0
prob_given_true: 0.9
prob_given_false: 0.2
- binary_sensor: binary_sensor_1
prob_given_true: 0.6
prob_given_false: 0.1
binary_sensor:
# If the Bayesian probability is greater than 0.6,
# then predict the event is occuring
- platform: analog_threshold
name: "Bayesian Event Predicted State"
sensor_id: bayesian_prob
threshold: 0.6
# ...
-``GROUP`` Each channel has its own ``value``. The sensor publishes the average value of all active
binary sensors or ``NAN`` if no sensors are active.