New pvnode 2.0 is here
All posts
· 5 min read ·Darwin Daume

PV Forecasts in Home Assistant: Integrate pvnode via REST in 5 Minutes

How to integrate the pvnode Forecast API into Home Assistant directly via the built-in REST sensor — no custom component required, including ApexCharts visualization and automation examples.

PV Forecasts in Home Assistant: Integrate pvnode via REST in 5 Minutes

One of the most common questions we hear from the community: "When is a Home Assistant integration coming?" The answer: an official HACS integration is planned and will arrive with the pvnode V2 API. But you don't have to wait until then — Home Assistant ships with everything you need to integrate the pvnode Forecast API directly. In this post we'll show you how to set it up in just a few minutes.

TL;DR

  • No custom component needed — the built-in RESTful sensor is enough.
  • 15-minute resolution for up to 7 days of forecast, updated every 10 minutes with nowcasting.
  • Complete forecast series as a sensor attribute — ideal for ApexCharts and automations.

Why Home Assistant + pvnode?

If you run your PV system with Home Assistant, you know its strengths: wallbox, heat pump, storage and home appliances can all be orchestrated centrally. What has often been missing is a truly precise forecast you can shift loads against. That's exactly where pvnode comes in: 15-minute resolution, a physical model instead of a rough estimate, optionally updated every 10 minutes via nowcasting.

Since pvnode is a pure REST API, you don't need any additional plugin — just a small addition to your configuration.yaml.

1. Store the API Key Securely

After registering at pvnode.com, create an API key in your account settings. Store it in Home Assistant's secrets.yaml — this way the key won't later show up in logs or backups of your configuration:

secrets.yaml

pvnode_api_key: "Bearer YOUR_API_KEY"

2. Configure the REST Sensor

Add the following block to your configuration.yaml and adjust the location and PV configuration to match your system:

configuration.yaml

rest:
  - resource: https://api.pvnode.com/v1/forecast/
    method: GET
    headers:
      Authorization: !secret pvnode_api_key
    params:
      latitude: 48.27564
      longitude: 11.83972
      slope: 30
      orientation: 180
      pv_power_kw: 10
      forecast_days: 2
      required_data: "pv_watts,temp"
    scan_interval: 3600
    sensor:
      - name: "pvnode Power Now"
        unique_id: pvnode_power_now
        unit_of_measurement: "W"
        device_class: power
        state_class: measurement
        value_template: >
          {% set rounded = now().replace(second=0, microsecond=0, minute=(now().minute // 15) * 15) %}
          {% set target = rounded.astimezone(timezone('UTC')).strftime('%Y-%m-%d %H:%M:%S') %}
          {% set match = value_json.values | selectattr('dtm', 'eq', target) | list %}
          {{ match[0].pv_watts | round(0) if match else 0 }}
        json_attributes:
          - values
          - latitude
          - longitude
          - slope
          - orientation
          - elevation

The most important parameters at a glance:

Parameter Description
latitude / longitude Location of the PV system
slope Tilt of the modules in degrees (0 = flat, 90 = vertical)
orientation Orientation in degrees (0 = north, 90 = east, 180 = south, 270 = west)
pv_power_kw Installed capacity in kWp
forecast_days Number of forecast days (0–7)
required_data Which fields the API should return — find all options here

A complete overview of all parameters is available in the Forecast API documentation.

Note: The value_template rounds the current time down to the nearest 15-minute interval and searches the UTC-formatted forecast series for the matching entry. The result is the currently forecasted power in watts — as a sensor state that can be used like any other power measurement in Home Assistant.

3. Reload the Configuration

After saving: Developer Tools → YAML → Reload all YAML configurations. When creating the sensor for the first time, a restart is required.

Under Developer Tools → States you'll now find the sensor sensor.pvnode_power_now. The state shows the currently forecasted power, and the attributes hold the complete 15-minute forecast — everything you need for charts and automations.

4. Visualize the Forecast as a Chart

With the ApexCharts Card (installable via HACS), you can plot the complete forecast series as a curve:

lovelace.yaml

type: custom:apexcharts-card
header:
  show: true
  title: PV Forecast
graph_span: 48h
span:
  start: day
series:
  - entity: sensor.pvnode_power_now
    name: pvnode Forecast
    type: line
    stroke_width: 2
    extend_to: false
    data_generator: |
      return entity.attributes.values.map(point => {
        const utcTime = new Date(point.dtm + 'Z').getTime();
        return [utcTime, point.pv_watts];
      });

The data_generator builds the data array directly from the sensor attributes — no additional template sensor, no duplicate storage of the data.

Real-World Use Cases

Once the forecast is available as a sensor, you can integrate it into automations using the usual Home Assistant tools. A few examples from our users' everyday lives:

  • Control the wallbox — charge your EV as soon as sufficient solar production is expected for the coming hours.
  • Schedule the heat pump — deliberately heat domestic water during times of surplus.
  • Optimize the battery — fully charge before expected periods of bad weather, discharge in the morning on sunny days.
  • Load shifting — start the washing machine, dryer or dishwasher during forecasted peak times.

A simple example: an automation that checks whether the average forecast over the next 4 hours is above 3 kW, and only then enables the wallbox. Since the complete forecast series sits in the sensor attribute values, a small Jinja template is enough — no external database, no custom component.

Even Closer to Reality with Nowcasting

We typically update the standard forecast once per hour — accordingly, scan_interval: 3600 is sufficient. With the Nowcasting add-on we recalculate the forecast every 10 minutes based on current satellite data. Simply set scan_interval: 600 and you get significantly higher responsiveness to cloud movements — especially relevant if your automations are optimized for short-term load shifting.

Tip: For east/west rooftops or multiple strings, simply create several REST sensors with different unique_id values. This lets you forecast the yield per roof surface and account for it separately in your automations.

And the Official Integration?

A native HACS integration is firmly on the roadmap and will follow the release of the pvnode V2 API. It will replace the manual YAML configuration with a UI-based setup. Until then, the REST sensor route is anything but a workaround — it works in production, it's transparent, and it can be tailored precisely to your needs.

Get Started

If you're not using pvnode yet: all new accounts start on the Pro + Nowcasting plan with 5 locations for testing. Create an account, generate an API key, insert the YAML block — and you'll have the forecast in Home Assistant in less than 5 minutes.

If you have questions or feedback, feel free to use the feedback button in the dashboard. And if you've built a particularly nice automation or dashboard based on pvnode data: we'd love to see examples and are happy to share the best solutions with the community.