This is mine. The input Boolean is my HomeKit, the other two are HA app, and last is router.
When I come home Homekit tends to show present 1st, and that is enough to trigger this as On (aka home). As far as triggering away, it takes multiple items to go away. But router is always correct for me, and one of the other sensors usually goes “away” quickly.
Bottom line, for the past week that has been great
- 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.1
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'