Skip to content

Instantly share code, notes, and snippets.

@bachya
Created October 15, 2017 16:28
Show Gist options
  • Save bachya/9d078f3691b3389ef5dcfd525467e851 to your computer and use it in GitHub Desktop.
Save bachya/9d078f3691b3389ef5dcfd525467e851 to your computer and use it in GitHub Desktop.
A HomeAssistant Bayesian sensor for whether we’re in bed
binary_sensor:
- platform: 'bayesian'
name: In Bed
prior: 0.29
probability_threshold: 0.95
observations:
- entity_id: 'input_boolean.in_blackout'
prob_given_true: 0.9
platform: 'state'
to_state: 'on'
- entity_id: 'group.living_room_lights'
prob_given_true: 0.7
platform: 'state'
to_state: 'off'
- entity_id: 'remote.watch_roku'
prob_given_true: 0.75
platform: 'state'
to_state: 'off'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment