Well after playing around with this for a while, I gotta say that I still don’t quite get it. Ha Ha. Makes me realize how much I’ve forgotten over the years.
I don’t have notebook installed to clone, and honesly I cannot even figure out how to do this in excel, and I felt like I was pretty decent at excel before this. I’ve actually read quite a bit on the Bayesian theory now, and understand enough to at least impress my friends with my very low level on understanding.
Even google returns limited resources on spreadsheets or how to set up a spreadsheet with more than two items,
I found this
http://psych.fullerton.edu/mbirnbaum/bayes/BayesCalc3.htm
Which was partially helpful. I could just play with the numbers by changing them until it works as I’d like, but I’d still really like to be able to understand why,
So using my example below
- platform: bayesian
prior: 0.6
name: Paul Presence
probability_threshold: 0.9
observations:
- entity_id: 'input_boolean.paul_present'
prob_given_true: 0.9
prob_given_false: 0.2
platform: 'state'
to_state: 'on'
- entity_id: 'device_tracker.pauls_iphone'
prob_given_true: 0.9
prob_given_false: 0.2
platform: 'state'
to_state: 'home'
- entity_id: 'device_tracker.pauls_iphone_2'
prob_given_true: 0.9
prob_given_false: 0.4
platform: 'state'
to_state: 'home'
The first sensor “input_boolean” is tied to my homekit. It usually triggers before anything else and sets the Bayesian sensor to true, My iPhone will also set the Bayesian sensor to true. Which is pretty much what I want, Problem is that if the 1st sensor stays on “False positive” when I leave, even if the others turn off, the Bayesian stays “on”. I get it, but I guess I don’t really get it.
I feel like I’m back in college when it comes to this sensor, which is both frustrating, and a bit exciting, as I slowly figure it out a little more.
Can you point me to how I could create an excel document where I could set values to 1/0 (for on/off/home/away, etc) and it would show me the end state of the Bayesian?
Thanks again for your patience