Ertragsprognose über Solcast

Alle zusätzlichen Module, die in die Solaranzeige integriert wurden, wie den Wetterbericht, die Solarprognose, der Messenger Pushover, Sun & Moon, aWATTar Strompreise und weitere Module.

Moderator: Ulrich

Icebox82
Beiträge: 69
Registriert: Di 17. Jan 2023, 08:30
Hat sich bedankt: 3 Mal
Danksagung erhalten: 1 Mal

Re: Ertragsprognose über Solcast

Beitrag von Icebox82 »

Danke Leon und Stefan für eure Antworten! Und frohe Weihnachten!!

Ich versuch das mal zu ordnen bzw zu „beantworten“:

- die PVForecasts.py kann ich morgen mal posten wenn das weiterhilft

- ich verwende das Solaranzeigen Image 5.1.2 64bit
- ich habe zuletzt die light Version installiert mit ich meine python3 pip, panda, numpy, pysolcast und astral. Das hat ohne Fehlermeldung geklappt, also keine bottleneck-Probleme oder andere.
- das Abfrageinterval: das mit 10 Abfragen bzw 2,5Std hatte ich mir auch schon ausgerechnet. Da ich eine Ost-West Anlage habe dann nur noch die Hälfte. Da eine Abfrage erfolgreich war hat Solcast 2 (wegen Ost-West) von 10 benutzt angezeigt. Aber da noch 8 übrig waren hätten doch auch nach 15:30 Abfragen laufen können?! Und selbst am nächsten Tag funktioniert es nicht mehr, was mich daran am meisten verwirrt. Selbst über python SolCastLight.py klappt es nicht, da kommt nur Start - Ende, ohne downloading data dazwischen.

Stefan_E
Beiträge: 65
Registriert: Do 2. Jan 2020, 22:08
Danksagung erhalten: 9 Mal

Re: Ertragsprognose über Solcast

Beitrag von Stefan_E »

Hallo Icebox82

... komisch. Das sollte so nicht sein. - aber vorher auch frohe Weihnachten!

Ich schau grad in den Code. Jetzt wird's leider etwas kompliziert ... Ich versuch's mal ...

Ich nehme mal an, das `solcast.ini` File das Du am 8. Dezember gepostet hast, stimmt noch? - scheint mir auch richtig zu sein. Damit müsstest Du in `solcast.py` in `getSolCast` landen (Zeile 119). Dort heisst es:

Code: Alles auswählen

    def getSolCast(self):
        if (self._doDownload()):
            hours   = self.config['SolCast'].getint('Hours', 168)                          # requires update of pysolcast
Es gibt leider kein `else` ... aber `_doDownload` macht das Interval Handling. Dort gibt's (auf zeile 75) ein IF:

Code: Alles auswählen

        if self._force or self._interval == -3 or (now_utc > mySun['sunrise'] and now_utc < mySun['sunset']):    # storeDB enabled, SolCast enabled, daylight
            if self._storeDB or self._storeInflux:
Da dein config file force nicht setzt und interval auf Default lässt, musst Du auf Tageslicht warten. Ich nehm mal an, dein Computer hat die richtige Zeit ... dann sollte das gehen. Du kannst ja mal eine Zeile einfügen (gleich eingerückt wie das `if self._storeDB ...`):

Code: Alles auswählen

print("day time")
Dann geht's weiter und Du kommst auf Zeile 111 - da müsste es klemmen, um Deine Beobachtungen zu erklären:

Code: Alles auswählen

                    print("---")
                    print(delta_t)
                    print(interval)
                    if delta_t > interval - 2:
                        retVal = True
Die `print` Statements hab ich jetzt hier mal hinzugefügt zum debuggen ... - (Wenn Du Python kennst, kann man das sicher eleganter schreiben ...). Ich vermute mal, das Problem liegt in delta_t. Das wird (Zeile 84) errechnet: hast Du in `influx` ein `measurement forecast_log`?

Lass uns das mal ausführen und dann weiter sehen. Falls Du eine effizientere Idee hast, das remote zu debuggen, lass es mich wissen ;-)

Stefan

Icebox82
Beiträge: 69
Registriert: Di 17. Jan 2023, 08:30
Hat sich bedankt: 3 Mal
Danksagung erhalten: 1 Mal

Re: Ertragsprognose über Solcast

Beitrag von Icebox82 »

Also erstmal: ich kann kein python, php etc und bessere Ideen habe ich leider auch nicht. Ich bin da leider echt auf fremde Hilfe angewiesen :(

Damit ich eine saubere Installation habe habe ich nochmal alles neu aufgesetzt und die packages einzeln installiert und nicht über die requirements.txt. Lief alles ohne Fehler. Config.ini wieder angepasst, Test cd Pv -> python PVForecasts.py :

Code: Alles auswählen

pi@solaranzeige:~/PV $ python PVForecasts.py
------------------------- Start (config.ini at 2023-12-25, 14:30:13 - local)
Message - downloading SolCast data at (UTC): 2023-12-25 13:30:13.736624+00:00
/home/pi/PV/PVForecast/solcast.py:146: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  period              = df['period'][0]
------------------------- End (2023-12-25, 14:30:17 - local)
Daten sind in influxdb vorhanden, Vorhersage bis 01.01.24 14:30. Auch ein Measurement forecast_log ist vorhanden.
Dann den Eintrag in crontab gemacht.

Code: Alles auswählen

*/15 * * * * cd /home/pi/PV && /usr/bin/python3 PVForecast[b]S[/b].py >> /home/pi/PV/data/err.txt 2>&1
fehlt da eigentlich das s hinter PVForecast? Hab das so von Github kopiert

14:45 nichts, 15:00 nichts,...

Nochmal cd PV -> python PVForecasts.py probiert:

Code: Alles auswählen

pi@solaranzeige:~/PV $ python PVForecasts.py
------------------------- Start (config.ini at 2023-12-25, 15:04:25 - local)
------------------------- End (2023-12-25, 15:04:25 - local)
Also kein Download neuer Daten.
Dann habe ich mal den Code den du gepostet hast in die solcast.py in /PV/PVForecast/ eingefügt:

Code: Alles auswählen

storeDB enabled, SolCast enabled, daylight
            if self._storeDB or self._storeInflux:
                print("day time")
                if self._storeDB:
                    self._db        = DBRepository(self.config)
                    self.last_issue = self._db.getLastIssueTime(self.SQLTable)

Code: Alles auswählen

# download in regular intervals during full day (24h)
                        interval = optimal
                    else:
                        interval = optimal
                    print("---")
                    print(delta_t)
                    print(interval)
                    if delta_t > interval - 2:
                        retVal = True
so korrekt?

cd PV -> python PVForecasts.py ergab dann

Code: Alles auswählen

pi@solaranzeige:~/PV $ python PVForecasts.py
------------------------- Start (config.ini at 2023-12-25, 15:09:21 - local)
day time
---
39
180
------------------------- End (2023-12-25, 15:09:21 - local)
Funktioniert eine manuelle Zwischen-Abfrage überhaupt oder wird die irgendwo durch das Time Intervall "unterbunden"?

Stefan_E
Beiträge: 65
Registriert: Do 2. Jan 2020, 22:08
Danksagung erhalten: 9 Mal

Re: Ertragsprognose über Solcast

Beitrag von Stefan_E »

Also erstmal: ich kann kein python, php etc und bessere Ideen habe ich leider auch nicht. Ich bin da leider echt auf fremde Hilfe angewiesen :(
... also, macht ja nichts. Du solltest ja gar nicht diese Probleme haben ;-)
fehlt da eigentlich das s hinter PVForecast? Hab das so von Github kopiert
... hast Du recht, werde ich anpassen in Github :-(

mit Deinen print Statements sieht man jetzt wenigstens, wo's nicht weiter geht:
delta_t = 39, interval = 180 - somit delta_t < interval, und der nächste Call ist noch nicht fällig. Du hast den ersten Call so abgesetzt, dass die erste Forecast Period um 15:00 geendet hat ... Dein Call war also irgendwann zwischen 14:30 und 15:00 - frühestens um 14:30. Deshalb ist interval um 15:09 eben (15:09 - 14:30) = 39m

Wenn jetzt Sommer wäre (also lange Tage), würdest Du jetzt sehen: 54/180 --> 69/180 --> ... --> 174/180 --> 189/180/call --> 15/180 --> ...
Das siehst Du jetzt nicht, weil die Sonne vorher untergeht, und Du nicht mehr da vorbei kommst.

Morgen, nach Sonnenaufgang (sagen wir 8:40, je nach dem wo Du genau bist) findet der crontab call um 8:45 statt. Dann ist (8:45 - 14:30_vortag) = 18h15m = 1095m > 180m und die Abfrage sollte starten. Lass das System mal laufen bis morgen Mittag und schick die Einträge im log file, falls es nicht geht ... (Kann es sein, dass heute die Abfrage nicht gestartet hat wegen meinem Schreibfehler im crontab Eintrag?)

Was mich noch etwas verwirrt, ist interval = 180. Das sollte nur im Süden (südlich von ca. Florenz) vorkommen, wo die Tage länger sind. Hier im Norden (ich bin in NRW) würden 90m Intervalle genügen, auch mit nur fünf Abfragen für Dual-Array. Kann es sein, dass Du so weit südlich bist?
Funktioniert eine manuelle Zwischen-Abfrage überhaupt oder wird die irgendwo durch das Time Intervall "unterbunden"?
Das Spiel geht immer wie hier beschrieben
  • delta_t = now - last_successful_download > interval (wobei interval optimiert wird, wie beschrieben)
  • last_successful_download = 1. Jan. 1970 falls noch kein Download; nach jedem erfolgreichen Download wird die Zeit in `forecast_log` gespeichert
Den einzigen Weg, das zu umgehen, ist im config.ini zu sagen

Code: Alles auswählen

    force = 1
Dann wird erbarmungslos geladen, und Du kannst Deine Credits für den Tag in 3 Minuten verbraten :-). Gut für Debugging, aber nicht unbedingt für 'Produktion'

Ich hoffe, das hier hilft etwas ...? Sonst machen wir halt weiter ;-)

Icebox82
Beiträge: 69
Registriert: Di 17. Jan 2023, 08:30
Hat sich bedankt: 3 Mal
Danksagung erhalten: 1 Mal

Re: Ertragsprognose über Solcast

Beitrag von Icebox82 »

So, erstmal die gute Nachricht:

ES LÄUFT! :) Vielen Dank für die Hilfe!

Hier nochmal die log-Datei bis jetzt:

Code: Alles auswählen

/home/pi/PV/PVForecast/solcast.py:150: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  period              = df['period'][0]
------------------------- Start (config.ini at 2023-12-26, 10:30:03 - local)
day time
---
1200
90
Message - downloading SolCast data at (UTC): 2023-12-26 09:30:03.888782+00:00
------------------------- End (2023-12-26, 10:30:05 - local)
------------------------- Start (config.ini at 2023-12-26, 10:45:03 - local)
day time
---
15
90
------------------------- End (2023-12-26, 10:45:03 - local)
------------------------- Start (config.ini at 2023-12-26, 11:00:03 - local)
day time
---
30
90
------------------------- End (2023-12-26, 11:00:03 - local)
------------------------- Start (config.ini at 2023-12-26, 11:15:03 - local)
day time
---
45
90
------------------------- End (2023-12-26, 11:15:03 - local)
------------------------- Start (config.ini at 2023-12-26, 11:30:04 - local)
day time
---
60
90
------------------------- End (2023-12-26, 11:30:04 - local)
------------------------- Start (config.ini at 2023-12-26, 11:45:03 - local)
day time
---
75
90
------------------------- End (2023-12-26, 11:45:03 - local)
/home/pi/PV/PVForecast/solcast.py:150: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  period              = df['period'][0]
------------------------- Start (config.ini at 2023-12-26, 12:00:03 - local)
day time
---
90
90
Message - downloading SolCast data at (UTC): 2023-12-26 11:00:03.226494+00:00
------------------------- End (2023-12-26, 12:00:07 - local)
------------------------- Start (config.ini at 2023-12-26, 12:15:03 - local)
day time
---
15
90
------------------------- End (2023-12-26, 12:15:03 - local)
------------------------- Start (config.ini at 2023-12-26, 12:30:03 - local)
day time
---
30
90
------------------------- End (2023-12-26, 12:30:03 - local)
------------------------- Start (config.ini at 2023-12-26, 12:45:03 - local)
day time
---
45
90
------------------------- End (2023-12-26, 12:45:03 - local)
------------------------- Start (config.ini at 2023-12-26, 13:00:03 - local)
day time
---
60
90
------------------------- End (2023-12-26, 13:00:03 - local)
------------------------- Start (config.ini at 2023-12-26, 13:15:03 - local)
day time
---
75
90
------------------------- End (2023-12-26, 13:15:03 - local)
/home/pi/PV/PVForecast/solcast.py:150: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  period              = df['period'][0]
------------------------- Start (config.ini at 2023-12-26, 13:30:03 - local)
day time
---
90
90
Message - downloading SolCast data at (UTC): 2023-12-26 12:30:03.279127+00:00
------------------------- End (2023-12-26, 13:30:06 - local)
------------------------- Start (config.ini at 2023-12-26, 13:45:03 - local)
day time
---
15
90
------------------------- End (2023-12-26, 13:45:03 - local)
------------------------- Start (config.ini at 2023-12-26, 14:00:03 - local)
day time
---
30
90
------------------------- End (2023-12-26, 14:00:03 - local)
------------------------- Start (config.ini at 2023-12-26, 14:15:03 - local)
day time
---
45
90
------------------------- End (2023-12-26, 14:15:03 - local)
------------------------- Start (config.ini at 2023-12-26, 14:30:04 - local)
day time
---
60
90
------------------------- End (2023-12-26, 14:30:04 - local)
------------------------- Start (config.ini at 2023-12-26, 14:45:03 - local)
day time
---
75
180
------------------------- End (2023-12-26, 14:45:03 - local)
------------------------- Start (config.ini at 2023-12-26, 15:00:03 - local)
day time
---
90
180
------------------------- End (2023-12-26, 15:00:03 - local)
------------------------- Start (config.ini at 2023-12-26, 15:15:03 - local)
day time
---
105
180
------------------------- End (2023-12-26, 15:15:03 - local)
------------------------- Start (config.ini at 2023-12-26, 15:30:03 - local)
day time
---
120
180
------------------------- End (2023-12-26, 15:30:03 - local)
------------------------- Start (config.ini at 2023-12-26, 15:45:03 - local)
day time
---
135
180
------------------------- End (2023-12-26, 15:45:03 - local)
------------------------- Start (config.ini at 2023-12-26, 16:00:03 - local)
day time
---
150
180
------------------------- End (2023-12-26, 16:00:04 - local)
------------------------- Start (config.ini at 2023-12-26, 16:15:03 - local)
------------------------- End (2023-12-26, 16:15:03 - local)
------------------------- Start (config.ini at 2023-12-26, 16:30:03 - local)
------------------------- End (2023-12-26, 16:30:03 - local)
------------------------- Start (config.ini at 2023-12-26, 16:45:03 - local)
------------------------- End (2023-12-26, 16:45:03 - local)
------------------------- Start (config.ini at 2023-12-26, 17:00:04 - local)
------------------------- End (2023-12-26, 17:00:04 - local)
------------------------- Start (config.ini at 2023-12-26, 17:15:03 - local)
------------------------- End (2023-12-26, 17:15:03 - local)
------------------------- Start (config.ini at 2023-12-26, 17:30:04 - local)
------------------------- End (2023-12-26, 17:30:04 - local)
------------------------- Start (config.ini at 2023-12-26, 17:45:03 - local)
------------------------- End (2023-12-26, 17:45:03 - local)
------------------------- Start (config.ini at 2023-12-26, 18:00:03 - local)
------------------------- End (2023-12-26, 18:00:03 - local)
------------------------- Start (config.ini at 2023-12-26, 18:15:03 - local)
------------------------- End (2023-12-26, 18:15:03 - local)
------------------------- Start (config.ini at 2023-12-26, 18:30:03 - local)
------------------------- End (2023-12-26, 18:30:03 - local)
------------------------- Start (config.ini at 2023-12-26, 18:45:03 - local)
------------------------- End (2023-12-26, 18:45:03 - local)
------------------------- Start (config.ini at 2023-12-26, 19:00:04 - local)
------------------------- End (2023-12-26, 19:00:04 - local)
------------------------- Start (config.ini at 2023-12-26, 19:15:03 - local)
------------------------- End (2023-12-26, 19:15:03 - local)
------------------------- Start (config.ini at 2023-12-26, 19:30:03 - local)
------------------------- End (2023-12-26, 19:30:03 - local)
------------------------- Start (config.ini at 2023-12-26, 19:45:03 - local)
------------------------- End (2023-12-26, 19:45:03 - local)
------------------------- Start (config.ini at 2023-12-26, 20:00:04 - local)
------------------------- End (2023-12-26, 20:00:04 - local)
------------------------- Start (config.ini at 2023-12-26, 20:15:03 - local)
------------------------- End (2023-12-26, 20:15:04 - local)
------------------------- Start (config.ini at 2023-12-26, 20:30:03 - local)
------------------------- End (2023-12-26, 20:30:03 - local)
------------------------- Start (config.ini at 2023-12-26, 20:45:03 - local)
------------------------- End (2023-12-26, 20:45:03 - local)
------------------------- Start (config.ini at 2023-12-26, 21:00:03 - local)
------------------------- End (2023-12-26, 21:00:03 - local)
------------------------- Start (config.ini at 2023-12-26, 21:15:03 - local)
------------------------- End (2023-12-26, 21:15:03 - local)
------------------------- Start (config.ini at 2023-12-26, 21:30:03 - local)
------------------------- End (2023-12-26, 21:30:03 - local)
------------------------- Start (config.ini at 2023-12-26, 21:45:03 - local)
------------------------- End (2023-12-26, 21:45:03 - local)
------------------------- Start (config.ini at 2023-12-26, 22:00:03 - local)
------------------------- End (2023-12-26, 22:00:03 - local)
------------------------- Start (config.ini at 2023-12-26, 22:15:03 - local)
------------------------- End (2023-12-26, 22:15:03 - local)
------------------------- Start (config.ini at 2023-12-26, 22:30:03 - local)
------------------------- End (2023-12-26, 22:30:03 - local)
------------------------- Start (config.ini at 2023-12-26, 22:45:03 - local)
------------------------- End (2023-12-26, 22:45:03 - local)
------------------------- Start (config.ini at 2023-12-26, 23:00:03 - local)
------------------------- End (2023-12-26, 23:00:03 - local)
------------------------- Start (config.ini at 2023-12-26, 23:15:03 - local)
------------------------- End (2023-12-26, 23:15:03 - local)
------------------------- Start (config.ini at 2023-12-26, 23:30:03 - local)
------------------------- End (2023-12-26, 23:30:03 - local)
------------------------- Start (config.ini at 2023-12-26, 23:45:03 - local)
------------------------- End (2023-12-26, 23:45:03 - local)
------------------------- Start (config.ini at 2023-12-27, 00:00:04 - local)
------------------------- End (2023-12-27, 00:00:04 - local)
------------------------- Start (config.ini at 2023-12-27, 00:15:03 - local)
------------------------- End (2023-12-27, 00:15:03 - local)
------------------------- Start (config.ini at 2023-12-27, 00:30:03 - local)
------------------------- End (2023-12-27, 00:30:03 - local)
------------------------- Start (config.ini at 2023-12-27, 00:45:03 - local)
------------------------- End (2023-12-27, 00:45:03 - local)
------------------------- Start (config.ini at 2023-12-27, 01:00:03 - local)
------------------------- End (2023-12-27, 01:00:03 - local)
------------------------- Start (config.ini at 2023-12-27, 01:15:03 - local)
------------------------- End (2023-12-27, 01:15:03 - local)
------------------------- Start (config.ini at 2023-12-27, 01:30:03 - local)
------------------------- End (2023-12-27, 01:30:03 - local)
------------------------- Start (config.ini at 2023-12-27, 01:45:03 - local)
------------------------- End (2023-12-27, 01:45:03 - local)
------------------------- Start (config.ini at 2023-12-27, 02:00:03 - local)
------------------------- End (2023-12-27, 02:00:03 - local)
------------------------- Start (config.ini at 2023-12-27, 02:15:03 - local)
------------------------- End (2023-12-27, 02:15:03 - local)
------------------------- Start (config.ini at 2023-12-27, 02:30:03 - local)
------------------------- End (2023-12-27, 02:30:03 - local)
------------------------- Start (config.ini at 2023-12-27, 02:45:03 - local)
------------------------- End (2023-12-27, 02:45:03 - local)
------------------------- Start (config.ini at 2023-12-27, 03:00:03 - local)
------------------------- End (2023-12-27, 03:00:03 - local)
------------------------- Start (config.ini at 2023-12-27, 03:15:03 - local)
------------------------- End (2023-12-27, 03:15:03 - local)
------------------------- Start (config.ini at 2023-12-27, 03:30:03 - local)
------------------------- End (2023-12-27, 03:30:03 - local)
------------------------- Start (config.ini at 2023-12-27, 03:45:03 - local)
------------------------- End (2023-12-27, 03:45:03 - local)
------------------------- Start (config.ini at 2023-12-27, 04:00:03 - local)
------------------------- End (2023-12-27, 04:00:03 - local)
------------------------- Start (config.ini at 2023-12-27, 04:15:03 - local)
------------------------- End (2023-12-27, 04:15:03 - local)
------------------------- Start (config.ini at 2023-12-27, 04:30:04 - local)
------------------------- End (2023-12-27, 04:30:04 - local)
------------------------- Start (config.ini at 2023-12-27, 04:45:03 - local)
------------------------- End (2023-12-27, 04:45:03 - local)
------------------------- Start (config.ini at 2023-12-27, 05:00:03 - local)
------------------------- End (2023-12-27, 05:00:03 - local)
------------------------- Start (config.ini at 2023-12-27, 05:15:03 - local)
------------------------- End (2023-12-27, 05:15:03 - local)
------------------------- Start (config.ini at 2023-12-27, 05:30:03 - local)
------------------------- End (2023-12-27, 05:30:03 - local)
------------------------- Start (config.ini at 2023-12-27, 05:45:03 - local)
------------------------- End (2023-12-27, 05:45:03 - local)
------------------------- Start (config.ini at 2023-12-27, 06:00:03 - local)
------------------------- End (2023-12-27, 06:00:03 - local)
------------------------- Start (config.ini at 2023-12-27, 06:15:03 - local)
------------------------- End (2023-12-27, 06:15:03 - local)
------------------------- Start (config.ini at 2023-12-27, 06:30:03 - local)
------------------------- End (2023-12-27, 06:30:03 - local)
------------------------- Start (config.ini at 2023-12-27, 06:45:03 - local)
------------------------- End (2023-12-27, 06:45:03 - local)
------------------------- Start (config.ini at 2023-12-27, 07:00:03 - local)
------------------------- End (2023-12-27, 07:00:03 - local)
------------------------- Start (config.ini at 2023-12-27, 07:15:03 - local)
------------------------- End (2023-12-27, 07:15:03 - local)
------------------------- Start (config.ini at 2023-12-27, 07:30:03 - local)
------------------------- End (2023-12-27, 07:30:03 - local)
------------------------- Start (config.ini at 2023-12-27, 07:45:03 - local)
------------------------- End (2023-12-27, 07:45:03 - local)
------------------------- Start (config.ini at 2023-12-27, 08:00:04 - local)
------------------------- End (2023-12-27, 08:00:04 - local)
------------------------- Start (config.ini at 2023-12-27, 08:15:03 - local)
------------------------- End (2023-12-27, 08:15:03 - local)
------------------------- Start (config.ini at 2023-12-27, 08:30:03 - local)
------------------------- End (2023-12-27, 08:30:03 - local)
/home/pi/PV/PVForecast/solcast.py:150: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  period              = df['period'][0]
------------------------- Start (config.ini at 2023-12-27, 08:45:03 - local)
day time
---
1155
180
Message - downloading SolCast data at (UTC): 2023-12-27 07:45:03.768425+00:00
------------------------- End (2023-12-27, 08:45:06 - local)
------------------------- Start (config.ini at 2023-12-27, 09:00:03 - local)
day time
---
15
180
------------------------- End (2023-12-27, 09:00:03 - local)
------------------------- Start (config.ini at 2023-12-27, 09:15:03 - local)
day time
---
30
180
------------------------- End (2023-12-27, 09:15:03 - local)
------------------------- Start (config.ini at 2023-12-27, 09:30:03 - local)
day time
---
45
180
------------------------- End (2023-12-27, 09:30:03 - local)
------------------------- Start (config.ini at 2023-12-27, 09:45:03 - local)
day time
---
60
180
------------------------- End (2023-12-27, 09:45:03 - local)
------------------------- Start (config.ini at 2023-12-27, 10:00:04 - local)
day time
---
75
180
------------------------- End (2023-12-27, 10:00:04 - local)
/home/pi/PV/PVForecast/solcast.py:150: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  period              = df['period'][0]
------------------------- Start (config.ini at 2023-12-27, 10:15:03 - local)
day time
---
90
90
Message - downloading SolCast data at (UTC): 2023-12-27 09:15:03.641041+00:00
------------------------- End (2023-12-27, 10:15:07 - local)
------------------------- Start (config.ini at 2023-12-27, 10:30:03 - local)
day time
---
15
90
------------------------- End (2023-12-27, 10:30:03 - local)
------------------------- Start (config.ini at 2023-12-27, 10:45:03 - local)
day time
---
30
90
------------------------- End (2023-12-27, 10:45:03 - local)
------------------------- Start (config.ini at 2023-12-27, 11:00:03 - local)
day time
---
45
90
------------------------- End (2023-12-27, 11:00:03 - local)
------------------------- Start (config.ini at 2023-12-27, 11:15:03 - local)
day time
---
60
90
------------------------- End (2023-12-27, 11:15:03 - local)
------------------------- Start (config.ini at 2023-12-27, 11:30:03 - local)
day time
---
75
90
------------------------- End (2023-12-27, 11:30:03 - local)
/home/pi/PV/PVForecast/solcast.py:150: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  period              = df['period'][0]
------------------------- Start (config.ini at 2023-12-27, 11:45:03 - local)
day time
---
90
90
Message - downloading SolCast data at (UTC): 2023-12-27 10:45:03.197616+00:00
------------------------- End (2023-12-27, 11:45:06 - local)
------------------------- Start (config.ini at 2023-12-27, 12:00:03 - local)
day time
---
15
90
------------------------- End (2023-12-27, 12:00:03 - local)
------------------------- Start (config.ini at 2023-12-27, 12:15:03 - local)
day time
---
30
90
------------------------- End (2023-12-27, 12:15:03 - local)
------------------------- Start (config.ini at 2023-12-27, 12:30:03 - local)
day time
---
45
90
------------------------- End (2023-12-27, 12:30:03 - local)
------------------------- Start (config.ini at 2023-12-27, 12:45:03 - local)
day time
---
60
90
------------------------- End (2023-12-27, 12:45:03 - local)
------------------------- Start (config.ini at 2023-12-27, 13:00:03 - local)
day time
---
75
90
------------------------- End (2023-12-27, 13:00:03 - local)
/home/pi/PV/PVForecast/solcast.py:150: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  period              = df['period'][0]
------------------------- Start (config.ini at 2023-12-27, 13:15:03 - local)
day time
---
90
90
Message - downloading SolCast data at (UTC): 2023-12-27 12:15:03.802702+00:00
------------------------- End (2023-12-27, 13:15:06 - local)
------------------------- Start (config.ini at 2023-12-27, 13:30:03 - local)
day time
---
15
90
------------------------- End (2023-12-27, 13:30:03 - local)
------------------------- Start (config.ini at 2023-12-27, 13:45:03 - local)
day time
---
30
90
------------------------- End (2023-12-27, 13:45:03 - local)
------------------------- Start (config.ini at 2023-12-27, 14:00:03 - local)
day time
---
45
90
------------------------- End (2023-12-27, 14:00:03 - local)
------------------------- Start (config.ini at 2023-12-27, 14:15:04 - local)
day time
---
60
90
------------------------- End (2023-12-27, 14:15:04 - local)
------------------------- Start (config.ini at 2023-12-27, 14:30:03 - local)
day time
---
75
90
------------------------- End (2023-12-27, 14:30:03 - local)
------------------------- Start (config.ini at 2023-12-27, 14:45:03 - local)
day time
---
90
180
------------------------- End (2023-12-27, 14:45:03 - local)
Zwei Sachen wundern mich noch.
Erstens:
Wieso springt hier am 26.12. das Intervall von 90 auf 180?

