-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Bayesian config flow #35703
Bayesian config flow #35703
Conversation
✅ Deploy Preview for home-assistant-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
📝 Walkthrough📝 Walkthrough📝 Walkthrough📝 WalkthroughWalkthroughThe documentation for the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI
participant YAML
participant BayesianSensor
User->>UI: Configure Bayesian Sensor
User->>YAML: Define probabilities
UI->>BayesianSensor: Set up sensor with parameters
YAML->>BayesianSensor: Load configuration
BayesianSensor->>BayesianSensor: Calculate posterior probability
BayesianSensor->>User: Notify event detection
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (4)
source/_integrations/bayesian.markdown (4)
21-25
: LGTM! Clear and informative introduction.The introduction effectively explains the Bayesian sensor's purpose and operation. The distinction between UI (percentages) and YAML (0-1) probability formats is particularly helpful for users.
Consider adding an example to illustrate the UI vs YAML probability difference:
-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, importantly YAML uses probabilities of `0` to `1` (e.g., 0.5) whereas UI uses percentages (e.g., 50%).
109-113
: Clarify probability descriptionsThe descriptions for
prob_given_true
andprob_given_false
could be more precise to help users understand these crucial parameters.Consider this clarification:
- description: > - Assuming the bayesian binary_sensor is `on`, the probability the entity state is occurring. + description: > + The probability that this observation would be true when the event (that the Bayesian sensor detects) is occurring. - description: Assuming the bayesian binary_sensor is `off` the probability the entity state is occurring. + description: The probability that this observation would be true when the event (that the Bayesian sensor detects) is not occurring.🧰 Tools
🪛 LanguageTool
[uncategorized] ~109-~109: Possible missing preposition found.
Context: ... binary_sensor ison
, the probability the entity state is occurring. requir...(AI_HYDRA_LEO_MISSING_OF)
120-127
: Fix grammar and enhance clarityThe probability estimation guidance contains helpful information but needs minor improvements.
- Fix grammar in line 127:
-increasing `probability_threshold:` and vice-versa. +increasing `probability_threshold:` and vice versa.
- Consider adding a brief explanation about why extreme values (0 and 1) should be avoided:
-1. Avoid `0` and `1`, these will mess with the odds and are rarely true - sensors fail. +1. Avoid `0` and `1`, as these extreme values can skew the calculations significantly. In real-world scenarios, no sensor is 100% reliable, so using values like `0.001` or `0.999` is more realistic.🧰 Tools
🪛 LanguageTool
[grammar] ~127-~127: The expression “vice versa” is spelled without hyphens.
Context: ...increasingprobability_threshold:
and vice-versa. ## Full examples These are a number ...(VICE_VERSA)
223-277
: Improve formatting and clarity of the bins exampleThe bins example is comprehensive but could benefit from improved readability.
- Consider grouping related observations with comments:
binary_sensor: name: "Bins need bringing in" platform: "bayesian" prior: 0.14 # bins are left out for usually about one day a week probability_threshold: 0.5 observations: + # Signal strength observations - platform: "numeric_state" entity_id: "sensor.signal_strength" ... + # Bin collection status observations - platform: "state" entity_id: "sensor.bin_collection" ...
- Add a summary comment at the start explaining the probability distributions:
# This example combines: # 1. Signal strength observations (5 ranges with probabilities summing to 1.0) # 2. Bin collection status (3 states with probabilities summing to 1.0)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
source/_integrations/bayesian.markdown
(6 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/bayesian.markdown
[style] ~58-~58: 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] ~66-~66: Consider adding a comma.
Context: ...the threshold is higher than the prior
then the default state will be off
requi...
(IF_THEN_COMMA)
[uncategorized] ~109-~109: Possible missing preposition found.
Context: ... binary_sensor is on
, the probability the entity state is occurring. requir...
(AI_HYDRA_LEO_MISSING_OF)
[grammar] ~127-~127: The expression “vice versa” is spelled without hyphens.
Context: ...increasing probability_threshold:
and vice-versa. ## Full examples These are a number ...
(VICE_VERSA)
[style] ~219-~219: The words ‘observed’ and ‘observation’ are quite similar. Consider replacing ‘observed’ with a different word.
Context: ... a value that has not been specified is observed, then the observation will be ignored a...
(VERB_NOUN_SENT_LEVEL_REP)
git history issues, deleting and re-opening |
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
bayesian
binary sensor platform to improve clarity and detail.