Bayesian binary sensor ignores observations

Hi everyone,

I have setup a bayesian sensor (or at least I tried) in order to detect if we are in the bed. My configuration looks like the following:

binary_sensor:       
  - platform: bayesian
    prior: 0.5
    name: Bett
    probability_threshold: 0.85
    observations:
      - entity_id: device_tracker.thomas
        prob_given_true: 0.99
        prob_given_false: 0.4
        platform: state
        to_state: home
      - entity_id: binary_sensor.handy_thomas_laedt_derzeit
        prob_given_true: 0.6
        prob_given_false: 0.5
        platform: state
        to_state: on
      - entity_id: sun.sun
        prob_given_true: 0.9
        platform: state
        to_state: below_horizon
      - entity_id: binary_sensor.tv_wohnzimmer
        prob_given_true: 0.9
        platform: state
        to_state: off
      - entity_id: vacuum.robi
        prob_given_true: 1
        platform: state
        to_state: docked

All the provided entities exist but it seems like the sensor is unable to observe them (e.g. where is the sun observation?) and thus making it’s state always to “on”:

image

It seems like I am missing something very important. Could someone enlighten me?

Thank you very much in advance.

Thomas

Could it be, that only the “most important”/last observation is reported?

Maybe, but when

  • the device tracker says my phone state is not “home”
  • the binary sensor says my phone is not charging
  • the sun is not below the horizon
  • the TV in the living room (binary_sensor.tv_wohnzimmer) is shut on

the sensor keeps on. This is strange and I don’t know how to debug the bayesian platform.

Never have used the Bayesian sensor, but from the integration description and your configuration, that would be the expected result.

Sorry, my mind was elsewhere. You are right. I have edited my last post. The problem is that the sensor is always on and never off.

Now its night and my sensor is ON:

I really don’t understand this… The fact that the TV is still on is ignored by the sensor :frowning:

Some more input. The following binary sensor is enabled:

image

It is also part of the bayesian sensor observations (I also modified my sensor a little bit):

image

How can it not be a part of the bayesion observations:

image

I’m seeing this same issue now. Specifically with the sun sensor.
Did you solve this?