Solcast Global Solar Power Forecast Integration

I’m new to HomeAssistant so this might be a quick answer, but all the examples of cards given have the entities sensor names like sensor.solcast_forecast_today, but when i’ve installed it they are just sensor.forecast_today without the solcast_ . Is there an option to change that?

You can rename any entity in HA via the UI. Go to the settings of a specific entity.

Hello,
how can I access the information from the Solcast integration? The predictions are in 30 minute steps in the attributes of a sensor. How can I create a curve from this?

Connect it with your energy dashboard and view it there, or add it to you own view using the energy solar graph card, or plot it with the third-party ApexCharts using a data generator.

I was using this conveniently, but after updating to v3.1.4 from a few previous version, the graphs are no longer displayed correctly.
The header values are displayed correctly.
I changed the attribute from “forecast” to “DetailedForecast” in “data_generator” but it does not work.

Is it affected by the data every 30 minutes?
I do not understand about data_generator.
How should I change the data_generator?

1 Like

Use ‘detailedForecast’ instead of ‘forecast’

Example :

    data_generator: |
      var today = entity.attributes.detailedForecast.map((start, index) => {
        return [new Date(start["period_start"]).getTime(), entity.attributes.detailedForecast[index]["pv_estimate"]*2];
      });
      var data = today
      return data;
2 Likes

hi all,
so I created Solcast account, added my 2 arrays.
I’ configured/installed the repo’s via HACS and added the integrations and specified my API Key.
For some reason my Energy section is dead/there is nothing.
What I’d like to do is add a graph, showing 2 lines, one per array, showing the predicted generation based on solcast and then under it the actual, a value I get out of my inverter (but not sure how to pull this value in, I have the 2 string generations on 2 mqtt topics).

To add my 2 array pv yields, voltage, and amperage are brought into the system via mqtt sensors defined in configuration.yaml

similar for my current/and wattage used from the grid and then total usage as reported by my inverter.

G

Thanks for your reply, Rémi.

On my HA, the attribute in the Forecast Today entity is “DetailedForecast” (first letter capitalized).

But, in the data generator, “DetailedForecast” does not work and “detailedForecast” works fine, as you mentioned.
This is a bit strange :roll_eyes:

Anyway, it worked fine and I also noticed that I had to double the value, which was very helpful.
Thank you very much! :smiley:

3 Likes

can you please share your final apexcharts-card config using the latest version of solcast?

This is working for me

type: custom:apexcharts-card
header:
  show: true
  standard_format: true
  show_states: true
  colorize_states: true
apex_config:
  chart:
    height: 350px
  tooltip:
    enabled: true
    shared: true
    followCursor: true
graph_span: 4d
now:
  show: true
  label: Now
span:
  start: day
  offset: '-1day'
all_series_config:
  type: area
  opacity: 0.3
  stroke_width: 1
series:
  - entity: sensor.sunsynk_battery_soc
    name: Battery
    float_precision: 0
    type: line
    color: '#f06292'
    opacity: 0.6
    yaxis_id: capacity
    extend_to: now
    show:
      legend_value: true
      in_header: false
    group_by:
      func: last
      duration: 5m
  - entity: sensor.sunsynk_solar_power
    name: Solar Power
    float_precision: 3
    color: '#ff9800'
    yaxis_id: kWh
    unit: kW
    transform: return x/1000;
    extend_to: now
    show:
      legend_value: true
      in_header: false
    group_by:
      func: avg
      duration: 5m
  - entity: sensor.solcast_forecast_today
    name: Solar Forecast (D1)
    extend_to: false
    color: grey
    opacity: 0.3
    stroke_width: 0
    yaxis_id: kWh
    show:
      legend_value: false
      in_header: false
    data_generator: |
      return entity.attributes.detailedForecast.map((entry) => {
            return [new Date(entry.period_start), entry.pv_estimate*2];
          });
  - entity: sensor.solcast_forecast_tomorrow
    name: Solar Forecast (D2)
    float_precision: 3
    extend_to: false
    color: grey
    opacity: 0.3
    stroke_width: 0
    yaxis_id: kWh
    show:
      legend_value: false
      in_header: false
    data_generator: |
      return entity.attributes.detailedForecast.map((entry) => {
            return [new Date(entry.period_start), entry.pv_estimate*2];
          });
  - entity: sensor.solcast_forecast_d3
    name: Solar Forecast (D3)
    float_precision: 3
    extend_to: false
    color: grey
    opacity: 0.3
    stroke_width: 0
    yaxis_id: kWh
    show:
      legend_value: false
      in_header: false
    data_generator: |
      return entity.attributes.detailedForecast.map((entry) => {
            return [new Date(entry.period_start), entry.pv_estimate*2];
          });
  - entity: sensor.solcast_forecast_today
    yaxis_id: header_only
    name: Solar Forecast (D1)
    color: grey
    show:
      legend_value: true
      in_header: true
      in_chart: false
  - entity: sensor.solcast_forecast_remaining_today_every_minute
    yaxis_id: header_only
    name: Forecast (D1 Remaining)
    color: grey
    show:
      legend_value: true
      in_header: true
      in_chart: false
  - entity: sensor.solcast_forecast_tomorrow
    yaxis_id: header_only
    name: Forecast (D2)
    color: grey
    show:
      legend_value: true
      in_header: true
      in_chart: false
  - entity: sensor.solcast_forecast_d3
    yaxis_id: header_only
    name: Solar Forecast (D3)
    color: grey
    show:
      legend_value: true
      in_header: true
      in_chart: false
  - entity: sensor.solcast_api_last_polled
    yaxis_id: header_only
    name: Forecast (Last Update)
    color: grey
    unit: ' min.'
    transform: return ((Date.now()) - (new Date(x).getTime())) / 60 / 60 / 24
    show:
      legend_value: true
      in_header: true
      in_chart: false
yaxis:
  - id: capacity
    show: true
    opposite: true
    decimals: 0
    max: 100
    min: 0
    apex_config:
      tickAmount: 5
  - id: kWh
    show: true
    min: 0
    apex_config:
      tickAmount: 5
  - id: header_only
    show: false

5 Likes

Since some update it does not work for me either. Also when using your schematic (and simply replacing the solar yield one), it does not work / looks like this:
Header is not getting any data, but when I click on the entity it shows the correct value of the entity.
Also loading the graph takes forever. Only the last polled value is showing correctly.

image

EDIT: Solved… It appears that on my instance the forecast/solcast had no state history, therefore it could not be polled… and on the other instance the entities were named differently…

With the latest changes on the Solcast plugin, is anyone having a crazy high remaining today every minute value?
Mine is showing 27.79 remaining where the correct value would be 12.9, for example.

Ever since the update to the v4.x branch, my “remaining today” entity doesn’t seem to make sense either. For example, at 17:01 last night it said 0.28 kWh remaining for the day, yet the “this hour” figure was 0.6 kWh.

On the 3.x branch the values were sensible. I know that the “remaining today” entity now updates every 30 minutes instead of 60, but perhaps the algorithm it uses is bugged? Or the meaning of “remaining today” has changed?

I seem to have different weid behaviour: todays forecast is pretty close to actual in the energy dashboard. But all previous days, the forecast line seems half of what it used to be that day when it happened. Yesterday the forecast for that day was fine, if I look at it now: half of what it used to be.

My history forecasts are looking good now, going back over multiple days.

You can check what values are being returned from the SolCast integration though the download diagnostics button.

I can look, but the graphs ( also the dayly ones tell it all). And what would the diagnostic tell me then? For comparison, same graph, next day (before any meaningful production today):

If you don’t look you won’t know if it’s an bug in the dashboard or you are getting bad data from the integration.

The integration had been charging around a bit so it would be useful to tell us what version you are running.

I was using Solcast 3.1.6 and downloaded diagnostics, but there’s a lot of data there so hard to tell if that is all ok. But today 4.0.5 came up as an update and that seemed to fix it. Thanks.

Thanks, that works perfectly!

I would like to extend it to also show the forecast for yesterday (as it shows the yesterdays production anyway), but I am struggling to find a way to do so.

Unless I am missing something, the Solcast integration doesn’t provide historical data of the detailedForecast attribute so I am trying to copy it to another entity like this:

template:
  - trigger:
      - platform: time_pattern
        hours: 0
        minutes: 0
  - sensor:
      - name: "Solar Forecast Yesterday"
        state: "{{ states('sensor.solcast_pv_forecast_forecast_today') | float(0.0) }}"
        attributes:
          detailedForecast: "{{ state_attr('sensor.solcast_pv_forecast_forecast_today', 'detailedForecast') | list }}"

I am not completely sure I have the trigger correct but main issue is, that whole on the original entity the data looks like this:

detailedForecast: 
- period_start: '2023-09-14T00:00:00+02:00'
  pv_estimate: 0
  pv_estimate10: 0
  pv_estimate90: 0
- period_start: '2023-09-14T00:30:00+02:00'
  pv_estimate: 0
  pv_estimate10: 0
  pv_estimate90: 0

On the copy the formatting seems to be lost:

detailedForecast: [{'period_start': datetime.datetime(2023, 9, 14, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Prague')), 'pv_estimate': 0, 'pv_estimate10': 0, 'pv_estimate90': 0}, {'period_start': datetime.datetime(2023, 9, 14, 0, 30, tzinfo=zoneinfo.ZoneInfo(key='Europe/Prague')), 'pv_estimate': 0, 'pv_estimate10': 0, 'pv_estimate90': 0},

As expected the ApexCharts card is unable to extract data from that :frowning:

Any advice what am I doing wrong?

did you solve this problem?