-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Bayesian Config Flow #35705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Bayesian Config Flow #35705
Conversation
✅ Deploy Preview for home-assistant-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 Walkthrough📝 WalkthroughWalkthroughThe documentation for the Changes
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (5)
source/_integrations/bayesian.markdown (5)
26-26
: Consider enhancing the UI vs YAML format explanationTo prevent potential user confusion, consider expanding this line to be more explicit about the format differences:
-Both UI and YAML setup is supported, importantly YAML uses probabilities of `0` to `1` whereas UI uses percentages. +Both UI and YAML setup is supported. Important note on probability formats: +- YAML configuration: Use decimal values between `0` and `1` (e.g., `0.5` for 50%) +- UI configuration: Use percentage values between `0` and `100` (e.g., `50` for 50%)
61-62
: Minor improvement in prior descriptionTo improve clarity and conciseness:
- The baseline probability of the event (0 to 1). At any point in time - (ignoring all external influences) how likely is this event to be occurring? + The baseline probability of the event (0 to 1). At any time + (ignoring all external influences) how likely is this event to be occurring?🧰 Tools
🪛 LanguageTool
[style] ~61-~61: This phrase is redundant. Consider writing “point” or “time”.
Context: ...obability of the event (0 to 1). At any point in time (ignoring all external influences)...(MOMENT_IN_TIME)
69-69
: Add comma for better readabilityAdd a comma after the conditional clause:
- Note: If the threshold is higher than the `prior` then the default state will be `off` + Note: If the threshold is higher than the `prior`, then the default state will be `off`🧰 Tools
🪛 LanguageTool
[typographical] ~69-~69: Consider adding a comma.
Context: ...the threshold is higher than theprior
then the default state will beoff
requi...(IF_THEN_COMMA)
130-130
: Fix hyphenation and consider adding validation guidance
- Fix the hyphenation:
-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. +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.
- Consider adding a note about validating probabilities:
+7. Validate your probabilities: For each observation, ensure that `prob_given_true` is significantly different from `prob_given_false` to make the observation meaningful. If they're too close, the observation might not contribute meaningfully to the final probability.
🧰 Tools
🪛 LanguageTool
[grammar] ~130-~130: The expression “vice versa” is spelled without hyphens.
Context: ...increasingprobability_threshold:
and vice-versa. ## Full examples These are a number ...(VICE_VERSA)
224-224
: Clarify range boundary behaviorThe explanation about range boundaries could be clearer:
-When more than one range is specified for the same entity, if a value falls on `below`, it will be included with the range that lists it in `below`. `below` then means "below or equal to". This is not true when only a single range is specified, where both `above` and `below` do not include "equal to". +Range boundary behavior differs based on configuration: +- Multiple ranges for same entity: + - `below: X` means "less than or equal to X" + - A value exactly equal to X belongs to the range that specifies it in `below` +- Single range: + - Both `above` and `below` are exclusive (not including the boundary values)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
source/_integrations/bayesian.markdown
(4 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/bayesian.markdown
[style] ~61-~61: This phrase is redundant. Consider writing “point” or “time”.
Context: ...obability of the event (0 to 1). At any point in time (ignoring all external influences)...
(MOMENT_IN_TIME)
[typographical] ~69-~69: Consider adding a comma.
Context: ...the threshold is higher than the prior
then the default state will be off
requi...
(IF_THEN_COMMA)
[grammar] ~130-~130: The expression “vice versa” is spelled without hyphens.
Context: ...increasing probability_threshold:
and vice-versa. ## Full examples These are a number ...
(VICE_VERSA)
🔇 Additional comments (1)
source/_integrations/bayesian.markdown (1)
Line range hint 1-224
: Documentation is comprehensive and well-structured
The documentation effectively explains the Bayesian integration, provides clear configuration guidance, and includes practical examples. The theory section is particularly well-written, making complex concepts accessible to users.
🧰 Tools
🪛 LanguageTool
[grammar] ~130-~130: The expression “vice versa” is spelled without hyphens.
Context: ...increasing probability_threshold:
and vice-versa. ## Full examples These are a number ...
(VICE_VERSA)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
source/_integrations/bayesian.markdown (3)
32-36
: Fix minor grammatical issues in the theory sectionWhile the content is excellent, there are a few grammatical issues to address:
Apply these corrections:
-However the probability that motion is detected +However, the probability that motion is detected -popular with the cats. However the probability +popular with the cats. However, the probability -(e.g 95%, p = 0.95) +(e.g., 95%, p = 0.95) -(e.g motion detected) +(e.g., motion detected) -(e.g human-occupancy of the room) +(e.g., human-occupancy of the room)🧰 Tools
🪛 LanguageTool
[uncategorized] ~34-~34: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ...) if the room is popular with the cats. However the probability that motion is detected...(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~34-~34: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...that it is occupied by a human is high (e.g 95%, p = 0.95) if our motion sensor is ...(E_G)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ... probability of the sensor observation (e.g motion detected) given the thing you ...(E_G)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...* the thing you are trying to estimate (e.g human-occupancy of the room). ## Confi...(E_G)
63-71
: Improve clarity of probability descriptions and fix grammarThe descriptions are good but could be more precise:
Apply these improvements:
-At any point in time +(ignoring all external influences) how likely is this event to be occurring? -if the threshold is higher than the `prior` then +if the threshold is higher than the `prior`, thenAlso, consider adding a note about the relationship between
prior
andprobability_threshold
:
"Settingprobability_threshold
close toprior
will make the sensor more sensitive to changes in observations."🧰 Tools
🪛 LanguageTool
[style] ~63-~63: This phrase is redundant. Consider writing “point” or “time”.
Context: ...obability of the event (0 to 1). At any point in time (ignoring all external influences)...(MOMENT_IN_TIME)
[typographical] ~71-~71: Consider adding a comma.
Context: ...the threshold is higher than theprior
then the default state will beoff
requi...(IF_THEN_COMMA)
123-133
: LGTM! Excellent practical guidance for probability estimationThe guidance is clear and practical, especially the tip about using Home Assistant history to estimate probabilities.
One minor fix needed:
-vice-versa +vice versa🧰 Tools
🪛 LanguageTool
[grammar] ~132-~132: The expression “vice versa” is spelled without hyphens.
Context: ...increasingprobability_threshold:
and vice-versa. ## Full examples These are a number ...(VICE_VERSA)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
source/_integrations/bayesian.markdown
(4 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/bayesian.markdown
[uncategorized] ~34-~34: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ...) if the room is popular with the cats. However the probability that motion is detected...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~34-~34: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...that it is occupied by a human is high (e.g 95%, p = 0.95) if our motion sensor is ...
(E_G)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ... probability of the sensor observation (e.g motion detected) given the thing you ...
(E_G)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...* the thing you are trying to estimate (e.g human-occupancy of the room). ## Confi...
(E_G)
[style] ~63-~63: This phrase is redundant. Consider writing “point” or “time”.
Context: ...obability of the event (0 to 1). At any point in time (ignoring all external influences)...
(MOMENT_IN_TIME)
[typographical] ~71-~71: Consider adding a comma.
Context: ...the threshold is higher than the prior
then the default state will be off
requi...
(IF_THEN_COMMA)
[grammar] ~132-~132: The expression “vice versa” is spelled without hyphens.
Context: ...increasing probability_threshold:
and vice-versa. ## Full examples These are a number ...
(VICE_VERSA)
🔇 Additional comments (3)
source/_integrations/bayesian.markdown (3)
22-26
: LGTM! Clear and practical introduction
The introduction effectively explains what a Bayesian sensor is and provides practical use cases that users can relate to.
226-226
: LGTM! Clear explanation of range behavior
The explanation of how ranges work with multiple states is precise and helpful for users.
Line range hint 22-226
: Overall excellent documentation improvements
The documentation is now more comprehensive, clearer, and more practical. Key strengths:
- Clear explanation of the theory with relatable examples
- Practical guidance for estimating probabilities
- Well-documented examples with realistic scenarios
- Thorough explanation of multiple state handling
The changes align perfectly with the PR objective of improving the documentation for Bayesian features.
🧰 Tools
🪛 LanguageTool
[grammar] ~132-~132: The expression “vice versa” is spelled without hyphens.
Context: ...increasing probability_threshold:
and vice-versa. ## Full examples These are a number ...
(VICE_VERSA)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (8)
source/_integrations/bayesian.markdown (8)
22-28
: Grammar and clarity: pluralize “setup” and refine punctuation
The sentence uses singular “setup” for two items and runs clauses together. Consider pluralizing “setup” and adding proper punctuation for readability.-Both UI and YAML setup is supported, importantly YAML uses probabilities of `0` to `1` whereas UI uses percentages. +Both UI and YAML setups are supported; importantly, YAML uses probabilities from 0 to 1, while the UI uses percentages.
32-36
: Theory section: fix commas ande.g.
formatting
Add missing commas after introductory clauses and ensure “e.g.” is punctuated correctly. Also clarify “motion detected” and remove unnecessary words.-Now consider the above but in a home that has cats. The probability that the room is human-occupied *given* that motion detected may be quite low (e.g. 20%, p=0.2) if the room is popular with the cats. However the probability that motion is detected *given* that it is occupied by a human is high (e.g 95%, p = 0.95) if our motion sensor is accurate. +Now consider the above, but in a home that has cats. The probability that the room is human-occupied *given* that motion is detected may be quite low (e.g., 20%, p=0.2) if the room is popular with cats. However, the probability that motion is detected *given* that it is occupied by a human is high (e.g., 95%, p=0.95) if our motion sensor is accurate. -When configuring these conditional probabilities define the probability of the sensor observation (e.g motion detected) *given* the thing you are trying to estimate (e.g human-occupancy of the room). +When configuring these conditional probabilities, define the probability of the sensor observation (e.g., motion detected) *given* the thing you are trying to estimate (e.g., human occupancy of the room).🧰 Tools
🪛 LanguageTool
[uncategorized] ~34-~34: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ...) if the room is popular with the cats. However the probability that motion is detected...(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~34-~34: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...that it is occupied by a human is high (e.g 95%, p = 0.95) if our motion sensor is ...(E_G)
[uncategorized] ~36-~36: Possible missing comma found.
Context: ...ve. When configuring these conditional probabilities define the probability of the sensor ob...(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ... probability of the sensor observation (e.g motion detected) given the thing you ...(E_G)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...* the thing you are trying to estimate (e.g human-occupancy of the room). {% inclu...(E_G)
61-62
: Combine and punctuate description forprior
Merge the two lines into a single sentence and add commas for better flow.- The baseline probability of the event (0 to 1). At any point in time - (ignoring all external influences) how likely is this event to be occurring? + The baseline probability of the event (0 to 1): at any point in time (ignoring all external influences), how likely is this event to be occurring?🧰 Tools
🪛 LanguageTool
[style] ~61-~61: This phrase is redundant. Consider writing “point” or “time”.
Context: ...obability of the event (0 to 1). At any point in time (ignoring all external influences)...(MOMENT_IN_TIME)
69-69
: Add comma in note underprobability_threshold
Insert a comma and terminal period for correct punctuation.- Note: If the threshold is higher than the `prior` then the default state will be `off` + Note: If the threshold is higher than the `prior`, the default state will be `off`.🧰 Tools
🪛 LanguageTool
[typographical] ~69-~69: Consider adding a comma.
Context: ...the threshold is higher than theprior
then the default state will beoff
requi...(IF_THEN_COMMA)
112-112
: Clarifyprob_given_true
description
Add “that” for grammatical correctness and capitalize “Bayesian”.- Assuming the bayesian binary_sensor is `on`, the probability the entity state is occurring. + Assuming the Bayesian binary_sensor is `on`, the probability that the entity state is occurring.🧰 Tools
🪛 LanguageTool
[uncategorized] ~112-~112: Possible missing preposition found.
Context: ... binary_sensor ison
, the probability the entity state is occurring. requir...(AI_HYDRA_LEO_MISSING_OF)
116-116
: Clarifyprob_given_false
description
Add missing comma after “off” and include “that” for alignment with other descriptions.- description: Assuming the bayesian binary_sensor is `off` the probability the entity state is occurring. + description: Assuming the Bayesian binary_sensor is `off`, the probability that the entity state is occurring.
121-130
: Consistent list formatting in “Estimating probabilities”
- Change bullet 2 to use a comma instead of a period.
- Remove hyphen in “vice versa”.
-2. When using `0.99` and `0.001`. The number of `9`s and `0`s matters. +2. When using `0.99` and `0.001`, note that the number of `9`s and `0`s matters. ... -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.🧰 Tools
🪛 LanguageTool
[grammar] ~130-~130: The expression “vice versa” is spelled without hyphens.
Context: ...increasingprobability_threshold:
and vice-versa. ## Full examples These are a number ...(VICE_VERSA)
224-224
: Clarify range inclusion rules
Rephrase for clarity and add transition word for readability.-When more than one range is specified for the same entity, if a value falls on `below`, it will be included with the range that lists it in `below`. `below` then means 'below or equal to'. This is not true when only a single range is specified, where both `above` and `below` do not include 'equal to'. +When more than one range is specified for the same entity, if a value falls on `below`, it will be included with the range that lists it in `below` (i.e., 'below or equal to'). However, when only a single range is specified, both `above` and `below` do not include 'equal to'.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
source/_integrations/bayesian.markdown
(4 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/bayesian.markdown
[uncategorized] ~34-~34: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ...) if the room is popular with the cats. However the probability that motion is detected...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~34-~34: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...that it is occupied by a human is high (e.g 95%, p = 0.95) if our motion sensor is ...
(E_G)
[uncategorized] ~36-~36: Possible missing comma found.
Context: ...ve. When configuring these conditional probabilities define the probability of the sensor ob...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ... probability of the sensor observation (e.g motion detected) given the thing you ...
(E_G)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...* the thing you are trying to estimate (e.g human-occupancy of the room). {% inclu...
(E_G)
[style] ~61-~61: This phrase is redundant. Consider writing “point” or “time”.
Context: ...obability of the event (0 to 1). At any point in time (ignoring all external influences)...
(MOMENT_IN_TIME)
[typographical] ~69-~69: Consider adding a comma.
Context: ...the threshold is higher than the prior
then the default state will be off
requi...
(IF_THEN_COMMA)
[uncategorized] ~112-~112: Possible missing preposition found.
Context: ... binary_sensor is on
, the probability the entity state is occurring. requir...
(AI_HYDRA_LEO_MISSING_OF)
[grammar] ~130-~130: The expression “vice versa” is spelled without hyphens.
Context: ...increasing probability_threshold:
and vice-versa. ## Full examples These are a number ...
(VICE_VERSA)
🔇 Additional comments (2)
source/_integrations/bayesian.markdown (2)
38-38
: Include config flow snippet
The{% include integrations/config_flow.md %}
directive correctly injects the config flow example.
107-107
: Value template description clarity
The description is clear and concise. No changes needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (6)
source/_integrations/bayesian.markdown (6)
34-34
: Fix punctuation and e.g. formatting
Add missing comma after “However” and standardize “e.g.,” formatting for consistency.- ...cats). However the probability that motion is detected *given* it is occupied by a human is high (e.g 95%, p = 0.95)... + ...cats). However, the probability that motion is detected *given* it is occupied by a human is high (e.g., 95%, p = 0.95)...🧰 Tools
🪛 LanguageTool
[uncategorized] ~34-~34: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ...) if the room is popular with the cats. However the probability that motion is detected...(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~34-~34: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...that it is occupied by a human is high (e.g 95%, p = 0.95) if our motion sensor is ...(E_G)
36-36
: Improve introductory clause and e.g. syntax
Insert a comma after the introductory phrase and update “e.g.” punctuation.- When configuring these conditional probabilities define the probability of the sensor observation (e.g motion detected) *given* the thing you are trying to estimate (e.g human-occupancy of the room). + When configuring these conditional probabilities, define the probability of the sensor observation (e.g., motion detected) *given* the thing you are trying to estimate (e.g., human-occupancy of the room).🧰 Tools
🪛 LanguageTool
[uncategorized] ~36-~36: A comma might be missing here.
Context: ...ve. When configuring these conditional probabilities define the probability of the sensor ob...(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ... probability of the sensor observation (e.g motion detected) given the thing you ...(E_G)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...* the thing you are trying to estimate (e.g human-occupancy of the room). {% inclu...(E_G)
61-62
: Remove redundant phrase
“At any point in time” can be shortened to “At any point” to improve readability.- At any point in time (ignoring all external influences) how likely is this event to be occurring? + At any point (ignoring all external influences) how likely is this event to be occurring?🧰 Tools
🪛 LanguageTool
[style] ~61-~61: This phrase is redundant. Consider writing “point” or “time”.
Context: ...obability of the event (0 to 1). At any point in time (ignoring all external influences)...(MOMENT_IN_TIME)
[uncategorized] ~62-~62: This verb may not be in the correct tense. Consider changing the tense to fit the context better.
Context: ...influences) how likely is this event to be occurring? required: true type: float probabi...(AI_EN_LECTOR_REPLACEMENT_VERB_TENSE)
67-69
: Fix sentence casing and punctuation
Capitalize the second line, add missing periods, and insert a comma in the Note.- use higher values to reduce false positives (and increase false negatives) + Use higher values to reduce false positives (and increase false negatives). - Note: If the threshold is higher than the `prior` then the default state will be `off` + Note: If the threshold is higher than the `prior`, then the default state will be `off`.🧰 Tools
🪛 LanguageTool
[typographical] ~69-~69: Consider adding a comma.
Context: ...the threshold is higher than theprior
then the default state will beoff
requi...(IF_THEN_COMMA)
112-112
: Clarifyprob_given_true
description
Consider rewording for parallel structure, e.g.:
“The probability that the entity state is occurring given the Bayesian sensor ison
.”- Assuming the bayesian binary_sensor is `on`, the probability the entity state is occurring. + The probability that the entity state is occurring given the Bayesian sensor is `on`.🧰 Tools
🪛 LanguageTool
[uncategorized] ~112-~112: Possible missing preposition found.
Context: ... binary_sensor ison
, the probability the entity state is occurring. requir...(AI_HYDRA_LEO_MISSING_OF)
116-116
: Add missing comma after “off”
Insert a comma after the introductory clause for clarity.- Assuming the bayesian binary_sensor is `off` the probability the entity state is occurring. + Assuming the bayesian binary_sensor is `off`, the probability the entity state is occurring.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
source/_integrations/bayesian.markdown
(3 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/bayesian.markdown
[uncategorized] ~34-~34: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ...) if the room is popular with the cats. However the probability that motion is detected...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~34-~34: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...that it is occupied by a human is high (e.g 95%, p = 0.95) if our motion sensor is ...
(E_G)
[uncategorized] ~36-~36: A comma might be missing here.
Context: ...ve. When configuring these conditional probabilities define the probability of the sensor ob...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ... probability of the sensor observation (e.g motion detected) given the thing you ...
(E_G)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...* the thing you are trying to estimate (e.g human-occupancy of the room). {% inclu...
(E_G)
[style] ~61-~61: This phrase is redundant. Consider writing “point” or “time”.
Context: ...obability of the event (0 to 1). At any point in time (ignoring all external influences)...
(MOMENT_IN_TIME)
[uncategorized] ~62-~62: This verb may not be in the correct tense. Consider changing the tense to fit the context better.
Context: ...influences) how likely is this event to be occurring? required: true type: float probabi...
(AI_EN_LECTOR_REPLACEMENT_VERB_TENSE)
[typographical] ~69-~69: Consider adding a comma.
Context: ...the threshold is higher than the prior
then the default state will be off
requi...
(IF_THEN_COMMA)
[uncategorized] ~112-~112: Possible missing preposition found.
Context: ... binary_sensor is on
, the probability the entity state is occurring. requir...
(AI_HYDRA_LEO_MISSING_OF)
[uncategorized] ~129-~129: A comma might be missing here.
Context: ... as you can, if your behavior is not as expected consider adding more sensors or see #6....
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[grammar] ~130-~130: The expression “vice versa” is spelled without hyphens.
Context: ...increasing probability_threshold:
and vice-versa. ## Full examples These are a number ...
(VICE_VERSA)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Redirect rules - home-assistant-docs
- GitHub Check: Header rules - home-assistant-docs
- GitHub Check: Pages changed - home-assistant-docs
🔇 Additional comments (11)
source/_integrations/bayesian.markdown (11)
22-22
: Approve updated introduction
The new description clearly defines thebayesian
helper as a virtual binary sensor using probabilistic methods.
24-24
: Approve expanded use cases
Listing complex events and unreliable sensors adds valuable context for users.
26-26
: Approve Bayes’ rule explanation
The description of prior and posterior probabilities is clear and concise.
28-28
: Approve UI vs YAML note
Clarifying the difference between UI percentages and YAML decimals is helpful.
32-32
: Approve theory section intro
The distinction between event-given-observation and vice versa is well stated.
38-38
: Verify config_flow include path
Ensureintegrations/config_flow.md
exists and is correctly referenced in this integration.
47-49
: Approve YAML example metadata
The sample shows correct usage ofname
,prior
, andprobability_threshold
.
51-53
: Approve observation example snippet
Entity-ID and probability mappings are clear and correctly formatted.
107-107
: Approve template description
The guidance onvalue_template
outputtingTrue
orFalse
is clear.
121-131
: Approve “Estimating probabilities” section
This numbered guidance is thorough and provides clear best practices.🧰 Tools
🪛 LanguageTool
[uncategorized] ~129-~129: A comma might be missing here.
Context: ... as you can, if your behavior is not as expected consider adding more sensors or see #6....(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[grammar] ~130-~130: The expression “vice versa” is spelled without hyphens.
Context: ...increasingprobability_threshold:
and vice-versa. ## Full examples These are a number ...(VICE_VERSA)
224-224
: Approve multi-range behavior clarification
The note on howbelow
is interpreted with multiple ranges is precise and helpful.
The integration pages are hard to find for helpers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
source/_integrations/bayesian.markdown (4)
34-36
: Punctuation and abbreviation corrections in Theory section
Fix missing commas and standardize 'e.g.' usage for clarity.- Now consider the above but in a home that has cats. The probability that the room is human-occupied *given* that motion detected may be quite low (e.g 20%, p=0.2)... + Now consider the above but in a home that has cats. The probability that the room is human-occupied *given* that motion is detected may be quite low (e.g. 20%, p = 0.2)... - However the probability that motion is detected *given* that it is occupied by a human is high (e.g 95%, p = 0.95)... + However, the probability that motion is detected *given* that it is occupied by a human is high (e.g. 95%, p = 0.95)... - When configuring these conditional probabilities define the probability of the sensor observation (e.g motion detected) *given* the thing you are trying to estimate (e.g human-occupancy of the room). + When configuring these conditional probabilities, define the probability of the sensor observation (e.g. motion detected) *given* the thing you are trying to estimate (e.g. human-occupancy of the room).🧰 Tools
🪛 LanguageTool
[uncategorized] ~34-~34: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ...) if the room is popular with the cats. However the probability that motion is detected...(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~34-~34: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...that it is occupied by a human is high (e.g 95%, p = 0.95) if our motion sensor is ...(E_G)
[uncategorized] ~36-~36: Possible missing comma found.
Context: ...ve. When configuring these conditional probabilities define the probability of the sensor ob...(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ... probability of the sensor observation (e.g motion detected) given the thing you ...(E_G)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...* the thing you are trying to estimate (e.g human-occupancy of the room). {% inclu...(E_G)
64-72
: Refine and punctuate configuration descriptions
Simplify phrasing and add missing comma.- At any point in time (ignoring all external influences) how likely is this event to be occurring? + At any point (ignoring all external influences) how likely is this event to be occurring? - Note: If the threshold is higher than the `prior` then the default state will be `off` + Note: If the threshold is higher than the `prior`, then the default state will be `off`🧰 Tools
🪛 LanguageTool
[style] ~64-~64: This phrase is redundant. Consider writing “point” or “time”.
Context: ...obability of the event (0 to 1). At any point in time (ignoring all external influences)...(MOMENT_IN_TIME)
[typographical] ~72-~72: Consider adding a comma.
Context: ...the threshold is higher than theprior
then the default state will beoff
requi...(IF_THEN_COMMA)
110-119
: Clarify configuration descriptions
Use semicolon for independent clauses and fix missing prepositions.- description: Defines the template to be used, should evaluate to `True` or `False`. + description: Defines the template to be used; should evaluate to `True` or `False`. - description: Assuming the bayesian binary_sensor is `on`, the probability the entity state is occurring. + description: Assuming the bayesian binary_sensor is `on`, the probability of the entity state occurring. - description: Assuming the bayesian binary_sensor is `off` the probability the entity state is occurring. + description: Assuming the bayesian binary_sensor is `off`, the probability of the entity state occurring.🧰 Tools
🪛 LanguageTool
[uncategorized] ~115-~115: Possible missing preposition found.
Context: ... binary_sensor ison
, the probability the entity state is occurring. requir...(AI_HYDRA_LEO_MISSING_OF)
133-133
: Standardize 'vice versa' spelling
Replace hyphenated form with two-word standard.- vice-versa + vice versa🧰 Tools
🪛 LanguageTool
[grammar] ~133-~133: The expression “vice versa” is spelled without hyphens.
Context: ...increasingprobability_threshold:
and vice-versa. ## Full examples These are a number ...(VICE_VERSA)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
source/_integrations/bayesian.markdown
(3 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/bayesian.markdown
[uncategorized] ~34-~34: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ...) if the room is popular with the cats. However the probability that motion is detected...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~34-~34: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...that it is occupied by a human is high (e.g 95%, p = 0.95) if our motion sensor is ...
(E_G)
[uncategorized] ~36-~36: Possible missing comma found.
Context: ...ve. When configuring these conditional probabilities define the probability of the sensor ob...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ... probability of the sensor observation (e.g motion detected) given the thing you ...
(E_G)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...* the thing you are trying to estimate (e.g human-occupancy of the room). {% inclu...
(E_G)
[style] ~64-~64: This phrase is redundant. Consider writing “point” or “time”.
Context: ...obability of the event (0 to 1). At any point in time (ignoring all external influences)...
(MOMENT_IN_TIME)
[typographical] ~72-~72: Consider adding a comma.
Context: ...the threshold is higher than the prior
then the default state will be off
requi...
(IF_THEN_COMMA)
[uncategorized] ~115-~115: Possible missing preposition found.
Context: ... binary_sensor is on
, the probability the entity state is occurring. requir...
(AI_HYDRA_LEO_MISSING_OF)
[grammar] ~133-~133: The expression “vice versa” is spelled without hyphens.
Context: ...increasing probability_threshold:
and vice-versa. ## Full examples These are a number ...
(VICE_VERSA)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Redirect rules - home-assistant-docs
- GitHub Check: Header rules - home-assistant-docs
- GitHub Check: Pages changed - home-assistant-docs
🔇 Additional comments (5)
source/_integrations/bayesian.markdown (5)
22-28
: Clear and concise introduction
The updated overview effectively explains the Bayesian helper concept, its UI and YAML distinctions, and real-world use cases.
38-38
: Config flow include validation
The{% include integrations/config_flow.md %}
directive correctly injects the UI config snippet.
50-56
: Enhanced YAML example clarity
The updated YAML snippet now pairs keys with inline comments, making intent and parameters transparent.
124-124
: Added Estimating probabilities section
This new guidance offers actionable steps for users to estimate and validate their probability values.
227-227
: Clarify numeric range behavior
The note on multiple ranges specifying 'below' semantics is now clear and correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (8)
source/_integrations/bayesian.markdown (8)
50-56
: Minor formatting: standardize YAML quoting
In the example, values like theplatform
andentity_id
are quoted inconsistently. Align with Home Assistant style (e.g., use single quotes only when required) to improve readability.
64-65
: Tighten description and remove redundancy
The phrase “At any point in time” can be shortened (e.g., “At any point”), and remove extra spacing before the parenthesis for consistency.🧰 Tools
🪛 LanguageTool
[style] ~64-~64: This phrase is redundant. Consider writing “point” or “time”.
Context: ...obability of the event (0 to 1). At any point in time (ignoring all external influences)...(MOMENT_IN_TIME)
[uncategorized] ~65-~65: This verb may not be in the correct tense. Consider changing the tense to fit the context better.
Context: ...influences) how likely is this event to be occurring? required: true type: float probabi...(AI_EN_LECTOR_REPLACEMENT_VERB_TENSE)
72-72
: Add missing comma in conditional note
Insert a comma after the leading clause:- Note: If the threshold is higher than the `prior` then the default state will be `off` + Note: If the threshold is higher than the `prior`, then the default state will be `off`🧰 Tools
🪛 LanguageTool
[typographical] ~72-~72: Consider adding a comma.
Context: ...the threshold is higher than theprior
then the default state will beoff
requi...(IF_THEN_COMMA)
110-110
: Clarify template description
Consider rephrasing to:Defines the template to evaluate; must return
True
orFalse
.
This aligns with other key descriptions.
115-115
: Improve clarity of probability description
The phrasing “the probability the entity state is occurring” is ambiguous. Suggest:- Assuming the bayesian binary_sensor is `on`, the probability the entity state is occurring. + Assuming the Bayesian sensor is `on`, the probability that the observation occurs.🧰 Tools
🪛 LanguageTool
[uncategorized] ~115-~115: Possible missing preposition found.
Context: ... binary_sensor ison
, the probability the entity state is occurring. requir...(AI_HYDRA_LEO_MISSING_OF)
119-119
: Add missing comma after introductory clause
Add a comma after “off”:- Assuming the bayesian binary_sensor is `off` the probability the entity state is occurring. + Assuming the bayesian binary_sensor is `off`, the probability the entity state is occurring.
126-133
: Polish punctuation and spelling in bullet list
Apply these changes for clarity and consistency:- 2. When using `0.99` and `0.001`. The number of `9`s and `0`s matters. + 2. When using `0.99` and `0.001`, note that the number of `9`s and `0`s matters. - 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. + 5. Don't work backwards by tweaking `prob_given_true:` and `prob_given_false:` to get the results you want. Use #4 to estimate probabilities as close to the truth as possible, and 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.🧰 Tools
🪛 LanguageTool
[uncategorized] ~132-~132: A comma might be missing here.
Context: ... as you can, if your behavior is not as expected consider adding more sensors or see #6....(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[grammar] ~133-~133: The expression “vice versa” is spelled without hyphens.
Context: ...increasingprobability_threshold:
and vice-versa. ## Full examples These are a number ...(VICE_VERSA)
227-227
: Clarify “below” behavior note
Consider rephrasing for readability:- When more than one range is specified for the same entity, if a value falls on `below`, it will be included with the range that lists it in `below`. `below` then means 'below or equal to'. This is not true when only a single range is specified, where both `above` and `below` do not include 'equal to'. + When multiple ranges are specified for the same entity, `below` includes the boundary (i.e., 'below or equal to'). When only a single range is specified, both `above` and `below` exclude the boundary.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
source/_integrations/bayesian.markdown
(3 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/bayesian.markdown
[uncategorized] ~34-~34: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ...) if the room is popular with the cats. However the probability that motion is detected...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~34-~34: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...that it is occupied by a human is high (e.g 95%, p = 0.95) if our motion sensor is ...
(E_G)
[uncategorized] ~36-~36: A comma might be missing here.
Context: ...ve. When configuring these conditional probabilities define the probability of the sensor ob...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ... probability of the sensor observation (e.g motion detected) given the thing you ...
(E_G)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...* the thing you are trying to estimate (e.g human-occupancy of the room). {% inclu...
(E_G)
[style] ~64-~64: This phrase is redundant. Consider writing “point” or “time”.
Context: ...obability of the event (0 to 1). At any point in time (ignoring all external influences)...
(MOMENT_IN_TIME)
[uncategorized] ~65-~65: This verb may not be in the correct tense. Consider changing the tense to fit the context better.
Context: ...influences) how likely is this event to be occurring? required: true type: float probabi...
(AI_EN_LECTOR_REPLACEMENT_VERB_TENSE)
[typographical] ~72-~72: Consider adding a comma.
Context: ...the threshold is higher than the prior
then the default state will be off
requi...
(IF_THEN_COMMA)
[uncategorized] ~115-~115: Possible missing preposition found.
Context: ... binary_sensor is on
, the probability the entity state is occurring. requir...
(AI_HYDRA_LEO_MISSING_OF)
[uncategorized] ~132-~132: A comma might be missing here.
Context: ... as you can, if your behavior is not as expected consider adding more sensors or see #6....
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[grammar] ~133-~133: The expression “vice versa” is spelled without hyphens.
Context: ...increasing probability_threshold:
and vice-versa. ## Full examples These are a number ...
(VICE_VERSA)
🔇 Additional comments (3)
source/_integrations/bayesian.markdown (3)
22-28
: Clear introduction of Bayesian helper
The new opening paragraphs succinctly explain the purpose and use of thebayesian
helper as a virtual binary sensor.
32-38
: Solid theory section and config flow inclusion
The distinction between conditional probabilities is well-stated and the inline config flow include ensures users can conveniently access the UI setup.🧰 Tools
🪛 LanguageTool
[uncategorized] ~34-~34: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ...) if the room is popular with the cats. However the probability that motion is detected...(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~34-~34: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...that it is occupied by a human is high (e.g 95%, p = 0.95) if our motion sensor is ...(E_G)
[uncategorized] ~36-~36: A comma might be missing here.
Context: ...ve. When configuring these conditional probabilities define the probability of the sensor ob...(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ... probability of the sensor observation (e.g motion detected) given the thing you ...(E_G)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...* the thing you are trying to estimate (e.g human-occupancy of the room). {% inclu...(E_G)
124-124
: Useful “Estimating probabilities” section
The new guidance provides practical best practices for users estimating real-world probabilities.
Bayesian is a proper adjective (from Thomas Bayes), so it is capitalised in in all cases in the text. `bayesian` is not capitalised as it signifies the configuration values which are never capitalised.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (6)
source/_integrations/bayesian.markdown (6)
32-36
: Nit: punctuation & e.g. formatting in Theory section
Some sentences contain comma splices and inconsistent “e.g.” usage. Consider:- Now consider the above but in a home that has cats. The probability [...] + Now consider the above, but in a home that has cats. The probability [...] - However the probability that motion detected may be quite low (e.g 20%, p=0.2) + However, the probability that motion is detected may be quite low (e.g., 20%, p=0.2) - When configuring these conditional probabilities define the probability [...] + When configuring these conditional probabilities, define the probability [...]🧰 Tools
🪛 LanguageTool
[uncategorized] ~34-~34: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ...) if the room is popular with the cats. However the probability that motion is detected...(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~34-~34: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...that it is occupied by a human is high (e.g 95%, p = 0.95) if our motion sensor is ...(E_G)
[uncategorized] ~36-~36: A comma might be missing here.
Context: ...ve. When configuring these conditional probabilities define the probability of the sensor ob...(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ... probability of the sensor observation (e.g motion detected) given the thing you ...(E_G)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...* the thing you are trying to estimate (e.g human-occupancy of the room). {% inclu...(E_G)
64-65
: Nit: simplify redundant phrase
The phrase “at any point in time” is verbose. You could simplify:- The baseline probability of the event (0 to 1). At any point in time (ignoring all external influences) how likely is this event to be occurring? + The baseline probability of the event (0 to 1). At any given time (ignoring all external influences) how likely is this event to be occurring?🧰 Tools
🪛 LanguageTool
[style] ~64-~64: This phrase is redundant. Consider writing “point” or “time”.
Context: ...obability of the event (0 to 1). At any point in time (ignoring all external influences)...(MOMENT_IN_TIME)
[uncategorized] ~65-~65: This verb may not be in the correct tense. Consider changing the tense to fit the context better.
Context: ...influences) how likely is this event to be occurring? required: true type: float probabi...(AI_EN_LECTOR_REPLACEMENT_VERB_TENSE)
72-72
: Nit: add comma in Note
Add a comma for clarity and a period at the end:- Note: If the threshold is higher than the `prior` then the default state will be `off` + Note: If the threshold is higher than the `prior`, then the default state will be `off`.🧰 Tools
🪛 LanguageTool
[typographical] ~72-~72: Consider adding a comma.
Context: ...the threshold is higher than theprior
then the default state will beoff
requi...(IF_THEN_COMMA)
115-119
: Nit: clarify probability descriptions
Add “of” and commas for clarity:- description: Assuming the Bayesian binary_sensor is `on`, the probability the entity state is occurring. + description: Assuming the Bayesian binary_sensor is `on`, the probability of the entity state occurring. - description: Assuming the Bayesian binary_sensor is `off` the probability the entity state is occurring. + description: Assuming the Bayesian binary_sensor is `off`, the probability of the entity state occurring.🧰 Tools
🪛 LanguageTool
[uncategorized] ~115-~115: Possible missing preposition found.
Context: ... binary_sensor ison
, the probability the entity state is occurring. requir...(AI_HYDRA_LEO_MISSING_OF)
126-133
: Nit: sharpen Estimating probabilities guidelines
Several lines could be clearer with proper punctuation and structure. For example:- 1. Avoid `0` and `1`, these will mess with the odds and are rarely true - sensors fail. + 1. Avoid `0` and `1`; these will mess with the odds and are rarely true—sensors fail. - 2. When using `0.99` and `0.001`. The number of `9`s and `0`s matters. + 2. When using `0.99` and `0.001`, the number of `9`s and `0`s matters. - 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. + 5. Don't work backwards by tweaking `prob_given_true:` and `prob_given_false:` to force desired outcomes; use guideline #4 to estimate probabilities as accurately as possible. If behavior still isn’t 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 make sense, then consider increasing `probability_threshold:` and vice versa.🧰 Tools
🪛 LanguageTool
[uncategorized] ~132-~132: A comma might be missing here.
Context: ... as you can, if your behavior is not as expected consider adding more sensors or see #6....(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[grammar] ~133-~133: The expression “vice versa” is spelled without hyphens.
Context: ...increasingprobability_threshold:
and vice-versa. ## Full examples These are a number ...(VICE_VERSA)
227-227
: Optional: improve range inclusivity explanation
Consider rephrasing for clarity and consistency, e.g.:- When more than one range is specified for the same entity, if a value falls on `below`, it will be included with the range that lists it in `below`. `below` then means 'below or equal to'. This is not true when only a single range is specified, where both `above` and `below` do not include 'equal to'. + When multiple ranges are defined for the same entity, `below` is inclusive (≤) for any range that specifies it. For a single range, `above` and `below` remain exclusive.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
source/_integrations/bayesian.markdown
(4 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/bayesian.markdown
[uncategorized] ~34-~34: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ...) if the room is popular with the cats. However the probability that motion is detected...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[uncategorized] ~34-~34: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...that it is occupied by a human is high (e.g 95%, p = 0.95) if our motion sensor is ...
(E_G)
[uncategorized] ~36-~36: A comma might be missing here.
Context: ...ve. When configuring these conditional probabilities define the probability of the sensor ob...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ... probability of the sensor observation (e.g motion detected) given the thing you ...
(E_G)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...* the thing you are trying to estimate (e.g human-occupancy of the room). {% inclu...
(E_G)
[style] ~64-~64: This phrase is redundant. Consider writing “point” or “time”.
Context: ...obability of the event (0 to 1). At any point in time (ignoring all external influences)...
(MOMENT_IN_TIME)
[uncategorized] ~65-~65: This verb may not be in the correct tense. Consider changing the tense to fit the context better.
Context: ...influences) how likely is this event to be occurring? required: true type: float probabi...
(AI_EN_LECTOR_REPLACEMENT_VERB_TENSE)
[typographical] ~72-~72: Consider adding a comma.
Context: ...the threshold is higher than the prior
then the default state will be off
requi...
(IF_THEN_COMMA)
[uncategorized] ~115-~115: Possible missing preposition found.
Context: ... binary_sensor is on
, the probability the entity state is occurring. requir...
(AI_HYDRA_LEO_MISSING_OF)
[uncategorized] ~132-~132: A comma might be missing here.
Context: ... as you can, if your behavior is not as expected consider adding more sensors or see #6....
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[grammar] ~133-~133: The expression “vice versa” is spelled without hyphens.
Context: ...increasing probability_threshold:
and vice-versa. ## Full examples These are a number ...
(VICE_VERSA)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Redirect rules - home-assistant-docs
- GitHub Check: Header rules - home-assistant-docs
- GitHub Check: Pages changed - home-assistant-docs
🔇 Additional comments (5)
source/_integrations/bayesian.markdown (5)
22-28
: Introductory text is clear
The new introduction effectively explains the Bayesian helper’s purpose and benefits. No changes needed.
38-38
: Config flow include snippet
The{% include integrations/config_flow.md %}
directive aligns with Home Assistant docs conventions.
50-56
: YAML example snippet is accurate
The configuration example forbinary_sensor
withname
,prior
, and observation probabilities is clear and follows standards.
110-110
: Value template description update looks good
Changing the boolean results toTrue
/False
matches templating conventions.
124-124
: Estimating probabilities section
Adding a dedicated section on probability estimation is a great enhancement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (8)
source/_integrations/bayesian.markdown (8)
28-28
: Consider splitting for clarity
This sentence is a bit long.
Suggestion:-Both UI and YAML setups are supported, importantly YAML uses probabilities of `0` to `1` whereas the UI uses percentages, `0` to `100`. +Both UI and YAML setups are supported. Importantly, YAML uses probabilities of `0` to `1`, whereas the UI uses percentages of `0` to `100`.
32-32
: Consistent capitalization for ‘rule’
Use “Bayes’ rule” (lowercase “rule”) to match common style:-A fundamental concept in Bayes' Rule is… +A fundamental concept in Bayes' rule is…
34-34
: Fix abbreviation punctuation
Add missing periods for “e.g.” (“for example”):-… low (e.g 20%, p=0.2) … +… low (e.g., 20%, p=0.2) …🧰 Tools
🪛 LanguageTool
[uncategorized] ~34-~34: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...that it is occupied by a human is high (e.g 95%, p = 0.95) if our motion sensor is ...(E_G)
36-36
: Fix abbreviation punctuation
“e.g.” requires two periods:-… probability of the sensor observation (e.g motion detected) … +… probability of the sensor observation (e.g., motion detected) …🧰 Tools
🪛 LanguageTool
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ... probability of the sensor observation (e.g motion detected) given the thing you ...(E_G)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...* the thing you are trying to estimate (e.g human-occupancy of the room). {% inclu...(E_G)
64-65
: Align block indentation
Indent block content underdescription: >
by two spaces for consistency:- The baseline… - (if you knew nothing… + The baseline… + (if you knew nothing…
110-110
: Grammar tweak for template description
Consider semicolon for readability:-Defines the template to be used, should evaluate to `True` or `False`. +Defines the template to be used; it should evaluate to `True` or `False`.
124-133
: Indent nested list items
Sub-bullets under item 4 should be indented one additional level for proper rendering:-4. Use your Home Assistant history… - - **Probability when Bayesian sensor `on`**… - - **Probability when Bayesian sensor `off`**… +4. Use your Home Assistant history… + 1. **Probability when Bayesian sensor `on`**… + 2. **Probability when Bayesian sensor `off`**…
227-227
: Clarify inclusive/exclusive note
Good note on range inclusivity. Optionally, you could explicitly state thatabove
remains exclusive even under multiple ranges.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
source/_integrations/bayesian.markdown
(4 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/bayesian.markdown
[uncategorized] ~34-~34: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...that it is occupied by a human is high (e.g 95%, p = 0.95) if our motion sensor is ...
(E_G)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ... probability of the sensor observation (e.g motion detected) given the thing you ...
(E_G)
[uncategorized] ~36-~36: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...* the thing you are trying to estimate (e.g human-occupancy of the room). {% inclu...
(E_G)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Redirect rules - home-assistant-docs
- GitHub Check: Header rules - home-assistant-docs
- GitHub Check: Pages changed - home-assistant-docs
🔇 Additional comments (8)
source/_integrations/bayesian.markdown (8)
22-22
: Perfect introductory definition
Clear description of the Bayesian helper and its purpose; the use of code formatting forBayesian
and explanation as a virtual binary sensor is spot on.
24-24
: Good context on use cases
Illustrates real-world applications and benefits; nicely highlights both complex and reliability scenarios.
26-26
: Concise explanation of Bayes’ rule
The description of how the sensor calculates posterior probabilities is clear and accurate.
38-38
: Config flow include is correct
Includingintegrations/config_flow.md
enables the UI snippet; this matches other integrations.
50-56
: YAML example looks good
The new snippet clarifiesname
,prior
,probability_threshold
, andobservations
. Quotes around strings ensure no parsing issues.
72-72
: Threshold note is helpful
Clarifies behavior when threshold > prior; exactly as needed.
82-82
: Unique ID description is precise
Clearly warns about duplicate IDs and exception behavior.
115-119
: Config key descriptions are clear
prob_given_true
andprob_given_false
descriptions correctly explain their semantics.
Proposed change
Type of change
current
branch).current
branch).next
branch).next
branch).Additional information
Checklist
I made a change to the existing documentation and used thecurrent
branch.next
branch.Summary by CodeRabbit