Skip to content

Add sensor platform to smhi #39307

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 2 commits into from
Jul 16, 2025
Merged

Add sensor platform to smhi #39307

merged 2 commits into from
Jul 16, 2025

Conversation

gjohansson-ST
Copy link
Member

@gjohansson-ST gjohansson-ST commented May 29, 2025

Proposed change

SSIA

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

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 and restructured the SMHI integration documentation.
    • Updated supported platforms to include "Sensor."
    • Added an important note about location restrictions with a link to geographic details.
    • Introduced separate sections for "Weather" and "Sensors," including a table of new sensor entities and descriptions.
    • Updated the API documentation link.
    • Added instructions for removing the integration.

@home-assistant home-assistant bot added has-parent This PR has a parent PR in another repo next This PR goes into the next branch labels May 29, 2025
Copy link

netlify bot commented May 29, 2025

Deploy Preview for home-assistant-docs ready!

Name Link
🔨 Latest commit 663dc8b
🔍 Latest deploy log https://app.netlify.com/projects/home-assistant-docs/deploys/683be06db48f9a0008f51b0a
😎 Deploy Preview https://deploy-preview-39307--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 May 29, 2025

📝 Walkthrough

Walkthrough

The SMHI integration documentation was expanded and reorganized. New sections for weather and sensor entities were added, including a table of available sensors. Location restrictions and API documentation links were updated. Device type listings were removed, and a section on removing the integration was introduced.

Changes

File Change Summary
source/_integrations/smhi.markdown Expanded, restructured documentation; added sensor and weather sections, updated links, new removal info

Sequence Diagram(s)

No sequence diagram generated since the changes are limited to documentation updates.


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/smhi.markdown (2)

14-14: Consistent alphabetical ordering for platforms (optional)
Currently the platforms are listed as:

ha_platforms:
  - weather
  - sensor

For consistency with other integrations, consider alphabetizing the list:

-ha_platforms:
-  - weather
-  - sensor
+ha_platforms:
+  - sensor
+  - weather

38-47: Refine sensor table formatting
A few minor fixes to the table rows—remove the stray space before the period and hyphenate compound adjectives:

-| Thunder probability       | %                 | Probability of thunder .                                                                                                    |
+| Thunder probability       | %                 | Probability of thunder.                                                                                                     |
-| Low cloud coverage        | %                 | Mean value of low level cloud cover.                                                                                        |
+| Low cloud coverage        | %                 | Mean value of low-level cloud cover.                                                                                        |
-| Medium cloud coverage     | %                 | Mean value of medium level cloud cover.                                                                                     |
+| Medium cloud coverage     | %                 | Mean value of medium-level cloud cover.                                                                                     |
-| High cloud coverage       | %                 | Mean value of high level cloud cover.                                                                                       |
+| High cloud coverage       | %                 | Mean value of high-level cloud cover.                                                                                       |
🧰 Tools
🪛 LanguageTool

[uncategorized] ~42-~42: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ... | % | Mean value of low level cloud cover. ...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


[uncategorized] ~44-~44: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ... | % | Mean value of high level cloud cover. ...

(EN_COMPOUND_ADJECTIVE_INTERNAL)

📜 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 174378f and 7f065aa.

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

[uncategorized] ~42-~42: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ... | % | Mean value of low level cloud cover. ...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


[uncategorized] ~44-~44: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ... | % | Mean value of high level cloud cover. ...

(EN_COMPOUND_ADJECTIVE_INTERNAL)

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

6-6: Add “Sensor” category
Including “Sensor” under ha_category correctly surfaces this integration in the Sensor category in the documentation.


20-20: Introduce bold integration term
The rephrased introduction uses the recommended bold‐term style for integrations and reads clearly.


30-33: New “Weather” section
The Weather section is well scoped and clearly explains the entity’s capabilities.


34-37: New “Sensors” section
Great addition of the Sensors section describing the extra entities.


48-48: Confirm default‐off sensors note
The note that cloud sensors are not enabled by default is clear and accurate.


52-53: Updated API documentation link
The link to the SMHI API docs now points to the introduction page. This looks correct.


54-56: Add “Remove the integration” section
The new section and inclusion of the standard remove‐device snippet follow documentation conventions.

Comment on lines 22 to 26
{% important %}

Only location close to Sweden can be added. See [SMHI.se area](https://opendata.smhi.se/metfcst/pmp/geographic_area) for more details what locations are supported.

- Weather
{% endimportant %}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Fix grammar in the important note
The note has a few grammatical issues—use the plural “locations” and improve the preposition.

-{% important %}
-Only location close to Sweden can be added. See [SMHI.se area](https://opendata.smhi.se/metfcst/pmp/geographic_area) for more details what locations are supported.
-{% endimportant %}
+{% important %}
+Only locations close to Sweden can be added. See [SMHI.se area](https://opendata.smhi.se/metfcst/pmp/geographic_area) for more details on which locations are supported.
+{% endimportant %}
📝 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
{% important %}
Only location close to Sweden can be added. See [SMHI.se area](https://opendata.smhi.se/metfcst/pmp/geographic_area) for more details what locations are supported.
- Weather
{% endimportant %}
{% important %}
Only locations close to Sweden can be added. See [SMHI.se area](https://opendata.smhi.se/metfcst/pmp/geographic_area) for more details on which locations are supported.
{% endimportant %}
🤖 Prompt for AI Agents
In source/_integrations/smhi.markdown around lines 22 to 26, the important note
contains grammatical errors. Change "Only location close to Sweden can be added"
to "Only locations close to Sweden can be added" and improve the preposition by
replacing "close to Sweden" with "near Sweden" or "in the vicinity of Sweden"
for better clarity and correctness.

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, @gjohansson-ST 👍

@c0ffeeca7 c0ffeeca7 added the awaits-parent Awaits the merge of an parent PR label Jun 1, 2025
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/smhi.markdown (2)

22-26: Improve grammar and clarity in the important note
The note reads a bit awkwardly—let’s add a preposition and refine “close to” to “near” for better readability.

-{% important %}
-Only locations close to Sweden can be added. See [SMHI.se area](https://opendata.smhi.se/metfcst/pmp/geographic_area) for more details which locations are supported.
-{% endimportant %}
+{% important %}
+Only locations near Sweden can be added. See [SMHI.se area](https://opendata.smhi.se/metfcst/pmp/geographic_area) for more details on which locations are supported.
+{% endimportant %}

42-44: Hyphenate compound adjectives in cloud coverage descriptions
Use hyphens for “low-level,” “medium-level,” and “high-level” to conform with English grammar rules.

-| Low cloud coverage        | %                 | Mean value of low level cloud cover.                                                                                       
+| Low cloud coverage        | %                 | Mean value of low-level cloud cover.                                                                                       
-| Medium cloud coverage     | %                 | Mean value of medium level cloud cover.                                                                                    
+| Medium cloud coverage     | %                 | Mean value of medium-level cloud cover.                                                                                    
-| High cloud coverage       | %                 | Mean value of high level cloud cover.                                                                                      
+| High cloud coverage       | %                 | Mean value of high-level cloud cover.                                                                                      
🧰 Tools
🪛 LanguageTool

[uncategorized] ~42-~42: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ... | % | Mean value of low level cloud cover. ...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


[uncategorized] ~44-~44: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ... | % | Mean value of high level cloud cover. ...

(EN_COMPOUND_ADJECTIVE_INTERNAL)

📜 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 7f065aa and 663dc8b.

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

[uncategorized] ~42-~42: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ... | % | Mean value of low level cloud cover. ...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


[uncategorized] ~44-~44: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ... | % | Mean value of high level cloud cover. ...

(EN_COMPOUND_ADJECTIVE_INTERNAL)

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

6-6: Addition of "Sensor" category looks consistent
Including - Sensor under ha_category aligns with Home Assistant’s categorization for this integration.


14-14: Platform "sensor" declared correctly
Adding - sensor to ha_platforms matches the new sensor entities introduced below.


20-20: Integration introduction follows style guide
The bolded integration name with {% term integration %} is clear and consistent with other docs.


30-32: Weather section formatting is correct
The new “## Weather” heading and its description are clear and concise, matching Home Assistant’s documentation style.


34-36: Sensors section structure is on point
Introducing a separate “## Sensors” section to enumerate metrics is a great organizational improvement.


38-40: Sensor table header and first entry look good
The table header and “Thunder probability” row follow expected formatting and description conventions.


48-48: Default disable notice is clear
The note that cloud sensors are not enabled by default is informative and placed appropriately.


52-52: API documentation link updated correctly
The new URL points to the “introduction” page of SMHI’s API—this aligns with the referenced section.


56-56: Removal section include is correct
Including integrations/remove_device_service.md under “Remove the integration” ensures users see the proper cleanup steps.

@home-assistant home-assistant bot added the parent-merged The parent PR has been merged already label Jul 16, 2025
@gjohansson-ST gjohansson-ST merged commit 9016817 into next Jul 16, 2025
9 checks passed
@home-assistant home-assistant bot removed the awaits-parent Awaits the merge of an parent PR label Jul 16, 2025
@gjohansson-ST gjohansson-ST deleted the gj-20250529-01 branch July 16, 2025 10:31
@home-assistant home-assistant bot removed the parent-merged The parent PR has been merged already label Jul 16, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jul 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has-parent This PR has a parent PR in another repo next This PR goes into the next branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy