Open-Meteo Solar Forecast

Honestly, this works really, really good and I absolutely appreciate the work and time @rany spent for this. Many, many thanks! :o)

I have one suggestion, though:

https://doc.forecast.solar/damping

That would help to fight the overestimation especially in the morning and evening hours, due to trees or hills in the east and west. :o)

1 Like

Second that - really great work, much appreciated !

One question - maybe I missed something, but how do you view/extract the detailed daily forecast information (hour by hour) ?
In Solcast it is available as an attribute list on one of the entities.
I would like to use this information in a ‘bespoke’ Apex graph, but could not find this sort of information attached to any of the published entities.

You can’t currently

Hey friends, feel free to look into:

If there is anything missing that you think you want, feel free to make an issue yourself or if you don’t have a GitHub account I could make it on your behalf :smiley:

3 Likes

Hey, I have a quick question for you. If you got this data from service response, would you be able to use it in ApexCharts (I’m not an ApexCharts user so I wouldn’t know)

I think if you need it for apexcharts you have to make a template yourself.

1 Like

Perfect, I’ll do service response then

What is the shortest time frame we can get, please? Since we’re migrating to 15 minutes long time frames (starting each 00, 15, 30 and 45) on the electricity spot market, it would be helpful to pair it to fitting prediction… Thanks!

What do you mean by shortest time frame? The intervals for the data or when I’ll be able to work on this?

If you mean the intervals for the data, it’s always going to be 15mins. The average at every 15min interval and the instantaneous data at every 15min interval will be provided.

If you mean time frame for the feature complementation, hopefully by tomorrow.

For regions that are not EU or the US, the irradiance data is interpolated but it works fine for me despite this.

I meant the data (intervals). When you’ll have time for this is completely up to you and I’m grateful you’re putting your own time to this. Thanks!

1 Like

For me the forecasts are also much better now - looks really good.

The only thing missing is the ability to produce nice plots using ApexCharts - similar to the ones shown in the Dashboard.

With SolCast I plotted the forecast for today and tomorrow into the same chart, overlaying the Tibber prices. Would be fantastic if this was also possible with this integration.

I don’t see why this isn’t possible currently? What do you need to make this work? (Is this why you need detailed forecast attribute)

i think somebody else wrote this further above. To produce these plots we need more finegrained forecasts (at least per hour I guess) that can be combined into a time series and plotted. In SolCast I had

  - entity: sensor.solcast_pv_forecast_forecast_today
    unit: kWh
    yaxis_id: yield
    type: line
    name: Today
    color: darkgray
    data_generator: |
      var today = entity.attributes.detailedForecast.map((start, index) => {
        return [new Date(start["period_start"]).getTime(), entity.attributes.detailedForecast[index]["pv_estimate"]];
      });
      var data = today
      return data;

That’s all that was needed for that.

EDIT: Although the data should be there already - the Energy Dashboard already produces nice plots after all. So we only need sample code like the above for how to do it.

HA Open-Meteo Solar Forecast Integration version 0.1.10 has been released!

Changes:

  • Fix setting of custom Open-Meteo URL
  • Add support for capping power to inverter capacity
  • Provide detailed forecast in sensor attribute
  • Fix config_flow.py for HA <2024.4.0b0
  • Write some documentation
4 Likes

can someone provide a good apexcharts-card graph to use with newly provided attribute?

2 Likes

I tried the example code provided by apexcharts - didn’t work:

data_generator: |
    return entity.attributes.wh_period.map((start, index) => {
      return [new Date(start).getTime(), entity.attributes.wh_period[index]];
    });

@andreas-bulling I am sorry if this is low-quality (I never used ApexCharts before and only installed it to help you out), but this seems to work fine:

type: custom:apexcharts-card
header:
  show: true
  title: ApexCharts-Card
  show_states: true
  colorize_states: true
series:
  - entity: sensor.energy_production_today
    data_generator: |
      return Object.entries(entity.attributes.wh_period).map(
        ([key, value]) => [new Date(key).getTime(), value]
      );

I’m surprised I haven’t heard of ApexCharts before, the graphs look REALLY good. (P.S. replace wh_period with watts to get 15-min power values instead).

2 Likes

Works - thanks a lot!

1 Like

thank you! much better now, here is my graph

Summary
type: custom:apexcharts-card
apex_config:
  chart:
    height: 350px
all_series_config:
  unit: ' Wh'
header:
  title: Solar forecast
  show: true
  standard_format: true
  show_states: true
  colorize_states: true
graph_span: 2d
span:
  start: day
  offset: '-0h'
now:
  show: false
  label: Now
yaxis:
  - id: kwh
    min: 0
    apex_config:
      tickAmount: 4
  - id: header_only
    show: false
series:
  - entity: sensor.pv_power
    name: Actual Power
    type: area
    float_precision: 1
    color: '#ff9800'
    opacity: 0.5
    stroke_width: 2
    yaxis_id: kwh
    unit: W
    extend_to: now
    show:
      legend_value: true
      in_header: false
    group_by:
      func: median
      duration: 5m
  - entity: sensor.energy_production_today
    yaxis_id: kwh
    type: area
    name: Forecast Power
    color: grey
    opacity: 0.3
    data_generator: |
      return Object.entries(entity.attributes.wh_period).map(
        ([key, value]) => [new Date(key).getTime(), value]
      );    
    show:
      legend_value: false
      in_header: false
    stroke_width: 2
    float_precision: 2
    extend_to: false
    group_by:
      func: median
      duration: 1m
  - entity: sensor.energy_production_tomorrow
    yaxis_id: kwh
    type: area
    name: Tomorrow
    color: light_grey
    data_generator: |
      return Object.entries(entity.attributes.wh_period).map(
        ([key, value]) => [new Date(key).getTime(), value]
      );
    show:
      legend_value: false
      in_header: false
    stroke_width: 3
    float_precision: 2
    extend_to: false
  - entity: sensor.solar_goodwe
    yaxis_id: header_only
    name: PV Today
    color: orange
    show:
      legend_value: true
      in_header: true
      in_chart: false
  - entity: sensor.energy_production_today
    yaxis_id: header_only
    name: Forcast Today
    color: orange
    show:
      legend_value: true
      in_header: true
      in_chart: false
  - entity: sensor.energy_production_today_remaining
    yaxis_id: header_only
    name: Remaining Today
    color: orange
    show:
      legend_value: true
      in_header: true
      in_chart: false
  - entity: sensor.energy_production_tomorrow
    yaxis_id: header_only
    name: Forecast Tomorrow
    color: grey
    show:
      legend_value: true
      in_header: true
      in_chart: false
5 Likes