Code: Alles auswählen

 Start (config.ini at 2023-12-26, 14:30:04 - local)
day time
---
60
90
------------------------- End (2023-12-26, 14:30:04 - local)
------------------------- Start (config.ini at 2023-12-26, 14:45:03 - local)
day time
---
75
180
------------------------- End (2023-12-26, 14:45:03 - local)
Und dann hier am 27.12. vormittags wieder zurück auf 90? Heute wie man sieht zwischen 14:30 und 14:45 das gleiche, wo eigentlich der nächste Abruf fällig gewesen wäre.

Code: Alles auswählen

------------------------- Start (config.ini at 2023-12-27, 10:00:04 - local)
day time
---
75
180
------------------------- End (2023-12-27, 10:00:04 - local)
/home/pi/PV/PVForecast/solcast.py:150: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  period              = df['period'][0]
------------------------- Start (config.ini at 2023-12-27, 10:15:03 - local)
day time
---
90
90
Message - downloading SolCast data at (UTC): 2023-12-27 09:15:03.641041+00:00
------------------------- End (2023-12-27, 10:15:07 - local)
Achso, ich bin weder in Florenz noch weit südlich sondern im Norden von Niedersachsen.

das zweiten:

Wenn ich dich richtig verstanden habe wird das Intervall anhand der 10 verfügbaren Calls automatisch errechnet? Also das zB im Sommer bei längeren Tagen nur alle 2,5Std abgrufen wird? Und das ich pro Abruf zwei API-Calls verbrauche wird auch berücksichtigt?
Und die unterschiedlichen Zeiten Zeitangaben von "local" und "UTC" beim Download wie kommen die zustande oder ist die Abweichung von einer Stunde egal? Im Raspberry ist Datum und Uhrzeit korrekt eingestellt.

Stefan_E
Beiträge: 65
Registriert: Do 2. Jan 2020, 22:08
Danksagung erhalten: 9 Mal

Re: Ertragsprognose über Solcast

Beitrag von Stefan_E »

Schon mal gut, dass es läuft :-)
Und die unterschiedlichen Zeiten Zeitangaben von "local" und "UTC" beim Download wie kommen die zustande oder ist die Abweichung von einer Stunde egal?
Intern im Script geht alles in UTC. Wenn man nach Influx schreibt, hat Influx auch immer die Annahme, dass die Timestamps in UTC sind. Erst Grafana verwandelt das wieder in local. Also ist auch all mein Output in UTC. Das macht auch Sommerzeit, etc. überflüssig: Im Sommer ist local (DE) und UTC einfach 2h auseinander statt 1h im Winter. Das einzige Problem das mein Script hat (soweit ich das erfasse), ist, wenn Du es an einem Ort laufen lässt, wo UTC Midnight am Tag ist. Bis jetzt kenne ich keine Benutzer in Asien/Ozeanien :-(.

Die einzige Ausnahme von UTC ist start/end - die sind local.
Achso, ich bin weder in Florenz noch weit südlich sondern im Norden von Niedersachsen.
ok., hab ich auch raus gefunden, da es in Deinem solcast.ini file steht. Kann es sein, dass Du Dich beim neu aufsetzten vertippt hast und jetzt `Latitude = 43.132262` steht?
Wieso springt hier am 26.12. das Intervall von 90 auf 180?
...
Wenn ich dich richtig verstanden habe wird das Intervall anhand der 10 verfügbaren Calls automatisch errechnet? Also das zB im Sommer bei längeren Tagen nur alle 2,5Std abgrufen wird? Und das ich pro Abruf zwei API-Calls verbrauche wird auch berücksichtigt?
Genau ... im Directory `debug` gibt's ein kleines Script `solcast_timeInterval` das die gleiche Logik implementiert, aber nur Terminal Output generiert - praktisch zum debuggen. Das ist nur ein kleines Script für mich ... aber wenn Du das wie folgt konfigurierst:

Code: Alles auswählen

# --------------------------------------------------------------------------- User Input required here
location     = LocationInfo('na', 'na', 'UTC', latitude=43.132262, longitude=8.25375)      # Frankfurt: 50.2N / 8.7E
day          = datetime(2023, 12, 26, 0, 0, 0, tzinfo=timezone.utc)                 # day, from which to run

DAYS         = 1                                                                # number of days to run (more verbpose output if DAYS = 1)
INTERVAL     =   0                                                                # interval used (as in solcast.py: 0 .. -3)
apiCalls     =  10                                                                # available API credits
isDualArray  = True                                                               # whether we have a dual-array config
... dann tut das Script so wie wenn Du crontab alle 30min laufen lässt (alle 15min wenn Du apiCalls > 24 hast; das war mal so ...) Du kriegst dann folgenden Output:

Code: Alles auswählen

Sunrise=  2023-12-26 06:57:42.291564+00:00 ; Sunset=  2023-12-26 15:57:09.225022+00:00 ; Minutes=  539.4488909666667
want=  107.88977819333334 ; optimal=  90
1  --  2023-12-26 07:00:00+00:00 ;  28392900
2  --  2023-12-26 10:00:00+00:00 ;  180
3  --  2023-12-26 11:30:00+00:00 ;  90
4  --  2023-12-26 14:30:00+00:00 ;  180
day:  2023-12-26  nCalls=  4  Intervals used:  {90, 180}
--- overall run summary
credits used:  {4}
all steps:  {90, 180}
Du hast 539min Tageslicht. Mit 5 credits kommst Du auf 107.9 Minuten Intervalle... macht keinen Sinn, da die Updates alle 30min sind. Also kommt mein Algorithmus auf 180min: das wäre 7:00, 10:00, 13:00 (und 16:00 nach Sonnenuntergang). Nur 3 Credits verbraucht ... Also kann man ein 90min Intervall dazwischen schieben. Immer noch nicht 100% optimal (Du verbrauchst nur 4 credits) ... aber das war mir dann gut genug. (Bessere Implementierungsvorschläge willkommen - warum 120min nicht versucht werden versteh ich im Moment nicht ;-))

Wenn ich jetzt zurück schalte auf 53.13N und neu konfiguriere:

Code: Alles auswählen

# --------------------------------------------------------------------------- User Input required here
location     = LocationInfo('na', 'na', 'UTC', latitude=53.132262, longitude=8.25375)      # Frankfurt: 50.2N / 8.7E
day          = datetime(2023, 1, 1, 0, 0, 0, tzinfo=timezone.utc)                 # day, from which to run

DAYS         = 365                                                                # number of days to run (more verbose output if DAYS = 1)
INTERVAL     =   0                                                                # interval used (as in solcast.py: 0 .. -3)
apiCalls     =  10                                                                # available API credits
isDualArray  = True                                                               # whether we have a dual-array config
# --------------------------------------------------------------------------- End of User Input
wirst Du sehen, dass bis 1. Feb. 90min Intervalle gehalten werden. Dann, bis 17. Feb. 90/180; dann bis 17. Mar 120min, dann 240/120 bis 25. Mar, dann 150min bis 30. Apr., dann 180min 11. Aug. ... dann läuft das Spiel rueckwärts bis Jahresende.

Ich werde eine neue Version auf Github stellen, die etwas genauer berichtet, was bei SolCast passiert. (Beachte das 'after', da das script nicht weiss, wann genau es von crontab gerufen wird)

Code: Alles auswählen

Message - SolCast download inhibted between sunset and sunrise (see 'interval' parameter)
Message - SolCast download inhibted to preserve credits; next DL planned after (UTC): YYYY/mm/dd HH:MM:SS
Ich hoff, damit das Verhalten in Zukunft etwas besser zu beschreiben. Auch die Deprecation warnings werden dann verschwunden sein.

Vielen Dank für Deine Geduld :-)

Icebox82
Beiträge: 69
Registriert: Di 17. Jan 2023, 08:30
Hat sich bedankt: 3 Mal
Danksagung erhalten: 1 Mal

Re: Ertragsprognose über Solcast

Beitrag von Icebox82 »

Ich habe für deine Geduld und Hilfe zu danke :thumbup:

Die config.ini habe ich nochmal kontrolliert und die Koordinaten stimmen Latitude = 53.132995 und Longitude = 8.249164 (aus Solcast übernommen)

Und heute hat auch mit den Zeiten alles gepasst. Sonnenaufgang war 8:41 und Untergang ist 16:15

Code: Alles auswählen

------------------------- Start (config.ini at 2023-12-28, 08:30:03 - local)
------------------------- End (2023-12-28, 08:30:03 - local)
/home/pi/PV/PVForecast/solcast.py:150: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  period              = df['period'][0]
------------------------- Start (config.ini at 2023-12-28, 08:45:03 - local)
day time
---
1170
180
Message - downloading SolCast data at (UTC): 2023-12-28 07:45:03.637898+00:00
------------------------- End (2023-12-28, 08:45:06 - local)
------------------------- Start (config.ini at 2023-12-28, 09:00:03 - local)
day time
---
15
180
------------------------- End (2023-12-28, 09:00:03 - local)
------------------------- Start (config.ini at 2023-12-28, 09:15:03 - local)
day time
---
30
180
------------------------- End (2023-12-28, 09:15:03 - local)
------------------------- Start (config.ini at 2023-12-28, 09:30:03 - local)
day time
---
45
180
------------------------- End (2023-12-28, 09:30:03 - local)
------------------------- Start (config.ini at 2023-12-28, 09:45:03 - local)
day time
---
60
180
------------------------- End (2023-12-28, 09:45:03 - local)
------------------------- Start (config.ini at 2023-12-28, 10:00:03 - local)
day time
---
75
180
------------------------- End (2023-12-28, 10:00:03 - local)
/home/pi/PV/PVForecast/solcast.py:150: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  period              = df['period'][0]
------------------------- Start (config.ini at 2023-12-28, 10:15:03 - local)
day time
---
90
90
Message - downloading SolCast data at (UTC): 2023-12-28 09:15:03.475894+00:00
------------------------- End (2023-12-28, 10:15:05 - local)
------------------------- Start (config.ini at 2023-12-28, 10:30:03 - local)
day time
---
15
90
------------------------- End (2023-12-28, 10:30:03 - local)
------------------------- Start (config.ini at 2023-12-28, 10:45:03 - local)
day time
---
30
90
------------------------- End (2023-12-28, 10:45:03 - local)
------------------------- Start (config.ini at 2023-12-28, 11:00:03 - local)
day time
---
45
90
------------------------- End (2023-12-28, 11:00:03 - local)
------------------------- Start (config.ini at 2023-12-28, 11:15:03 - local)
day time
---
60
90
------------------------- End (2023-12-28, 11:15:03 - local)
------------------------- Start (config.ini at 2023-12-28, 11:30:03 - local)
day time
---
75
90
------------------------- End (2023-12-28, 11:30:03 - local)
/home/pi/PV/PVForecast/solcast.py:150: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  period              = df['period'][0]
------------------------- Start (config.ini at 2023-12-28, 11:45:03 - local)
day time
---
90
90
Message - downloading SolCast data at (UTC): 2023-12-28 10:45:03.624558+00:00
------------------------- End (2023-12-28, 11:45:06 - local)
------------------------- Start (config.ini at 2023-12-28, 12:00:03 - local)
day time
---
15
90
------------------------- End (2023-12-28, 12:00:03 - local)
------------------------- Start (config.ini at 2023-12-28, 12:15:03 - local)
day time
---
30
90
------------------------- End (2023-12-28, 12:15:03 - local)
------------------------- Start (config.ini at 2023-12-28, 12:30:03 - local)
day time
---
45
90
------------------------- End (2023-12-28, 12:30:03 - local)
------------------------- Start (config.ini at 2023-12-28, 12:45:03 - local)
day time
---
60
90
------------------------- End (2023-12-28, 12:45:03 - local)
------------------------- Start (config.ini at 2023-12-28, 13:00:03 - local)
day time
---
75
90
------------------------- End (2023-12-28, 13:00:03 - local)
/home/pi/PV/PVForecast/solcast.py:150: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  period              = df['period'][0]
------------------------- Start (config.ini at 2023-12-28, 13:15:03 - local)
day time
---
90
90
Message - downloading SolCast data at (UTC): 2023-12-28 12:15:03.655455+00:00
------------------------- End (2023-12-28, 13:15:06 - local)
------------------------- Start (config.ini at 2023-12-28, 13:30:03 - local)
day time
---
15
90
------------------------- End (2023-12-28, 13:30:03 - local)
------------------------- Start (config.ini at 2023-12-28, 13:45:03 - local)
day time
---
30
90
------------------------- End (2023-12-28, 13:45:03 - local)
------------------------- Start (config.ini at 2023-12-28, 14:00:03 - local)
day time
---
45
90
------------------------- End (2023-12-28, 14:00:03 - local)
------------------------- Start (config.ini at 2023-12-28, 14:15:03 - local)
day time
---
60
90
------------------------- End (2023-12-28, 14:15:03 - local)
------------------------- Start (config.ini at 2023-12-28, 14:30:03 - local)
day time
---
75
90
------------------------- End (2023-12-28, 14:30:03 - local)
/home/pi/PV/PVForecast/solcast.py:150: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  period              = df['period'][0]
------------------------- Start (config.ini at 2023-12-28, 14:45:03 - local)
day time
---
90
90
Message - downloading SolCast data at (UTC): 2023-12-28 13:45:03.318884+00:00
------------------------- End (2023-12-28, 14:45:05 - local)
------------------------- Start (config.ini at 2023-12-28, 15:00:03 - local)
day time
---
15
180
------------------------- End (2023-12-28, 15:00:03 - local)
Der letzte Abruf direkt zur Untergangszeit entfällt somit, was ja auch in Ordnung ist. Und laut Solcast wurden heute auch alle 10 API-Calls benutzt.
Ich bin somit erstmal zufrieden!
Nur schade das man nicht mehr die 50/25 Abrufe von damals hat, damit wäre man grade im Sommer flexibler und könnte die Intervalle auf zB 60min belassen. Hoffentlich wird es nicht noch weiter reduziert, die Vorhersagen treffen bei mir doch schon sehr gut zu. Besser wie bei anderen Diensten.

Danke und falls wir uns nicht mehr hören guten Rutsch! :)

Stefan_E
Beiträge: 65
Registriert: Do 2. Jan 2020, 22:08
Danksagung erhalten: 9 Mal

Re: Ertragsprognose über Solcast

Beitrag von Stefan_E »

Die config.ini habe ich nochmal kontrolliert und die Koordinaten stimmen Latitude = 53.132995 und Longitude = 8.249164 (aus Solcast übernommen)
Ja ... stimmt alles - war ein Ueberlegungsfehler meinerseits

edit/added
Da Du sowieso nie 15min Intervalle kriegst, kannst Du den crontab auf 30 min hochsetzen. Damit lädst Du die Daten immer um xx:00 oder xx:30.
Wenn Du um xx:15 lädst, sind im ersten Intervall die ersten 15min (xx:00 .. xx:15) schon Vergangenheit. Das macht nur Sinn, wenn Du alle 15min laden kannst, und so die 2. Viertelstunde nochmals updaten kannst ...

Auch guten Rutsch - und viel Sonne!

Stefan_E
Beiträge: 65
Registriert: Do 2. Jan 2020, 22:08
Danksagung erhalten: 9 Mal

Re: Ertragsprognose über Solcast

Beitrag von Stefan_E »

v2.11.03 behebt jetzt die Deprecation Warnings von Pandas 2.x und erklärt besser, warum Solcast Daten nicht geladen wurden.

Stefan

Icebox82
Beiträge: 69
Registriert: Di 17. Jan 2023, 08:30
Hat sich bedankt: 3 Mal
Danksagung erhalten: 1 Mal

Re: Ertragsprognose über Solcast

Beitrag von Icebox82 »

Danke für das Update :thumbup:

Kann ich einfach im „laufenden Betrieb“ die geänderten Dateien ins Verzeichnis kopieren und es läuft dann oder muss noch was gemacht werden?

Ach so, crontab hab ich noch auf alle 30 Minuten geändert

Antworten

Zurück zu „Wetterdaten, Börsenstrompreise, Solarprognose, Nachrichtendienst usw.“