Skip to content

New integration: Victron VRM Forecasts #38749

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

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

Conversation

AndyTempel
Copy link

@AndyTempel AndyTempel commented Apr 25, 2025

Proposed change

Added documentation for the new Victron VRM Forecasts integration.

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
    • Added comprehensive documentation for the new Victron VRM Forecasts integration, detailing setup instructions, required prerequisites, available forecast sensors, integration with the Energy dashboard, troubleshooting tips, and relevant external resources.

@home-assistant home-assistant bot added in-progress This PR/Issue is currently being worked on needs-rebase The PR has been branched of the wrong base branch or targets an incorrect target branch next This PR goes into the next branch labels Apr 25, 2025
@home-assistant
Copy link

It seems that this PR is targeted against an incorrect branch. Documentation updates which apply to our current stable release should target the current branch. Please change the target branch of this PR to current and rebase if needed. If this is documentation for a new feature, please add a link to that PR in your description.

Copy link

netlify bot commented Apr 25, 2025

Deploy Preview for home-assistant-docs ready!

Name Link
🔨 Latest commit 67e3a16
🔍 Latest deploy log https://app.netlify.com/sites/home-assistant-docs/deploys/680bd96bfdac340008f0894c
😎 Deploy Preview https://deploy-preview-38749--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.

@home-assistant home-assistant bot added the has-parent This PR has a parent PR in a other repo label Apr 25, 2025
@home-assistant home-assistant bot removed the needs-rebase The PR has been branched of the wrong base branch or targets an incorrect target branch label Apr 25, 2025
@AndyTempel AndyTempel marked this pull request as ready for review April 25, 2025 18:12
Copy link
Contributor

coderabbitai bot commented Apr 25, 2025

📝 Walkthrough

Walkthrough

A new documentation file has been introduced for the Victron VRM Forecasts integration in Home Assistant. This documentation outlines the integration's capabilities to import solar production and consumption forecasts from the Victron VRM portal using the VRM REST API v2. It details prerequisites, setup instructions, sensor entities provided, integration with the Energy dashboard, troubleshooting guidance, and relevant external resources. The integration supports configuration via Home Assistant's config flow and is categorized under Energy with cloud polling as the IoT class.

Changes

File(s) Change Summary
source/_integrations/vrm_forecasts.markdown Added new documentation for the Victron VRM Forecasts integration, including setup, usage, sensors, troubleshooting, and references.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant HomeAssistant
    participant VRM_API

    User->>HomeAssistant: Configure VRM Forecasts Integration (provide token, site ID)
    HomeAssistant->>VRM_API: Request forecast data (production & consumption)
    VRM_API-->>HomeAssistant: Return forecast data
    HomeAssistant->>HomeAssistant: Create/update forecast sensor entities
    User->>HomeAssistant: Add sensors to Energy dashboard
    HomeAssistant-->>User: Display forecast data and peak times
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.
    • 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 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: 2

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

17-18: Enhance introduction clarity
Consider rephrasing the opening sentence for conciseness and readability. For example:
“Pulls day-ahead and next-hour solar production and consumption forecasts from the Victron VRM portal (via REST API v2) into Home Assistant’s Energy dashboard and as individual sensors.”


77-83: Expand troubleshooting tips
Consider adding checks for token expiration/permissions (e.g., “Verify the access token is valid and has necessary scopes”) and inspecting Home Assistant logs for API fetch errors to help users diagnose common connectivity issues.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 81e8319 and 02d7b9a.

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

[uncategorized] ~43-~43: Loose punctuation mark.
Context: ...or.energy_production_estimate_yesterday`: Estimated energy production — Yesterday...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~55-~55: Loose punctuation mark.
Context: ...r.energy_consumption_estimate_yesterday`: Estimated energy consumption — Yesterda...

(UNLIKELY_OPENING_PUNCTUATION)

🔇 Additional comments (5)
source/_integrations/vrm_forecasts.markdown (5)

1-15: Front matter validation
All metadata fields (title, description, ha_category, ha_release, ha_iot_class, ha_config_flow, ha_codeowners, ha_domain, ha_platforms, ha_integration_type) are correctly specified and adhere to Home Assistant documentation standards.


33-37: Config flow inclusion
The integrations/config_flow.md snippet is correctly included and wrapped between horizontal rules, providing standard UI configuration instructions.


39-52: Solar sensor entities approved
The definitions and descriptions for the solar production forecast sensors are clear, consistent, and follow naming conventions used elsewhere in the platform.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~43-~43: Loose punctuation mark.
Context: ...or.energy_production_estimate_yesterday`: Estimated energy production — Yesterday...

(UNLIKELY_OPENING_PUNCTUATION)


53-63: Consumption sensor entities approved
The definitions and descriptions for the consumption forecast sensors are clear, consistent, and correctly mirror the structure of the production sensors.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~55-~55: Loose punctuation mark.
Context: ...r.energy_consumption_estimate_yesterday`: Estimated energy consumption — Yesterda...

(UNLIKELY_OPENING_PUNCTUATION)


86-91: Useful links validated
External references to the VRM API docs, VRM Portal manual, and VRM portal are accurate and relevant.

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/vrm_forecasts.markdown (3)

21-26: Consider adding API scopes to prerequisites
To help users provision their access token correctly, you could explicitly document the required VRM API scopes in the prerequisites section.

  - **VRM access token** (keep this secret!). Create one in the VRM Portal at **Preferences → Integrations → Access tokens** or use [this link](https://vrm.victronenergy.com/access-tokens).
+ - **Required API scopes**: `read:forecast`, `read:site`
  - **VRM Site ID**: found under **Settings → General** in your site’s VRM Portal page.

40-43: Grammar in Data Updates
Minor nitpick: the sentence could read more smoothly by explicitly referring to “integration” or using a neutral subject.

- The Victron VRM Forecasts fetches fresh data from the VRM API every 60 minutes.
+ The Victron VRM Forecasts integration fetches fresh data from the VRM API every 60 minutes.

44-69: Sensor Entities: Consider tables for clarity
While bullet lists work, presenting entities in a table (with columns for Entity ID, Friendly Name, Unit, etc.) can improve readability and ensure consistency with other integration docs.

Example structure:

| Entity ID                                   | Description                              | Unit |
|---------------------------------------------|------------------------------------------|------|
| `sensor.energy_production_estimate_yesterday` | Estimated energy production — Yesterday | kWh  |
...
🧰 Tools
🪛 LanguageTool

[uncategorized] ~48-~48: Loose punctuation mark.
Context: ...or.energy_production_estimate_yesterday`: Estimated energy production — Yesterday...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~60-~60: Loose punctuation mark.
Context: ...r.energy_consumption_estimate_yesterday`: Estimated energy consumption — Yesterda...

(UNLIKELY_OPENING_PUNCTUATION)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 02d7b9a and 9af825e.

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

[uncategorized] ~48-~48: Loose punctuation mark.
Context: ...or.energy_production_estimate_yesterday`: Estimated energy production — Yesterday...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~60-~60: Loose punctuation mark.
Context: ...r.energy_consumption_estimate_yesterday`: Estimated energy consumption — Yesterda...

(UNLIKELY_OPENING_PUNCTUATION)

⏰ 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/vrm_forecasts.markdown (7)

1-15: Front Matter Metadata
The YAML front matter is correctly populated with the expected keys (title, description, ha_category, etc.) and matches the upcoming 2025.5 release. All required metadata appears in place.


17-18: Introduction Clarity
The overview succinctly describes the integration’s purpose and capabilities. It’s clear and follows Home Assistant documentation conventions.


27-32: Admonition Usage
The {% hint style="important" %} block is used correctly and follows the recommended macro syntax for security notices.


36-36: Config Flow Include
Including the integrations/config_flow.md snippet ensures users see the standard configuration UI flow without duplication—good reuse of shared docs.


72-79: Adding to the Energy Dashboard
The step-by-step instructions are clear and accurate. They correctly guide users through adding forecast production to the Energy dashboard.


82-90: Troubleshooting Guidance
The troubleshooting section covers the common failure modes (missing sensors, auth issues, API errors) thoroughly.


93-98: Useful Links
The curated list of external resources is appropriate and correctly formatted.

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 (6)
source/_integrations/vrm_forecasts.markdown (6)

3-3: Refine the description field.
Current:

description: Instructions for implementation of Victron VRM Forecasts into Home Assistant.

Consider making it more concise and action-oriented, for example:

description: Pull solar production and consumption forecasts from Victron VRM into Home Assistant.

This helps users immediately grasp the integration’s purpose.


17-19: Replace horizontal rules with headings.
The repeated --- lines render as <hr> but may not match the style of other docs. Consider removing them and relying solely on ##-style headings for section separation to maintain consistency.


27-32: Standardize admonition syntax.
Home Assistant docs often favor the hint macro for consistency. Instead of:

{% important %}
Your VRM access token…
{% endimportant %}

use:

{% hint style="important" %}
Your VRM access token…
{% endhint %}

This aligns with other hint-based blocks and ensures uniform styling.


40-43: Clarify data update interval.
You note “fetches fresh data… every 60 minutes.” If this interval is fixed, mention that it cannot be altered. If it’s user-configurable, indicate where or how to adjust it.


72-79: Clarify Energy Dashboard instructions.
Since only production forecasts can be added under Solar panels, consider adding a note like:

Consumption forecast sensors are not yet supported in the Energy dashboard UI.
This will help users understand why they don’t see consumption options.


82-90: Enhance troubleshooting guidance.
To further assist users:

  • Include example log excerpts for common errors (e.g., 401/403 API errors).
  • Link to the UI path where one updates the access token and site ID.
    These additions can reduce back-and-forth on the forums.
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9af825e and 67e3a16.

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

[uncategorized] ~48-~48: Loose punctuation mark.
Context: ...or.energy_production_estimate_yesterday`: Estimated energy production — Yesterday...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~60-~60: Loose punctuation mark.
Context: ...r.energy_consumption_estimate_yesterday`: Estimated energy consumption — Yesterda...

(UNLIKELY_OPENING_PUNCTUATION)

⏰ 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/vrm_forecasts.markdown (5)

1-15: Verify front matter keys and formatting.
The YAML front matter should align with the standard integration template. In particular:

  • Confirm that ha_iot_class uses the correct canonical value (cloud_polling vs. Cloud Polling) as seen in other docs.
  • Ensure required keys such as sidebar_title and layout are present if your project’s template mandates them.
    Please cross-check this file against an official integration reference to avoid rendering issues.

36-36: Confirm the config flow include.
Good use of {% include integrations/config_flow.md %}. Please verify that config_flow.md exists in source/_includes/integrations/ and renders correctly in context.


44-69: Verify sensor entity IDs.
The list of entities under Solar Production Forecast and Consumption Forecast must exactly match the code-generated entity_ids. Even small typos (e.g., missing underscores) will prevent sensors from appearing. Please cross-check these against the integration’s const.py or the sensor registration logic.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~48-~48: Loose punctuation mark.
Context: ...or.energy_production_estimate_yesterday`: Estimated energy production — Yesterday...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~60-~60: Loose punctuation mark.
Context: ...r.energy_consumption_estimate_yesterday`: Estimated energy consumption — Yesterda...

(UNLIKELY_OPENING_PUNCTUATION)


95-98: Validate external links.
Please click through and confirm that:

  1. The VRM JSON API v2 docs URL is correct and up to date.
  2. The VRM Portal manual link still resolves.
  3. The base VRM Portal URL hasn’t changed.
    Broken links here will lead to support tickets.

48-48: The LanguageTool warnings about loose punctuation at the sensor list lines are false positives—those colons are required for proper Markdown formatting.

Also applies to: 60-60

🧰 Tools
🪛 LanguageTool

[uncategorized] ~48-~48: Loose punctuation mark.
Context: ...or.energy_production_estimate_yesterday`: Estimated energy production — Yesterday...

(UNLIKELY_OPENING_PUNCTUATION)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has-parent This PR has a parent PR in a other repo in-progress This PR/Issue is currently being worked on next This PR goes into the next branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant