I was setting up this bayesian sleep sensor based on what I had read in a couple forums and the sensor will trigger to on. But it is not turning off. Any ideas what I might be missing?
binary_sensor:
- platform: bayesian
prior: 0.5
name: Sleeping
probability_threshold: 0.85
observations:
- entity_id: 'device_tracker.pixel_5'
prob_given_true: 0.99
prob_given_false: 0.01
platform: state
to_state: 'Home'
- entity_id: 'device_tracker.iphone'
prob_given_true: 0.99
prob_given_false: 0.01
platform: state
to_state: 'Home'
- entity_id: 'sensor.sun'
prob_given_true: 0.9
prob_given_false: 0.2
platform: state
to_state: below_horizon
- entity_id: light.master_bedroom_lights
prob_given_true: 0.99
prob_given_false: 0.01
platform: state
to_state: 'off'
- entity_id: light.master_bathroom_lights
prob_given_true: 0.99
prob_given_false: 0.01
platform: state
to_state: 'off'
- entity_id: media_player.master_bedroom_tv
prob_given_true: 0.99
prob_given_false: 0.4
platform: state
to_state: 'off'
- entity_id: media_player.master_bedroom_speaker
prob_given_true: 0.99
prob_given_false: 0.4
platform: state
to_state: playing
- entity_id: sensor.iphone_battery_state
prob_given_true: 0.99
prob_given_false: 0.4
platform: state
to_state: Charging
- entity_id: binary_sensor.pixel_5_is_charging
prob_given_true: 0.99
prob_given_false: 0.4
platform: state
to_state: 'on'