Forecast.Solar integration: take better advantage of paid subscription options

With a paid subscription, the forecast.solar service has several improvements: account_models [Forecast.Solar]

The integration will already update the data more frequently with an API key present, but right now only 30 minutes rather than 1 hour. This works well for the lowest “Personal” subscription, but “Personal Plus” and higher all update data as rapidly as every 15 minutes.

Additionally, all the paid tiers have a longer data horizon (3 days for personal, 6 days for professional, vs. 1 for the public tier).

Finally, different tiers allow additional kids of forecasting and data: ‘history’ for a forecast based on average weather historically for a day (rather than a live forecast), available at Personal and higher, and ‘clearsky’ for a forecast as though the day is completely clear, available at Professional and higher. It would be nice to be able to compare these values with real production and the live weather forecasts. Additionally, at the Professional level and higher, solar.forecast can provide the weather data it uses to create the forecasts, which could be used as a regular weather integration or displayed along with the forecast.

For ref, to make better use of the paid subscription, I have added my own rest sensors:

sensor:
  - platform: rest
    resource: https://api.forecast.solar/:apikey/estimate/:lat/:lon/:dec/:az/:kwp #replace with your own values
    name: "Solar Forecast (rest)"
    json_attributes_path: "$.result"
    json_attributes:
      - watt_hours_day
    value_template: "OK"
    scan_interval: 600
  - platform: template
    sensors:
      solar_forecast_watts_0d:
        friendly_name: "Solar Forecast watts - 0d"
        value_template: >
          {% set d0 = now().date() %}
          {{ state_attr('sensor.solar_forecast_rest', 'watt_hours_day')[d0 | string] / 1000 | float }}
        device_class: "energy"
        unit_of_measurement: "kWh"
      solar_forecast_watts_1d:
        friendly_name: "Solar Forecast watts - 1d"
        value_template: >
          {% set d0 = now().date() %}
          {% set d1 = d0 + timedelta(days = 1) %}
          {{ state_attr('sensor.solar_forecast_rest', 'watt_hours_day')[d1 | string] / 1000 | float }}
        device_class: "energy"
        unit_of_measurement: "kWh"
      solar_forecast_watts_2d:
        friendly_name: "Solar Forecast watts - 2d"
        value_template: >
          {% set d0 = now().date() %}
          {% set d2 = d0 + timedelta(days = 2) %}
          {{ state_attr('sensor.solar_forecast_rest', 'watt_hours_day')[d2 | string] / 1000 | float }}
        device_class: "energy"
        unit_of_measurement: "kWh"
      solar_forecast_watts_3d:
        friendly_name: "Solar Forecast watts - 3d"
        value_template: >
          {% set d0 = now().date() %}
          {% set d3 = d0 + timedelta(days = 3) %}
          {{ state_attr('sensor.solar_forecast_rest', 'watt_hours_day')[d3 | string] / 1000 | float }}
        device_class: "energy"
        unit_of_measurement: "kWh"   
2 Likes

In addition, from the personal accounts upward you can sent along the actual parameter to adjust the forecast graph according to your actual generated power. This gives much more precise forecast for the rest of the day, and possibly for others in the same area as well.

Would be great if this can be sent along automatically or via a config where we can specify which sensor value we want to sent along.

Fully agree, this would be great! I’m currently using a Node.red flow for this feature, but that does not work with the Energy dashboard.

Using the actual parameter makes the forecasts a lot more realistic.