I have a pretty in-depth bayesian setup, I also use the history_stats platform to calculate the probabilities of things actually happening based on the numerous sensors i have around the house.
I would like to be able to define the bayesian prior and probabilities via a template as below:
- platform: bayesian
name: Area - Test Occupied
prior: "{{ states('sensor.stats_study_occupied')| float / 100 }}"
device_class: occupancy
probability_threshold: 0.8
observations:
- platform: "state"
entity_id: "group.area_study_motion"
prob_given_true: "{{ states('sensor.stats_study_motion')| float / 100 }}"
to_state: "on"
This would be calculated upon started up and perhaps have a service call to re-calculate as I understand that there may be a performance impact with constant recalculation of a lot of these definitions