Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Expand AirGradient documentation #39464

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

Merged
merged 4 commits into from
Jun 10, 2025
Merged

Conversation

joostlek
Copy link
Member

@joostlek joostlek commented Jun 10, 2025

Proposed change

Expand AirGradient 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

  • Documentation
    • Expanded AirGradient integration documentation with new sections on use cases, supported devices, functionality, updates, data intervals, actions, examples, known limitations, and troubleshooting.
    • Added example automation for CO2 notifications and clarified update procedures and polling intervals.

@home-assistant home-assistant bot added the current This PR goes into the current branch label Jun 10, 2025
Copy link

netlify bot commented Jun 10, 2025

Deploy Preview for home-assistant-docs ready!

Name Link
🔨 Latest commit 5086503
🔍 Latest deploy log https://app.netlify.com/projects/home-assistant-docs/deploys/6848702529b3750008239c2d
😎 Deploy Preview https://deploy-preview-39464--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 project configuration.

Copy link
Contributor

coderabbitai bot commented Jun 10, 2025

📝 Walkthrough

Walkthrough

The AirGradient integration documentation was expanded with new sections, including use cases, supported devices, detailed supported functionality, update mechanisms, data update intervals, example automations, known limitations, and troubleshooting guidance. Existing content was reorganized and clarified to provide more comprehensive operational and usage information.

Changes

File Change Summary
source/_integrations/airgradient.markdown Expanded documentation with new sections: use cases, supported devices, supported functionality, updates, data updates, actions, examples, known limitations, and troubleshooting. Existing sections were reorganized and clarified.

Sequence Diagram(s)

sequenceDiagram
    User->>Documentation: Consults AirGradient integration docs
    Documentation->>User: Provides use cases, supported devices, sensors, update info, examples, limitations, troubleshooting
    User->>Home Assistant: Configures AirGradient integration based on documentation
    Home Assistant->>AirGradient Device: Polls data every minute, checks for updates hourly
    Home Assistant->>User: Notifies via automation if CO2 > 1000 ppm (as per example)
Loading

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.

❤️ Share
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need 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)

  • @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 generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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: 1

🧹 Nitpick comments (2)
source/_integrations/airgradient.markdown (2)

53-57: Consider aligning header naming with Home Assistant style
Currently using “Supported functionality” → “Available sensors”. The core docs often use “Supported entities” with sub-sections “Sensors” and “Configuration entities” (no “Available” prefix).

Please verify against the documentation guidelines to ensure consistent section titles.


148-152: Known limitations list needs surrounding blank lines & minor wording tweak

  • Add a blank line after the bullet list to satisfy markdownlint (MD032).
  • Consider changing “is not able to install” → “cannot install” for conciseness.
🧰 Tools
🪛 LanguageTool

[style] ~151-~151: As a shorter alternative for ‘able to’, consider using “can not”.
Context: ...lowing limitations: - The update entity is not able to install updates automatically. You will...

(BE_ABLE_TO)

🪛 markdownlint-cli2 (0.17.2)

151-151: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

📜 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

📥 Commits

Reviewing files that changed from the base of the PR and between ac656a7 and 74bf111.

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

[style] ~151-~151: As a shorter alternative for ‘able to’, consider using “can not”.
Context: ...lowing limitations: - The update entity is not able to install updates automatically. You will...

(BE_ABLE_TO)

🪛 markdownlint-cli2 (0.17.2)
source/_integrations/airgradient.markdown

151-151: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

🔇 Additional comments (10)
source/_integrations/airgradient.markdown (10)

30-35: Section “Use cases” is well structured
Great addition—list is concise, examples are clear, and blank lines around bullets follow markdown best practices.


36-41: Supported devices list is accurate and formatted correctly
Device names are clear, and having a blank line before and after the list ensures good readability.


84-84: Available configuration entities header is consistent
Header level and placement look good; it clearly separates sensors from config entities.


103-107: Updates section clearly explains firmware workflow
Good to note the need for reboot after an update. Formatting and blank lines are correct.


