Question about bayesian sensor 'above' and 'below'

I’m building up a bayesian sensor to show a light when it’s a great time to go for a walk using outdoor weather observations

I have a question about how ‘above’ and ‘below’ work (for my example let’s just use ‘temperature’)
Say I have the following observations

   - platform: "numeric_state"
      entity_id: "sensor.openweathermap_feels_like_temperature"
      prob_given_true: 0.9
      prob_given_false: 0.15
      above: 65
    - platform: "numeric_state"
      entity_id: "sensor.openweathermap_feels_like_temperature"
      prob_given_true: 0.7
      prob_given_false: 0.15
      above: 75
      below: 85

In the first observation, do I need to specify below: 75, does the second observation override that? or are they cumulative.

So, for example, if the temperature is 80, is the probability 0.8?

Update: Yes, but it’s not that simple.
I found this, which is AWESOME for working on bayesian sensors

If you supply both above and below it will be true and have the assigned true probability when the entity value is in the window between the above and below values.

It will be false and have the assigned false probability when the entity value is outside that window.

1 Like


I just tested that, and (obviously) that’s correct, so in my case, it makes sense to ‘bound’ the observations w/ both above and below.

There’s a good post here which includes an interactive spreadsheet to work out all the observations.