prob_given_false is soon req, show in examples (#24276)

This commit is contained in:
HarvsG 2022-10-03 12:26:56 +00:00 committed by GitHub
parent ab5ef42805
commit 909f08e855
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,7 @@ In the configuration use the probability of the observation (the sensor state in
4. Use your Home Assistant history to help estimate the probabilities. 4. Use your Home Assistant history to help estimate the probabilities.
- `prob_given_true:` - Select the sensor in question over a time range when you think the `bayesian` sensor should have been `true`. `prob_given_true:` is the fraction of the time the sensor was in `to_state:`. - `prob_given_true:` - Select the sensor in question over a time range when you think the `bayesian` sensor should have been `true`. `prob_given_true:` is the fraction of the time the sensor was in `to_state:`.
- `prob_given_false:` - Select the sensor in question over a time range when you think the `bayesian` sensor should have been `false`. `prob_given_false:` is the fraction of the time the sensor was in `to_state:`. - `prob_given_false:` - Select the sensor in question over a time range when you think the `bayesian` sensor should have been `false`. `prob_given_false:` is the fraction of the time the sensor was in `to_state:`.
5. Don't work backwards by tweaking `prob_given_true:` and `prob_given_false:` to give the results and behaviors you want, use #4 to try and get probabilities as close to the 'truth' as you can, if your behavior is not as expected consider adding more sensors or see #7. 5. Don't work backwards by tweaking `prob_given_true:` and `prob_given_false:` to give the results and behaviors you want, use #4 to try and get probabilities as close to the 'truth' as you can, if your behavior is not as expected consider adding more sensors or see #6.
6. If your Bayesian sensor ends up triggering `on` too easily, re-check that the probabilities set and estimated make sense, then consider increasing `probability_threshold:` and vice-versa. 6. If your Bayesian sensor ends up triggering `on` too easily, re-check that the probabilities set and estimated make sense, then consider increasing `probability_threshold:` and vice-versa.
## Configuration ## Configuration
@ -101,7 +101,7 @@ observations:
required: true required: true
type: float type: float
prob_given_false: prob_given_false:
description: Assuming the bayesian binary_sensor is `false` the probability of this entity state is occurring. description: Assuming the bayesian binary_sensor is `false` the probability the entity state is occurring.
required: true required: true
type: float type: float
{% endconfiguration %} {% endconfiguration %}
@ -122,12 +122,12 @@ binary_sensor:
entity_id: "sensor.living_room_motion" entity_id: "sensor.living_room_motion"
prob_given_true: 0.05 # If I am in bed then I shouldn't be in the living room, very occasionally I have guests, however prob_given_true: 0.05 # If I am in bed then I shouldn't be in the living room, very occasionally I have guests, however
prob_given_false: 0.2 # My sensor history shows If I am not in bed I spend about a fifth of my time in the living room prob_given_false: 0.2 # My sensor history shows If I am not in bed I spend about a fifth of my time in the living room
to_state: "off" to_state: "on"
- platform: "state" - platform: "state"
entity_id: "sensor.basement_motion" entity_id: "sensor.basement_motion"
prob_given_true: 0.5 # My sensor history shows, when I am in bed, my basement motion sensor is active about half the time because of my cat prob_given_true: 0.5 # My sensor history shows, when I am in bed, my basement motion sensor is active about half the time because of my cat
prob_given_false: 0.3 # As above but my cat tends to spend more time upstairs or outside when I am awake and I rarely use the basement prob_given_false: 0.3 # As above but my cat tends to spend more time upstairs or outside when I am awake and I rarely use the basement
to_state: "off" to_state: "on"
- platform: "state" - platform: "state"
entity_id: "sensor.bedroom_motion" entity_id: "sensor.bedroom_motion"
prob_given_true: 0.5 # My sensor history shows when I am in bed the sensor picks me up about half the time prob_given_true: 0.5 # My sensor history shows when I am in bed the sensor picks me up about half the time
@ -136,6 +136,7 @@ binary_sensor:
- platform: "state" - platform: "state"
entity_id: "sun.sun" entity_id: "sun.sun"
prob_given_true: 0.7 # If I am in bed then there is a good chance the sun will be down, but in the summer mornings I may still be in bed prob_given_true: 0.7 # If I am in bed then there is a good chance the sun will be down, but in the summer mornings I may still be in bed
prob_given_false: 0.45 # If I am am awake then there is a reasonable chance the sun will be below the horizon - especially in winter
to_state: "below_horizon" to_state: "below_horizon"
- platform: "state" - platform: "state"
entity_id: "sensor.android_charger_type" entity_id: "sensor.android_charger_type"