108-115: Data updates section is clear and follows polling conventions
Intervals for data and firmware checks are stated precisely. Blank lines and term usage are appropriate.


116-120: Actions section is explicit
Even if no extra actions exist, having an “Actions” header prevents confusion by confirming there are none.


121-122: Examples section header is properly placed
Blank line separation is correct, making it easy to locate the examples.


127-130: Example automation description is clear
The trigger description and threshold are well explained.


131-146: YAML snippet is valid and formatted correctly
Proper fencing, indentation, and templating syntax. It’s a useful starting point for users.


160-165: Integration removal instructions are clear
Follows standard pattern; include blank line before the include statement for consistency.

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: 1

🧹 Nitpick comments (4)
source/_integrations/airgradient.markdown (4)

30-35: Consistent bullet formatting in “Use cases”
The new bullets end with periods, whereas other lists (e.g., Supported devices) omit them. For consistency, remove the trailing periods:

- - Monitor indoor and outdoor air quality.
+ - Monitor indoor and outdoor air quality
- - Warn to open windows when CO2 levels are too high.
+ - Warn to open windows when CO2 levels are too high
- - Control ventilation systems based on air quality.
+ - Control ventilation systems based on air quality

75-83: Fix grammar in configuration‐entity sensor description
The sentence “instead of set it to control locally” is awkward. Update it to:

A number of configuration entities are available as sensors to automate with if you control the device via the AirGradient dashboard instead of setting it to control locally.
🧰 Tools
🪛 LanguageTool

[grammar] ~79-~79: This phrase is duplicated. You should probably use “LED bar” only once.
Context: ...nds learning offset - Data used for the LED bar - LED bar brightness - Display temperature unit -...

(PHRASE_REPETITION)

🪛 markdownlint-cli2 (0.17.2)

76-76: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


84-102: Clarify “Available configuration entities” structure
This section partially overlaps with the preceding configuration‐entity sensors list. To reduce confusion, consider:

  • Renaming the heading to simply “Configuration entities”.
  • Grouping entities by type (number, select, switch) with subheadings.
  • Adding a brief note that these are non-sensor domains.

150-152: Refine wording and list formatting in limitations

  • Insert a blank line before the list for readability.
  • Change “is not able to install updates automatically” to “cannot install updates automatically”:
- The AirGradient integration currently has the following limitations:
- - The update entity is not able to install updates automatically. You will need to reboot the device manually after installing the update.
+ The AirGradient integration currently has the following limitations:
+
+ - The update entity cannot install updates automatically; you must reboot the device manually after installing the update.
🧰 Tools
🪛 LanguageTool

[style] ~151-~151: As a shorter alternative for ‘able to’, consider using “can not”.
Context: ...lowing limitations: - The update entity is not able to install updates automatically. You will...

(BE_ABLE_TO)

🪛 markdownlint-cli2 (0.17.2)

151-151: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

📜 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

📥 Commits

Reviewing files that changed from the base of the PR and between 74bf111 and 884e192.

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

[style] ~151-~151: As a shorter alternative for ‘able to’, consider using “can not”.
Context: ...lowing limitations: - The update entity is not able to install updates automatically. You will...

(BE_ABLE_TO)

🪛 markdownlint-cli2 (0.17.2)
source/_integrations/airgradient.markdown

151-151: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Lint Text
🔇 Additional comments (6)
source/_integrations/airgradient.markdown (6)

36-41: Supported devices section looks good
The list of compatible AirGradient models is clear and concise.


53-56: Supported functionality header is clear
The new section properly introduces the overview of entities provided by this integration.


103-107: Updates section is accurate
Clearly explains the firmware update entity and reboot requirement.


108-115: Data updates polling intervals are clear
Minute-based data fetch and hourly update checks are documented correctly.


116-120: Actions section is correct
States that no additional actions exist beyond the entities.


153-159: Troubleshooting steps look resolved
The previous typo has been fixed, and the steps are clear and actionable.

Comment on lines +131 to +146
```yaml
automation:
- alias: "Notify when CO2 level is too high"
triggers:
- trigger: numeric_state
entity_id: sensor.airgradient_carbon_dioxide
above: 1000

actions:
- action: notify.mobile_app_your_device
data:
title: "High CO2 Level Alert"
message: >
The CO2 level is too high at {{ states('sensor.airgradient_carbon_dioxide') }} ppm.
Please consider ventilating the room.
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Invalid YAML example for automations
The snippet uses incorrect keys (triggers:, trigger:, actions:, action:) and should align with Home Assistant’s schema. For example:

- automation:
-   - alias: "Notify when CO2 level is too high"
-     triggers:
-       - trigger: numeric_state
-         entity_id: sensor.airgradient_carbon_dioxide
-         above: 1000
-
-     actions:
-       - action: notify.mobile_app_your_device
-         data:
-           title: "High CO2 Level Alert"
-           message: >
-             The CO2 level is too high at {{ states('sensor.airgradient_carbon_dioxide') }} ppm.
-             Please consider ventilating the room.
+ automation:
+   - alias: "Notify when CO2 level is too high"
+     trigger:
+       - platform: numeric_state
+         entity_id: sensor.airgradient_carbon_dioxide
+         above: 1000
+     action:
+       - service: notify.mobile_app_your_device
+         data:
+           title: "High CO2 Level Alert"
+           message: >-
+             The CO2 level is too high at {{ states('sensor.airgradient_carbon_dioxide') }} ppm.
+             Please consider ventilating the room.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```yaml
automation:
- alias: "Notify when CO2 level is too high"
triggers:
- trigger: numeric_state
entity_id: sensor.airgradient_carbon_dioxide
above: 1000
actions:
- action: notify.mobile_app_your_device
data:
title: "High CO2 Level Alert"
message: >
The CO2 level is too high at {{ states('sensor.airgradient_carbon_dioxide') }} ppm.
Please consider ventilating the room.
```
automation:
- alias: "Notify when CO2 level is too high"
trigger:
- platform: numeric_state
entity_id: sensor.airgradient_carbon_dioxide
above: 1000
action:
- service: notify.mobile_app_your_device
data:
title: "High CO2 Level Alert"
message: >-
The CO2 level is too high at {{ states('sensor.airgradient_carbon_dioxide') }} ppm.
Please consider ventilating the room.
🤖 Prompt for AI Agents
In source/_integrations/airgradient.markdown around lines 131 to 146, the YAML
keys for the automation are incorrect; specifically, 'triggers' should be
'trigger', and 'actions' should be 'action' to match Home Assistant's schema.
Fix the YAML by using singular keys 'trigger' and 'action' instead of plural
forms, ensuring the structure aligns with Home Assistant's expected automation
format.

@c0ffeeca7 c0ffeeca7 marked this pull request as draft June 10, 2025 17:37
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

♻️ Duplicate comments (1)
source/_integrations/airgradient.markdown (1)

131-148: 🛠️ Refactor suggestion

Fix YAML example and wrap in raw tags
The automation example still uses plural keys (triggers, actions) and action: instead of service:, and it lacks a proper {% raw %} wrapper—this will break the rendered docs.

-{% endraw %}
-```yaml
-automation:
-  - alias: "Notify when CO2 level is too high"
-    triggers:
-      - trigger: numeric_state
-        entity_id: sensor.airgradient_carbon_dioxide
-        above: 1000
-
-    actions:
-      - action: notify.mobile_app_your_device
-        data:
-          title: "High CO2 Level Alert"
-          message: >
-            The CO2 level is too high at {{ states('sensor.airgradient_carbon_dioxide') }} ppm.
-            Please consider ventilating the room.
-```
+{% raw %}
+```yaml
+automation:
+  - alias: "Notify when CO2 level is too high"
+    trigger:
+      - platform: numeric_state
+        entity_id: sensor.airgradient_carbon_dioxide
+        above: 1000
+    action:
+      - service: notify.mobile_app_your_device
+        data:
+          title: "High CO2 Level Alert"
+          message: >-
+            The CO2 level is too high at {{ states('sensor.airgradient_carbon_dioxide') }} ppm.
+            Please consider ventilating the room.
+```
+{% endraw %}
🧹 Nitpick comments (2)
source/_integrations/airgradient.markdown (2)

30-35: Refine 'Use cases' bullet phrasing for consistency
The second item could read “Warn you to open windows when CO2 levels are too high” to match the imperative tone of the other bullets.

- - Warn to open windows when CO2 levels are too high.
+ - Warn you to open windows when CO2 levels are too high.

103-106: Consider elaborating on the update entity usage
It may be helpful to include the actual entity ID or a sample service call (e.g., update.async_install) so users know how to trigger firmware updates via Home Assistant.

📜 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

📥 Commits

Reviewing files that changed from the base of the PR and between 884e192 and 89ddb7c.

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

53-56: Supported functionality section looks good
Clear header and overview; the structure aligns with Home Assistant docs conventions.

@c0ffeeca7 c0ffeeca7 marked this pull request as ready for review June 10, 2025 17:49
Copy link
Contributor

@c0ffeeca7 c0ffeeca7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @joostlek 👍

@c0ffeeca7 c0ffeeca7 merged commit f68a930 into home-assistant:current Jun 10, 2025
6 of 7 checks passed
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

♻️ Duplicate comments (1)
source/_integrations/airgradient.markdown (1)

131-148: ⚠️ Potential issue

Invalid YAML example for automations
The example still uses the plural keys triggers/actions and action: instead of HA’s required trigger/action and service: fields. This will not parse correctly.

-    triggers:
-      - trigger: numeric_state
+    trigger:
+      - platform: numeric_state
       entity_id: sensor.airgradient_carbon_dioxide
       above: 1000

-    actions:
-      - action: notify.mobile_app_your_device
+    action:
+      - service: notify.mobile_app_your_device
       data:
         title: "High CO2 Level Alert"
         message: >-
           The CO2 level is too high at {{ states('sensor.airgradient_carbon_dioxide') }} ppm.
           Please consider ventilating the room.
🧹 Nitpick comments (3)
source/_integrations/airgradient.markdown (3)

53-59: Consider simplifying heading names
To align with Home Assistant docs conventions, you might drop “Available” and rename:

## Supported functionality

### Sensors

instead of “### Available sensors.”


84-90: Align heading to standard schema
Similarly, change:

### Available configuration entities

to:

### Configuration entities

This keeps consistency with other integrations.


154-156: Minor style and formatting nits in limitations list

  • Surround the list with blank lines for better markdown compliance (MD032).
  • Use “cannot” instead of “not able to” for brevity.
-The AirGradient integration currently has the following limitations:
- - The update entity is not able to install updates automatically. You will need to reboot the device manually after installing the update.
+The AirGradient integration currently has the following limitations:
+
+- The update entity cannot install updates automatically. You will need to reboot the device manually after installing the update.
+
🧰 Tools
🪛 LanguageTool

[style] ~155-~155: As a shorter alternative for ‘able to’, consider using “can not”.
Context: ...lowing limitations: - The update entity is not able to install updates automatically. You will...

(BE_ABLE_TO)

🪛 markdownlint-cli2 (0.17.2)

155-155: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

📜 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

📥 Commits

Reviewing files that changed from the base of the PR and between 89ddb7c and 5086503.

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

[style] ~155-~155: As a shorter alternative for ‘able to’, consider using “can not”.
Context: ...lowing limitations: - The update entity is not able to install updates automatically. You will...

(BE_ABLE_TO)

🪛 markdownlint-cli2 (0.17.2)
source/_integrations/airgradient.markdown

155-155: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

⏰ 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 (2)
source/_integrations/airgradient.markdown (2)

30-35: Use cases section looks great
The new “Use cases” header and bullet points clearly illustrate practical scenarios for this integration.


36-41: Supported devices list is accurate and well-formatted
Good enumeration of the DIY, Indoor, and Outdoor AirGradient models.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
current This PR goes into the current branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants