Skip to content
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

Document sensors and diagnostic sensors in NUT #38163

Open
wants to merge 6 commits into
base: current
Choose a base branch
from

Conversation

tdfountain
Copy link
Contributor

@tdfountain tdfountain commented Mar 23, 2025

Proposed change

The current instructions for NUT do not generally define the sensors or diagnostic sensors. Add a new "Supported functionality" section and sub-sections for both "Sensors" and "Diagnostic sensors". Create lists of all available sensors including the name, units (if specified) and a brief description. Use the NUT documentation as the brief description as much as possible to avoid confusing users, though those descriptions are not always the most helpful.

Move and rewrite the special "Status" virtual sensor description for easier readability.

Dynamically created sensors per outlet are listed separately since the name is based on the end user's configuration. Provide a link to the official NUT document describing variable names.

For diagnostic sensors, explain that most sensors are disabled by default and provide a link to instructions for enabling a sensor. Use same terminology for consistency with NUT documentation. Include a note regarding "opaque by mfg" used in the NUT documentation.

Type of change

  • Spelling, grammar or other readability improvements (current branch).
  • Adjusted missing or incorrect information in the current documentation (current branch).
  • Added documentation for a new integration I'm adding to Home Assistant (next branch).
  • Added documentation for a new feature I'm adding to Home Assistant (next branch).
  • Removed stale or deprecated documentation.

Additional information

  • Link to parent pull request in the codebase:
  • Link to parent pull request in the Brands repository:
  • This PR fixes or closes issue: fixes #

Checklist

  • This PR uses the correct branch, based on one of the following:
    • I made a change to the existing documentation and used the current branch.
    • I made a change that is related to an upcoming version of Home Assistant and used the next branch.
  • The documentation follows the Home Assistant documentation standards.

Summary by CodeRabbit

Summary by CodeRabbit

  • Documentation
    • Introduced a new "Supported functionality" section for the NUT integration that clearly details sensor metrics such as alarms, battery charge, charging status, input current, and various outlet metrics, along with their descriptions.
    • Added a new section for "Diagnostic sensors" providing insights into performance metrics like ambient temperature and battery capacity, with instructions for enabling them.
    • Removed the legacy "UPS Status - human-readable version" section to enhance clarity and detail in the integration's functionality.

@tdfountain tdfountain requested a review from bdraco as a code owner March 23, 2025 22:20
@home-assistant home-assistant bot added the current This PR goes into the current branch label Mar 23, 2025
Copy link

netlify bot commented Mar 23, 2025

Deploy Preview for home-assistant-docs ready!

Name Link
🔨 Latest commit 3e536c2
🔍 Latest deploy log https://app.netlify.com/sites/home-assistant-docs/deploys/67e352913bfeea000898492e
😎 Deploy Preview https://deploy-preview-38163--home-assistant-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

coderabbitai bot commented Mar 23, 2025

📝 Walkthrough

Walkthrough

The changes introduce a new "Supported functionality" section in the NUT integration documentation, detailing the capabilities of the integration by outlining available sensor metrics. This includes general sensors, such as alarms and battery charge, as well as diagnostic sensors like ambient temperature and battery capacity, each with descriptions. The previous "UPS Status - human-readable version" section has been removed, enhancing the document's clarity and organization.

Changes

File Change Summary
source/_integrations/nut.markdown Added a "Supported functionality" section with detailed sensor tables for general and diagnostic sensors, and removed the old "UPS Status" section.

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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/nut.markdown (4)

50-57: New "Supported functionality" Section Introduced
The new section clearly introduces the supported sensors and diagnostic sensors for the NUT integration. The note block succinctly explains that only the available sensors (as reported by the NUT server) are added to Home Assistant.
Consider adding a brief explanation or a link to further details on what “variables” are (e.g., linking to the official NUT documentation) to further assist end users in understanding the scope.


58-81: Enhanced Sensors Documentation
The "Sensors" section now presents a clear description alongside a well-formatted table of available sensor types. The table is informative and covers a broad set of measurements.

  • Suggestion: The "Watts" sensor (line 78) has an empty description. It may help users if a short explanation (e.g., "Power consumption" or similar) is added.
  • Verification: Also, please verify that the sensor names are sorted alphabetically as indicated by the PR objectives.

83-96: Outlet Sensors Table Consistency
The table for outlet sensors is comprehensive and clearly outlines the sensor details for individual outlets.

  • Suggestion: To fully align with the PR objective of alphabetical ordering, please double-check that the outlet sensor rows are arranged alphabetically by name.

97-112: Comprehensive Diagnostic Sensors Section
This section provides detailed information on diagnostic sensors, including guidance on which sensors are enabled by default and how to enable others. The accompanying note about "opaque by mfg" is especially helpful for understanding manufacturer-specific values.

  • Suggestion: As with the "Sensors" section, consider verifying and, if necessary, reordering the diagnostic sensors in alphabetical order to maintain consistency with PR objectives.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c29e555 and c2d30aa.

📒 Files selected for processing (1)
  • source/_integrations/nut.markdown (1 hunks)

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (2)
source/_integrations/nut.markdown (2)

58-82: Clear and Concise Sensors Section

The "Sensors" subsection is well structured. It starts with a brief description and then presents a neatly formatted table listing the sensor name, unit, and description. One minor suggestion: consider adding a short description for the "Watts" sensor if a meaningful metric exists.


113-228: Comprehensive Diagnostic Sensors Table

This extensive table lists diagnostic sensors along with their units and descriptions. The alphabetical ordering (with minor grouping based on naming conventions) aids readability. As a nitpick, it might be worth reviewing individual sensor descriptions for completeness and consistency.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c2d30aa and f41c8cc.

📒 Files selected for processing (1)
  • source/_integrations/nut.markdown (1 hunks)
🔇 Additional comments (4)
source/_integrations/nut.markdown (4)

50-57: New "Supported functionality" Section Added

This block cleanly introduces the new section that outlines the capabilities of the NUT integration. The note block immediately provides context on how variables are retrieved from the NUT server. Overall, this addition enhances the documentation clarity.


83-96: Outlet Sensor Details and External Reference

The text following the sensors table clearly differentiates sensors provided per outlet and explains their specific utility. Including the link to the official NUT variable names documentation helps users find more detailed information.


97-111: Diagnostic Sensors Description and Note

The diagnostic sensors section is introduced well. The description explains that these sensors are disabled by default (to reduce storage overhead) and the accompanying note clarifies the "opaque by mfg" terminology effectively.


229-235: Individually Monitored Outlet Sensors

The table for outlet-specific diagnostic sensors is clear and the use of backticks for the placeholder name improves clarity. This small, focused table complements the main diagnostic sensors list very well.

@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant bot marked this pull request as draft March 24, 2025 10:36
@tdfountain tdfountain marked this pull request as ready for review March 26, 2025 00:54
@home-assistant home-assistant bot requested a review from frenck March 26, 2025 00:55
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (2)
source/_integrations/nut.markdown (2)

92-103: Clear Diagnostic Sensors Section with Minor Typo

The "Diagnostic sensors" section is well introduced with an important note that details the default-disabled state of most diagnostic sensors. Please fix the typo on line 98 ("diganostic") to "diagnostic" to maintain consistency.

-Most of this integration's diagnostic sensors are disabled by default
-to reduce storage overhead for Home Assistant.  The diganostic sensors
+Most of this integration's diagnostic sensors are disabled by default
+to reduce storage overhead for Home Assistant.  The diagnostic sensors

111-225: Comprehensive Diagnostic Sensor List with Minor Typos

This section provides an extensive and detailed list of diagnostic sensors, which is valuable for users needing deep insights. A few minor corrections are suggested for clarity:

  • Line 116: Correct the spacing error in the phrase "t he thresholds".

    - **Ambient temperature status**\*: Ambient temperature status relative to t he thresholds
    + **Ambient temperature status**\*: Ambient temperature status relative to the thresholds
  • Line 174: Remove the unnecessary comma for smoother reading.

    - **Low battery voltage (V)**: Minimum battery voltage, that triggers FSD status
    + **Low battery voltage (V)**: Minimum battery voltage that triggers FSD status

Additionally, please review any similar minor duplications flagged by static analysis (e.g., lines 68, 83–85, 170, and 218) to ensure consistency and clarity throughout the list.

🧰 Tools
🪛 LanguageTool

[grammar] ~115-~115: This phrase is duplicated. You should probably use “Ambient temperature” only once.
Context: ...holds - Ambient temperature (°C)*: Ambient temperature - Ambient temperature status*: Ambient temperature status ...

(PHRASE_REPETITION)


[grammar] ~116-~116: Check that the noun ‘thresholds’ after the pronoun ‘he’ is correct. You may need to use a different part of speech, or use ‘the’ instead.
Context: ...mbient temperature status relative to t he thresholds - Apparent power (VA): Current valu...

(PRP_VB)


[duplication] ~170-~170: Possible typo: you repeated a word.
Context: ... Interval to wait before restarting the load - Load shutdown timer (secs): Time before th...

(ENGLISH_WORD_REPEAT_RULE)


[typographical] ~175-~175: Make sure that the comma (,) is correct. Do not use a comma before a dependent clause that starts with ‘that’.
Context: ...y voltage (V)**: Minimum battery voltage, that triggers FSD status - **Low voltage tra...

(COMMA_THAT_NOUN)


[duplication] ~218-~218: Possible typo: you repeated a word.
Context: ...: Interval to wait before rebooting the UPS - UPS shutdown delay (secs): Interval to wa...

(ENGLISH_WORD_REPEAT_RULE)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f41c8cc and d684d27.

📒 Files selected for processing (1)
  • source/_integrations/nut.markdown (1 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/nut.markdown

[duplication] ~68-~68: Possible typo: you repeated a word.
Context: ...nt - Input load (%): Load on (ePDU) input - Input voltage (V): Input voltage - **Load (...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~83-~83: Possible typo: you repeated a word.
Context: ...et NAME current (A)**: Current of named outlet - Outlet NAME description: Description of name...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~84-~84: Possible typo: you repeated a word.
Context: ...AME description**: Description of named outlet - Outlet NAME power (VA): Apparent power of na...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~85-~85: Possible typo: you repeated a word.
Context: ...E power (VA)**: Apparent power of named outlet - Outlet NAME real power (W): Real power of na...

(ENGLISH_WORD_REPEAT_RULE)


[grammar] ~115-~115: This phrase is duplicated. You should probably use “Ambient temperature” only once.
Context: ...holds - Ambient temperature (°C)*: Ambient temperature - Ambient temperature status*: Ambient temperature status ...

(PHRASE_REPETITION)


[grammar] ~116-~116: Check that the noun ‘thresholds’ after the pronoun ‘he’ is correct. You may need to use a different part of speech, or use ‘the’ instead.
Context: ...mbient temperature status relative to t he thresholds - Apparent power (VA): Current valu...

(PRP_VB)


[duplication] ~170-~170: Possible typo: you repeated a word.
Context: ... Interval to wait before restarting the load - Load shutdown timer (secs): Time before th...

(ENGLISH_WORD_REPEAT_RULE)


[typographical] ~175-~175: Make sure that the comma (,) is correct. Do not use a comma before a dependent clause that starts with ‘that’.
Context: ...y voltage (V)**: Minimum battery voltage, that triggers FSD status - **Low voltage tra...

(COMMA_THAT_NOUN)


[duplication] ~218-~218: Possible typo: you repeated a word.
Context: ...: Interval to wait before rebooting the UPS - UPS shutdown delay (secs): Interval to wa...

(ENGLISH_WORD_REPEAT_RULE)

🔇 Additional comments (7)
source/_integrations/nut.markdown (7)

50-57: Add "Supported functionality" Section

The new section clearly outlines the integration’s capabilities with an informative note block. The formatting is consistent with Home Assistant documentation standards and replaces the removed section appropriately.


58-61: Introduce "Sensors" Subsection

The "Sensors" subsection is introduced clearly with a brief description that sets the context for the following sensor list. The content is succinct and meets the documentation objectives.


62-76: Organized Sensor List

The sensors are presented in a bullet list that appears to be in alphabetical order, which aligns with the PR objective to organize them by name. The relationship between the virtual "Status" and its corresponding "Status data" sensor is also clearly explained.

🧰 Tools
🪛 LanguageTool

[duplication] ~68-~68: Possible typo: you repeated a word.
Context: ...nt - Input load (%): Load on (ePDU) input - Input voltage (V): Input voltage - **Load (...

(ENGLISH_WORD_REPEAT_RULE)


80-87: Outlet Sensor Details

The outlet sensors use "Outlet NAME" as a placeholder effectively, indicating that these items are dynamically created based on configuration. This approach is clear and user friendly.

🧰 Tools
🪛 LanguageTool

[duplication] ~83-~83: Possible typo: you repeated a word.
Context: ...et NAME current (A)**: Current of named outlet - Outlet NAME description: Description of name...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~84-~84: Possible typo: you repeated a word.
Context: ...AME description**: Description of named outlet - Outlet NAME power (VA): Apparent power of na...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~85-~85: Possible typo: you repeated a word.
Context: ...E power (VA)**: Apparent power of named outlet - Outlet NAME real power (W): Real power of na...

(ENGLISH_WORD_REPEAT_RULE)


88-91: Additional Information with Documentation Link

This note provides a helpful link to official variable names documentation, enhancing user understanding regarding the available sensor values. The reference is clear and well integrated.


105-109: Diagnostic Sensor Value Note

The note block explaining manufacturer-specific ("opaque by mfg") sensor values is concise and helpful. It clearly informs users about potential variations, which is important for troubleshooting.


226-229: Outlet Diagnostic Sensors

The additional diagnostic sensor for individually monitored outlets is separated into its own section. The use of the "Outlet NAME" placeholder continues to clearly signal dynamically generated sensor names, which maintains consistency with the rest of the documentation.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (3)
source/_integrations/nut.markdown (3)

58-91: Sensors Subsection Enhancement
This subsection provides a comprehensive list of available sensors. A couple of minor improvements to consider:

  • For Input load (%) (line 68), the phrase "Load on (ePDU) input" may be refined to avoid any ambiguity for some readers.
  • In the outlet sensor entries (lines 83–86), the repeated use of "named outlet" could be streamlined—for example, by rephrasing to "Current measured" and "Outlet description" to reduce redundancy.
🧰 Tools
🪛 LanguageTool

[duplication] ~68-~68: Possible typo: you repeated a word.
Context: ...nt - Input load (%): Load on (ePDU) input - Input voltage (V): Input voltage - **Load (...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~83-~83: Possible typo: you repeated a word.
Context: ...et NAME current (A)**: Current of named outlet - Outlet NAME description: Description of name...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~84-~84: Possible typo: you repeated a word.
Context: ...AME description**: Description of named outlet - Outlet NAME power (VA): Apparent power of na...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~85-~85: Possible typo: you repeated a word.
Context: ...E power (VA)**: Apparent power of named outlet - Outlet NAME real power (W): Real power of na...

(ENGLISH_WORD_REPEAT_RULE)


113-116: Ambient Temperature Sensor Descriptions
The descriptions for Ambient temperature (°C) and Ambient temperature status are clear but a bit repetitive. Consider rephrasing them to, for example, "Measured ambient temperature" and "Temperature status relative to thresholds" to tighten the language.

🧰 Tools
🪛 LanguageTool

[grammar] ~115-~115: This phrase is duplicated. You should probably use “Ambient temperature” only once.
Context: ...holds - Ambient temperature (°C)*: Ambient temperature - Ambient temperature status*: Ambient temperature status ...

(PHRASE_REPETITION)


168-171: Refine Delay Sensor Wording
For sensors such as Load restart delay (secs) (line 169) and UPS reboot delay (secs) (line 217), the descriptive phrasing ("Interval to wait before…") is a bit redundant when paired with the sensor names. A more concise wording (e.g., "Time before restart" or "Reboot wait time") could improve clarity.

Also applies to: 217-218

🧰 Tools
🪛 LanguageTool

[duplication] ~169-~169: Possible typo: you repeated a word.
Context: ... Interval to wait before restarting the load - Load shutdown timer (secs): Time before th...

(ENGLISH_WORD_REPEAT_RULE)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d684d27 and 3e536c2.

📒 Files selected for processing (1)
  • source/_integrations/nut.markdown (1 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/nut.markdown

[duplication] ~68-~68: Possible typo: you repeated a word.
Context: ...nt - Input load (%): Load on (ePDU) input - Input voltage (V): Input voltage - **Load (...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~83-~83: Possible typo: you repeated a word.
Context: ...et NAME current (A)**: Current of named outlet - Outlet NAME description: Description of name...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~84-~84: Possible typo: you repeated a word.
Context: ...AME description**: Description of named outlet - Outlet NAME power (VA): Apparent power of na...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~85-~85: Possible typo: you repeated a word.
Context: ...E power (VA)**: Apparent power of named outlet - Outlet NAME real power (W): Real power of na...

(ENGLISH_WORD_REPEAT_RULE)


[grammar] ~115-~115: This phrase is duplicated. You should probably use “Ambient temperature” only once.
Context: ...holds - Ambient temperature (°C)*: Ambient temperature - Ambient temperature status*: Ambient temperature status ...

(PHRASE_REPETITION)


[duplication] ~169-~169: Possible typo: you repeated a word.
Context: ... Interval to wait before restarting the load - Load shutdown timer (secs): Time before th...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~217-~217: Possible typo: you repeated a word.
Context: ...: Interval to wait before rebooting the UPS - UPS shutdown delay (secs): Interval to wa...

(ENGLISH_WORD_REPEAT_RULE)

🔇 Additional comments (4)
source/_integrations/nut.markdown (4)

50-51: New Section Addition: "Supported functionality"
The addition of the "Supported functionality" section clearly groups sensor-related details for the NUT integration, enhancing the overall organization and readability of the documentation.


52-56: Note Block Clarity
The note block explains that the integration only adds sensors available on your device via the NUT protocol. It’s concise and informative.


92-110: Diagnostic Sensors Section Structure
The "Diagnostic sensors" section is well organized. The note blocks clearly state that most diagnostic sensors are disabled by default and explain the manufacturer-specific ("opaque by mfg") values, which is very helpful for users.


290-295: Overall Documentation Consistency
The updated documentation overall adheres well to Home Assistant’s standards. The segmentation into supported devices, functionality, sensor categories, and diagnostic sensors is logical. Please verify that the ordering (alphabetically or by grouping) of sensor entries aligns with both the official NUT documentation and Home Assistant’s guidelines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
current This PR goes into the current branch
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants