Dear All
I wrote a python script, executing each day at midnight to grab the SolCast PV power forecast for the next two days and publishing it to emonpi with MQTT.
Solcast gives this forecast format in JSON for the next two days each 30 minutes.
Of course the timestamp of the SolCast JSON is in UTC, with the Z at the end.
Actually with the summer time, these forecasts are shifted 2 hours viewing them in Emoncms runnign locally on the Raspberry.
On this graph the time is clearly Local Time, i.e. CET when observing the PV production.
I do not understand why the forecast is shifted + 2 hours, because if the JSON timestamp is taken as CET rather than UTC, it should be 2 hours ahead no ?
As I parse the Solcast JSON already because SolCast allows only two roofs and I have three so I compute the three roofs forecast from one with sine/cosine equations, I can also modify the timestamp to align the forecast to the production.
But before doing this kind of patch it is always better to understand the root cause, no ?
Thanks for your support !
Regards
Christophe
For info the raw Solcast JSON is like this (for now 19h28 CET)
{“forecasts”:[{“pv_estimate”:0.1323,“pv_estimate10”:0.0831,“pv_estimate90”:0.1723,“period_end”:“2024-07-31T17:30:00.0000000Z”,“period”:“PT30M”},{“pv_estimate”:0.1062,“pv_estimate10”:0.0735,“pv_estimate90”:0.1212,“period_end”:“2024-07-31T18:00:00.0000000Z”,“period”:“PT30M”},{“pv_estimate”:0.03,“pv_estimate10”:0.0172,“pv_estimate90”:0.0486,“period_end”:“2024-07-31T18:30:00.0000000Z”,“period”:“PT30M”},{“pv_estimate”:0.0089,“pv_estimate10”:0.0045,“pv_estimate90”:0.0118,“period_end”:“2024-07-31T19:00:00.0000000Z”,“period”:“PT30M”}, …
And before publishing to mqtt I already remove the “period”:“PT30M” as well as some zeroes on the time stamp, and rename the “period_end” as “time”
And the emonpi datetime is
Correct to the local time here.