batpred icon indicating copy to clipboard operation
batpred copied to clipboard

PV and PV7 WebUI charts

Open brickatius opened this issue 3 months ago • 7 comments

Describe the bug The PV and PV7 chart legends display 0 kW for Forecast, Forecast 10%, Forecast 90% and Forecast CL even though the graph area displays the forecasts.

Expected behaviour You would expect the legends to have a sum of the forecasts just as the PV power, Forecast History and Forecast History CL legends do.

Predbat version 8.25.5

Image

brickatius avatar Oct 07 '25 10:10 brickatius

Same on 8.25.6

gcoan avatar Oct 07 '25 11:10 gcoan

Confusing but as expected as the numbers are the final values on the chart which are at night and hence zero

springfall2008 avatar Oct 11 '25 16:10 springfall2008

Hi Trefor,

I don't agree that this is not a bug, it is definitely confusing, and if the behaviour is as expected then there is a bug that its displaying spurious information.

You said "the numbers are the final values on the chart which are at night and hence zero"

If I look at the chart now, the blue you're saying are accumulative figures for today: image

The first (orange) is the instantaneous power generation

The second and third (grey and red) are thus the cumulative 'so far today' forecast energy generation and calibrated forecast energy generation.

If correct, these should be in kWh not kW.

But then what are the forecast figures on the right ringed in red, which are always zero? What are they intended to show?

If I look just after midnight I only see these forecast figures, which based on the above makes sense, but again they are always zero: image

What I think the chart should be showing and what I think the chart used to be showing before the split into components in 8.25 for the forecast figures are:

  1. Total (PV50) forecast energy for today
  2. Total PV10 forecast energy for today
  3. Total PV90 forecast energy for today
  4. Total calibrated forecast energy for today

You would thus have a comparison of the actuals today (the blue figures) and the solar forecast (red).

gcoan avatar Oct 12 '25 10:10 gcoan

I agree with @gcoan (maybe I shouldn’t have closed this.) The values in question are showing 0 kW no matter what time is day it is.

brickatius avatar Oct 12 '25 10:10 brickatius

It's the way Apex charts works, the value shown is the last value at the end of the series which for the History figures is right now but for the predictions is at midnight on day 2 which is always zero.

I might be able to change what it displays here with some sort of override, while confusing its consistent with the charting softwares behaviour

springfall2008 avatar Oct 12 '25 18:10 springfall2008

It's the way Apex charts works, the value shown is the last value at the end of the series which for the History figures is right now but for the predictions is at midnight on day 2 which is always zero.

I might be able to change what it displays here with some sort of override, while confusing its consistent with the charting softwares behaviour

thanks for the extended explanation

if you can't easily override it then can you supress the heading values for the forecast?

the way I have created my own Apex charts is to use a different entity for the header (pv_tomorrow) and make that 'heading only', and the entities in the chart make them not appear in the header

e.g.

  - entity: sensor.solcast_pv_forecast_tomorrow
    yaxis_id: kwh
    type: area
    name: Tomorrow
    color: grey
    opacity: 0.3
    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;
    show:
      legend_value: false
      in_header: false
    stroke_width: 1
    float_precision: 2
    extend_to: false
  - entity: sensor.solcast_pv_forecast_tomorrow
    yaxis_id: header_only
    name: Tomorrow Forecast
    color: Grey
    show:
      legend_value: true
      in_header: true
      in_chart: false

gcoan avatar Oct 12 '25 19:10 gcoan

@brickatius I am working on seeing if I can fix this. Its not straight forward due to the way the apex charts are coded ....

gcoan avatar Nov 05 '25 01:11 gcoan