Tariffs: Add pvnode Solar Forecast API V2
New Tariff for pvnode Solar forecast API version 2 using a site ID instead of individual lat, lon, az, ... values and therefores easy to configure via Web UI.
Fix #31132
- In the
jqexpression you unconditionally append"Z"to.timestampand then parse it withfromdateiso8601; if the API already returns a timezone designator this could produce invalid timestamps, so it may be safer to rely on the API’s full ISO8601 timestamp as-is or normalize it more defensively.
Yes, this need attentition, because API definition and implementation will differ depending on timezone
- API: Timestamps are in the site's local timezone
- Impl: always Z timezone
Had contact with pvnode about their changes between V1 and V2 of API. Here is the important part of the response:
`Im kostenlosen Tarif kann man heute + morgen abfragen. Das heißt, du bekommst zwei volle Tage.
Die Prognose wird einmal pro Tag berechnet und dann im Cache gespeichert. Das heißt, wenn du ein zweites Mal oder noch häufiger abfragen solltest, erhältst du dieselben Daten nochmal. Für Nutzer im kostenlosen Tarif ist es daher sinnvoll, weiterhin bei einer Abfrage pro Tag zu bleiben.
Die 250 Cache Anfragen haben wir eingeführt, weil einige Nutzer dennoch häufiger abgefragt haben, dann aber in die Limits des Plans reingelaufen sind. Um dies zu verhindern speichern wir die Prognose bei uns, sodass man sie jeder Zeit erneut abfragen kann.
Die Prognose wird zum Zeitpunkt der Abfrage berechnet. Der optimale Zeitpunkt hängt daher von der genauen Integration ab. Bisher haben Nutzer mit stündlichen Updates häufig um Mitternacht abgefragt, es ist aber jede andere Zeit möglich. Die zu Grunde liegenden Daten werden im Hintergrund alle 10 Minuten aktualisiert.
Im Light oder Plus Tarif wird die Prognose stündlich oder alle 10 Minuten neu berechnet. Das sollte im Bestens Fall wieder in der Integration einstellbar sein.`
Description should be modified accordingly, as it only copied from V1 at the moment. Ideally (if possible) , the daily query should be timed so that it is not performed at the end of the day, to get a good prediction of the current day (in my opinion the best time would be around sunrise).
Description should be modified accordingly, as it only copied from V1 at the moment. Ideally (if possible) , the daily query should be timed so that it is not performed at the end of the day, to get a good prediction of the current day (in my opinion the best time would be around sunrise).
Hi @sutixp, the description is updated and hopefully reflects the most important parts. If you can give me a hint how to do a timed query I can give it a try, but currently I have no idea how to solve this.
My next step is to solve the difference between local time and UNC time with jq.
@GerdZanker Github wants „fix“ instead of „implements“ to link and auto-close issues.
Hi guys - thanks a lot for picking up the V2 API so quickly after release. If it helps, I can give you access to the 7-day forecast, nowcasting and other features during the implementation phase to test the integration in full. Just let me know via email ([email protected]).
- In the
jqexpression you unconditionally append"Z"to.timestampand then parse it withfromdateiso8601; if the API already returns a timezone designator this could produce invalid timestamps, so it may be safer to rely on the API’s full ISO8601 timestamp as-is or normalize it more defensively.Yes, this need attentition, because API definition and implementation will differ depending on timezone
- API: Timestamps are in the site's local timezone
- Impl: always Z timezone
Made a small step forward: The returned API timestamp is assumed to be in local time and converted into ISO 8601 time. This should do the trick for hopefully many cases. Feedback welcome for this first conversion implementation
Checked the jq timestamp handling against pvnode's own V2 API docs:
1. Efficiency (pushed as 96cbd8a8f): localTimeToIso8601 was parsed twice per record (once for start, again for end), and end then round-tripped the already-formatted string back through fromdateiso8601. Simplified to compute the epoch once and derive both from it:
def toEpoch: sub("\\.[0-9]+"; "") | strptime("%FT%T") | mktime;
[.values[] |
(.timestamp | toEpoch) as $t |
{
start: ($t | todateiso8601),
end: ($t + 900 | todateiso8601),
value: (.pv_power | round)
}
] | tostring
2. Correctness (not yet fixed — needs a decision): strptime | mktime | strftime doesn't actually apply a timezone offset — I verified this empirically: feeding "2026-06-09T12:00:00" through localTimeToIso8601 returns "2026-06-09T12:00:00Z", identical wall-clock digits, just relabeled as UTC. pvnode's docs confirm timestamp is in the site's local timezone (with an IANA timezone field like "Europe/Berlin" alongside it), so for any non-UTC site this mislabels every forecast slot by the site's real UTC offset (1–2h for CET/CEST) — a real accuracy issue on a 15-minute-resolution forecast, not just cosmetic.
The catch: jq (evcc uses gojq) has no IANA tzdata, so it can't resolve "Europe/Berlin" into an offset. Every other tariff template in the repo (open-meteo, epex-predictor, api-akkudoktor-de) sidesteps this by requesting timezone=UTC/timeformat=unixtime from the API directly — but pvnode v2's documented query params (forecast_days, past_days, include) don't offer that. Two ways forward: ask pvnode (their team is responsive in the linked discussion) for a UTC output option, or add a user-supplied UTC-offset param applied via simple arithmetic (with a documented DST caveat).
🤖 Generated with Claude Code
/cc @darwindaume
ich weiss nicht ob es hilft... die Jungs vom iobroker haben Ihren Adapter mit v2 aktualiesiert...
Vielleicht haben die ja eine lösung für das problem? Falls nicht, (oder ich hier schwachsinn schreibe) gerne den Post löschen ;-)
https://github.com/iobroker-community-adapters/ioBroker.pvforecast/commit/d409a1fd2133975d84508a888f3885bcc9f12841
ich weiss nicht ob es hilft... die Jungs vom iobroker haben Ihren Adapter mit v2 aktualiesiert...
Vielleicht haben die ja eine lösung für das problem? Falls nicht, (oder ich hier schwachsinn schreibe) gerne den Post löschen ;-)
Im PR wird im JavaScript Code auch der String aus der PVNode REST Response als localTime verwendet, siehe https://github.com/iobroker-community-adapters/ioBroker.pvforecast/blob/d409a1fd2133975d84508a888f3885bcc9f12841/lib/pvnode.js#L210
Two ways forward: ask pvnode (their team is responsive in the linked discussion) for a UTC output option, or add a user-supplied UTC-offset param applied via simple arithmetic (with a documented DST caveat).
Another option is to use the local time and document that the timezone of the PVNode and the EVCC host shall match.
I prefer the use of local time and a good documentation plus an improvement suggestion for pvnode API for a UTC output option
Hey guys, thanks for the continued work. We have shipped the V2 API with local timezones to make data handling easier, but did not think of cases like this - our bad.
To solve this issue, I have just released a new version of the API that let's you request the data in UTC format ending in Z (e.g. 2026-06-09T10:00:00Z).
To do this, simply add ?timezone=utc in your request. Default is ?timezone=local which returns the timestamps in local format just like before to not break any existing integrations.
It is documented in the API reference here: https://pvnode.com/docs/api/forecast#get-forecast-for-a-site
That should let you drop the manual timezone handling entirely. Let me know if that works for you!
@GerdZanker this PR is missing simplified UTC handling
Thank you @darwindaume to the API enhancement. The request is upated in this PR and the jq parsing is now as simple as in the old version.
@darwindaume can I kindly ask you to ping me on [email protected]?
Btw.: just switched to v2 and it seems to be so much better than Solcast in terms of accuracy!
Sent you a mail! Sorry wrote Andy instead of Andi by mistake. @andig