Open-Meteo Solar Forecast

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
4 Likes

Thanks a lot for this, do you mind if I add this to my README? It looks really sleek

offcourse you can add it :blush:

1 Like

you could add a

now:
  show: true
  color: red
1 Like

Iā€™ll be sure to add that as well; very helpful! Thanks for bearing with me. Iā€™m new to this ApexCharts thing

Iā€™ll also use the watts attribute instead of wh_period in the README, I prefer to get the 15min data because the graph looks more smooth this way (and more information is always nice).

Is the difference between these two only the temporal resolution? Then I suggest a change in name - Wh denotes energy, W denotes power. These are two different things.

Wh_period attribute seems to be Wh generated in one hour, which is naturally the same value as the average W during that hour.I think the author of this integration is very well aware of the difference between the two units :stuck_out_tongue:.

I started using this integration a couple days ago and I still canā€™t believe how incredibly accurate it is. I was going to ask about having the inverter limit in there, but it was just added, perfect.

Now the only thing thatā€™s causing noticeable differences between the forecast and my actual production is there overvoltage protection disabling the inverter, sadly this happens here regularly, especially during peak production. But that canā€™t really be estimated without a different source of data for the expected power demand and production in my area.

1 Like

No offense but if you frequently run into overvoltage protection then your solar system is not properly setup/designed. This should not happen.

1 Like

No offence, but I didnā€™t ask for your opinion. I think you donā€™t know what you are talking about.

Sure, have fun.

The name is different though, the attribute is called ā€œwattsā€ and is power at instant. Itā€™s a bit confusing because the data is taken from an energy sensor, though.