From ef6f7c683d8bae853a6a04358d43258ebf405992 Mon Sep 17 00:00:00 2001 From: Taylor Peet Date: Mon, 16 Oct 2017 02:33:35 -0400 Subject: [PATCH] Add numeric state example to Bayesian Sensor (#3642) --- .../_components/binary_sensor.bayesian.markdown | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/source/_components/binary_sensor.bayesian.markdown b/source/_components/binary_sensor.bayesian.markdown index 53505593b6b..b5d20c509ff 100644 --- a/source/_components/binary_sensor.bayesian.markdown +++ b/source/_components/binary_sensor.bayesian.markdown @@ -40,8 +40,8 @@ Configuration variables: - **entity_id** (*Required*): Name of the entity to monitor. - **prob_given_true** (*Required*): The probability of the observation occurring, given the event is `true`. - **prob_given_false** (*Optional*): The probability of the observation occurring, given the event is `false` can be set as well. If `prob_given_false` is not set, it will default to `1 - prob_given_true`. - - **platform** (*Required*): The only supported observation platforms are `state` and `numeric_state`, which are modeled after their corresponding triggers for automations. - - **to_state** (*Required*): The target start. + - **platform** (*Required*): The only supported observation platforms are `state` and `numeric_state`, which are modeled after their corresponding triggers for automations, requiring `before` and/or `after` instead of `to_state`. + - **to_state** (*Required*): The target state. - **probability_threshold** (*Optional*): The probability at which the sensor should trigger to `on`. - **name** (*Optional*): Name of the sensor to use in the frontend. Defaults to `Bayesian Binary`. @@ -74,3 +74,16 @@ binary_sensor: platform: 'state' to_state: 'below_horizon' ``` +```yaml +# Example configuration.yaml entry +binary_sensor: + name: 'Heat On' + platform: 'bayesian' + prior: 0.2 + probability_threshold: 0.9 + observations: + - entity_id: 'sensor.outside_air_temperature_fahrenheit' + prob_given_true: 0.95 + platform: 'numeric_state' + below: 50 +```