Dette blir et sidespor, men skit au. "Noen er hjemme" kan også være en bayesian sensor. Her er min som et eksempel på at det går å detektere annet enn kun mobil. Bevegelse i huset, om TV er påslått og co2 nivå er noe jeg bruker i tillegg til telefon.
binary_sensor:
- platform: bayesian
name: 'Noen er hjemme'
prior: 0.73
probability_threshold: 0.95
device_class: presence
observations:
- entity_id: device_tracker.bluetooth_it
prob_given_true: 0.71
platform: 'state'
to_state: 'home'
- entity_id: device_tracker.sm_g930f
prob_given_true: 0.8
platform: 'state'
to_state: 'home'
- entity_id: sensor.sm_g930f_wifi_connection
prob_given_true: 0.8
platform: 'state'
to_state: 'HEIME5.ORG'
- entity_id: device_tracker.bluetooth_svh
prob_given_true: 0.71
platform: 'state'
to_state: 'home'
- entity_id: device_tracker.sm_g715fn
prob_given_true: 0.8
platform: 'state'
to_state: 'home'
- entity_id: sensor.sm_g715fn_wifi_connection
prob_given_true: 0.8
platform: 'state'
to_state: 'HEIME5.ORG'
- entity_id: device_tracker.tv
prob_given_true: 0.7
platform: 'state'
to_state: 'home'
- entity_id: input_boolean.travel_enabled
prob_given_true: 0.001
platform: 'state'
to_state: 'on'
- prob_given_true: 0.3
platform: 'template'
value_template: "{{states('binary_sensor.worktime') == 'on' and states('input_boolean.home_office') == 'off'}}"
- entity_id: input_boolean.sleeptime
prob_given_true: 0.7
platform: 'state'
to_state: 'on'
- entity_id: input_select.phone_status
prob_given_true: 0.994
platform: 'state'
to_state: 'Glemt borte'
- entity_id: input_select.phone_status
prob_given_true: 0.0061
platform: 'state'
to_state: 'Glemt hjemme'
- entity_id: sensor.soverom_co2_value
platform: 'numeric_state'
prob_given_true: 0.8
above: 600
- entity_id: sensor.tvstue_co2_value
platform: 'numeric_state'
prob_given_true: 0.8
above: 600
- entity_id: sensor.airthings_stue_co2
platform: 'numeric_state'
prob_given_true: 0.8
above: 600
- entity_id: timer.activity
prob_given_true: 0.9
platform: 'state'
to_state: 'active'