PVGIS input to Predictor/Scheduler

Hi all
Anyone that have an idea of how to implement a “PV forecast” like Photovoltaic Geographical Information System (PVGIS) - European Commission (europa.eu)? Does anyone have good experience with implementing this in the Predictor/Scheduler to optimize the use of hybrid inverter (also taking into account the ENTSO-E price)?
Br. Lars

I use open-meteo.com.

It works fine and is free for pirivate use.
I request every 15min Temperature and the tilted module power for each direction

best

eberhard mayer

@hansenelectric: The time-of-use optimization requires just “any” predictor, so you could just start making experiments with out-of-the box available components. I personally run the “Persistence Model”-predictor very successfully in my private home. I recently added some short- and very-short-term predictions, though, that improve the prediction accuracy a lot. → openems/io.openems.edge.predictor.persistencemodel/src/io/openems/edge/predictor/persistencemodel/PredictorPersistenceModelImpl.java at develop · OpenEMS/openems · GitHub

@Eba-M: open-meteo.com sounds interesting. I had not known about it before. Can you share your code to read the prediction, please?

Thanks,
Stefan

void openmeteo(std::vector<watt_s> &w, e3dc_config_t e3dc,int anlage)
{
FILE * fp;
char line[256];
char path [65000];
char value[25];
char var[25];
char var2[25];

int x1 = 0;
int x2,x3;
int len = strlen(e3dc.Forecast[anlage]);

if (anlage >=0)
{
    memcpy(&line,&e3dc.Forecast[anlage],len);
    memset(var, 0, sizeof(var));
    memset(var2, 0, sizeof(var2));
    memset(value, 0, sizeof(value));
    for(int j = 0;j<len&&x1==0;j++)
    {
        if (line[j]=='/') x1=j;
    }
    x2=0;
    for(int j=x1+1;j<len&&x2==0;j++)
    {
        if (line[j]=='/') x2=j;
    }
    memcpy(&var,&line[0],x1);
    memcpy(&var2,&line[x1+1],x2-x1-1);
    memcpy(&value,&line[x2+1],len-x2-1);
    
    x1 = atoi(var);
    x2 = atoi(var2);
    x3 = atoi(value);
}


  {

      sprintf(line,"curl -X GET 'https://api.open-meteo.com/v1/forecast?latitude=%f&longitude=%f&minutely_15=global_tilted_irradiance_instant&timeformat=unixtime&forecast_minutely_15=192&tilt=%i&azimuth=%i'",e3dc.hoehe,e3dc.laenge,x1,x2);

      fp = NULL;
      fp = popen(line, "r");
      int fd = fileno(fp);
      int flags = fcntl(fd, F_GETFL, 0);
      flags |= O_NONBLOCK;
      fcntl(fd, F_SETFL, flags);
      fp_status = 2;

}
{
    int timeout = 0;
    while (fgets(path, 65000, fp) == NULL&&timeout < 30)
    {
        sleep(1);
        timeout++;
    }
    if (timeout >= 30) return;
    {
        const cJSON *item = NULL;
        const cJSON *item1 = NULL;
        const cJSON *item2 = NULL;

        std::string feld;
        cJSON *wolf_json = cJSON_Parse(path);
        feld = "minutely_15";
        char * c = &feld[0];
        item = cJSON_GetObjectItemCaseSensitive(wolf_json, c );
        feld = "time";
        item1 = cJSON_GetObjectItemCaseSensitive(item, c );
        feld = "global_tilted_irradiance_instant";
        c = &feld[0];
        item2 = cJSON_GetObjectItemCaseSensitive(item, c );
        item1 = item1->child;
        item2 = item2->child;
        int x1 = 0;
        while (item1!=NULL)
        {
            while (w[x1].hh < item1->valueint&&x1<w.size())
                x1++;
            if (w[x1].hh == item1->valueint)
            {
                if (anlage==0)
                    w[x1].solar = item2->valuedouble*x3/4/e3dc.speichergroesse/10;  // (15min Intervall daher /4
                else
                    w[x1].solar = w[x1].solar+item2->valuedouble*x3/4/e3dc.speichergroesse/10;
                x1++;
                if (x1 >= w.size())
                    return;
            }
            item1 = item1->next;
            item2 = item2->next;

        }

    }
}

}
I request the data for tilted module to get a prediction for the solar result.
you can find my complete code when you search for
E3DC-Control
I use the weatherforecast to predict the consumption of my heat pump. That necessary for the flexible tarifs like aWATTar or tibber

1 Like

open-meteo.com offers all data within 15min. intervall