emhass icon indicating copy to clipboard operation
emhass copied to clipboard

[Feature request] MPC Solcast use more than 1 day data

Open BDVGitHub opened this issue 1 year ago • 6 comments

When at MPC controller the forecast horizon is longer than 1 day. Is it possible to then take into account the Solcast forecast of more than 1 day, since with Solcast you get a 30-minute forecast for up to the next 3 days? Or is this already the case? Solcast_Forecast_Gaph File with Solcast data in json format Solcast_Forecasts.json

BDVGitHub avatar Dec 26 '24 17:12 BDVGitHub

Greetings @BDVGitHub , Yep you should be able to. try setting historic_days_to_retrieve to like 3. Alternatively if you cache solcast you will automatically have historic_days_to_retrieve*2 of solcast data cached in EMHASS.

GeoDerp avatar Jan 27 '25 09:01 GeoDerp

Hey @GeoDerp In this case, it is not the dates of the days that have passed (historical dates) but the forecast of the days ahead that interests me. Becuase you are talking about historic_days_to_retrieve ...

BDVGitHub avatar Jan 27 '25 09:01 BDVGitHub

I totally get your confusion and thats more my bad for the english of that parameter. Try passing historic_days_to_retrieve: 2 as a runtime parameter and see what it comes back with.

GeoDerp avatar Jan 27 '25 09:01 GeoDerp

Actually hang on, I reject my statement. Let me look at the code some more.

GeoDerp avatar Jan 27 '25 09:01 GeoDerp

@BDVGitHub, I think your might be right, and there is more work to be done here. Have you tried adjusting delta_forecast_daily?

It's possible I just need to tweak the solcast functionality to look more closely at the delta_forecast_daily.

I'm also not sure if the cache uses delta_forecast_daily as a reference either.

Will look into this when I'm not so tired.

GeoDerp avatar Jan 27 '25 10:01 GeoDerp

I agree with this FR it would be good if the EMHASS native solcast would cache multiday future forecasts.

I am able to achieve this outcome by passing data from the solcast sensors as the runtime payload.

        "pv_power_forecast": {{
          ([states('sensor.power_photovoltaics')|int(0)] +
          state_attr('sensor.solcast_pv_forecast_forecast_today', 'detailedForecast')|selectattr('period_start','gt',utcnow()) | map(attribute='pv_estimate')|map('multiply',1000)|map('int')|list +
          state_attr('sensor.solcast_pv_forecast_forecast_tomorrow', 'detailedForecast')|selectattr('period_start','gt',utcnow()) | map(attribute='pv_estimate')|map('multiply',1000)|map('int')|list +
          state_attr('sensor.solcast_pv_forecast_forecast_day_3', 'detailedForecast')|selectattr('period_start','gt',utcnow()) | map(attribute='pv_estimate')|map('multiply',1000)|map('int')|list +          
          state_attr('sensor.solcast_pv_forecast_forecast_day_4', 'detailedForecast')|selectattr('period_start','gt',utcnow()) | map(attribute='pv_estimate')|map('multiply',1000)|map('int')|list
          )| tojson
        }},

Image

purcell-lab avatar Feb 13 '25 10:02 purcell-lab