Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add solar forecast (Solcast/Forecast.Solar) #18269

Merged
merged 12 commits into from
Feb 9, 2025
Merged

Add solar forecast (Solcast/Forecast.Solar) #18269

merged 12 commits into from
Feb 9, 2025

Conversation

andig
Copy link
Member

@andig andig commented Jan 18, 2025

@naltatis as simplified alternative to #9454 and without integrating the forecast into planning, it might be nice to displace a solar forecast (in W). Short-term it would be nice to collect and log the data for forecast/actual comparison, later use it for forecasting.

Is this something you'd be interested in including?

From                   To                     Price/Cost
2025-01-18 10:19:34    2025-01-18 10:19:34    0.000
2025-01-18 11:00:00    2025-01-18 11:00:00    678.000
2025-01-18 12:00:00    2025-01-18 12:00:00    1108.000
2025-01-18 13:00:00    2025-01-18 13:00:00    1390.000
2025-01-18 14:00:00    2025-01-18 14:00:00    1508.000
2025-01-18 15:00:00    2025-01-18 15:00:00    1578.000
2025-01-18 16:00:00    2025-01-18 16:00:00    1851.000
2025-01-18 17:00:00    2025-01-18 17:00:00    1861.000
2025-01-18 18:00:00    2025-01-18 18:00:00    1227.000
2025-01-18 18:42:40    2025-01-18 18:42:40    0.000
2025-01-19 10:18:30    2025-01-19 10:18:30    0.000
2025-01-19 11:00:00    2025-01-19 11:00:00    1377.000
2025-01-19 12:00:00    2025-01-19 12:00:00    2200.000
2025-01-19 13:00:00    2025-01-19 13:00:00    2767.000
2025-01-19 14:00:00    2025-01-19 14:00:00    3055.000
2025-01-19 15:00:00    2025-01-19 15:00:00    2995.000
2025-01-19 16:00:00    2025-01-19 16:00:00    2679.000
2025-01-19 17:00:00    2025-01-19 17:00:00    2025.000
2025-01-19 18:00:00    2025-01-19 18:00:00    1279.000
2025-01-19 18:44:21    2025-01-19 18:44:21    0.000

TODO

  • solar tariff type @andig
  • request/udpate solar @andig
  • solar docs group @naltatis > needs documentation tag regelt

Out of scope

  • ui @naltatis
  • integrate with planner
  • multi-solar

@andig andig added the tariffs Specific tariff support label Jan 18, 2025
@andig andig force-pushed the feat/forecast-solar branch from 3835240 to d54f9eb Compare January 19, 2025 11:18
@andig andig added the experimental Experimental feature label Jan 19, 2025
@naltatis
Copy link
Member

Good idea to start with a display only integration. Makes things a lot easier.
I'll think about how to visualize/integrate this data in a first iteration. A simple "expected kWh of solar energy in the next 24h" information in the main UI could be a good entry point.

@github-actions github-actions bot added the stale Outdated and ready to close label Jan 31, 2025
@andig andig added backlog Things to do later and removed stale Outdated and ready to close labels Feb 2, 2025
core/site_api.go Outdated Show resolved Hide resolved
@naltatis
Copy link
Member

naltatis commented Feb 9, 2025

Was hältst du davon tariff.solar gleich als Liste (oder optional als Liste) anzulegen? Dann brauchen wir nicht "Multi-Flächen" in jedes Template einbauen.

@naltatis
Copy link
Member

naltatis commented Feb 9, 2025

Wir können was die Ausgabe angeht (UI, HTTP Endpunkt, Publish, ...) ja erst einmal alle Watt-Werte Zeiteinheit (Stunde?) addieren.

@andig andig changed the title Add Forecast.Solar solar forecast Add solar forecast (Solcast/Forecast.Solar) Feb 9, 2025
@andig
Copy link
Member Author

andig commented Feb 9, 2025

Dann brauchen wir nicht "Multi-Flächen" in jedes Template einbauen.

Schritt 2? Passt erstmal nicht in die aktuelle Struktur.

@andig andig mentioned this pull request Feb 9, 2025
6 tasks
@andig andig added the needs documentation Triggers issue creation in evcc-io/docs label Feb 9, 2025
@goebelmeier
Copy link
Contributor

Sehr cool! Als zweiter (oder dritter, nach dem Planner) Step wäre super gut, wenn man das adjusting implementieren könnte - https://doc.forecast.solar/actual

Dann werden die Werte nämlich noch mal deutlich realitätsnäher.

Dabei ist nur die spannende Frage wo man die bisher erzeugten kWh her bekommt. Viele Wechselrichter spucken das sicherlich aus, aber da müsste man noch mal an alle WR ran.

@cschlipf
Copy link
Contributor

cschlipf commented Feb 13, 2025

Sehr cool. Aber kann es sein, dass in der Docu ein Fehler ist oder wie soll ich das Parent Element 'undefined' verstehen?
image

Scheint als müsste man es unter 'tariffs' einfügen. Im UI Editor oder in der YAML Referenz finde ich aber auch noch keinen Hinweis darauf wie das Element unter 'tariffs' heißt. forecast scheint es nicht zu sein.

@StevieC121176
Copy link

Können dann auch mehrere Dachflächen angegeben werden? Meine Dachfläche ist z.Bsp. Geteilt in Ost und West.

@StefanSchoof
Copy link
Contributor

Können dann auch mehrere Dachflächen angegeben werden? Meine Dachfläche ist z.Bsp. Geteilt in Ost und West.

Weiter oben hier: #18269 (comment)

Dann brauchen wir nicht "Multi-Flächen" in jedes Template einbauen.

Schritt 2? Passt erstmal nicht in die aktuelle Struktur.

@andig
Copy link
Member Author

andig commented Feb 14, 2025

@StevieC121176 bei forecast.solar kannst du das als custom Tarif machen, bei Solcast geht's aktuell nicht.

@undauntedjogging
Copy link

@StevieC121176 bei forecast.solar kannst du das als custom Tarif machen, bei Solcast geht's aktuell nicht.

Könnt Ihr in der Doku ein Beispiel hinterlegen was bei Solcast / Forecast hinterlegt werden muss?
Den Tag mit 'undefined' verstehe ich nicht wirklich.
Über die UI scheint es ja noch nicht verwaltbar zu sein.

https://docs.evcc.io/docs/tariffs#eigenes-plugin

@undauntedjogging
Copy link

Wie sieht denn dann die ausgefüllte yaml für den Bereich Solcast aus ?
Hat da jemand ein Beispiel bereits.

undefined type: template template: solcast site: token:

@cschlipf
Copy link
Contributor

cschlipf commented Feb 14, 2025

So startet EVCC bei mir:

tariffs:
  currency: EUR
  grid:
    type: template
    template: tibber
    token: XXXXXX
  feedin:
    type: fixed
    price: 0.082
  solar:
    type: template
    template: solcast
    site: XXXXX
    token: XXXXX

Allerdings sehe ich noch nichts von der Forecast im UI.

BTW: Ich empfehle unbedingt Solcast. Die Vorhersage von Forecast passt bei mir in Home Assistant überhaupt nicht.

@andre68723
Copy link

Allerdings sehe ich noch nichts von der Forecast im UI

#18709

@cschlipf
Copy link
Contributor

cschlipf commented Feb 14, 2025

Oh... noch in Draft state... Na das erklärt einiges. D.h. im Moment bringt mir die Definition im YAML hier noch gar nichts?

@undauntedjogging
Copy link

So startet EVCC bei mir:

tariffs:
  currency: EUR
  grid:
    type: template
    template: tibber
    token: XXXXXX
  feedin:
    type: fixed
    price: 0.082
  solar:
    type: template
    template: solcast
    site: XXXXX
    token: XXXXX

Allerdings sehe ich noch nichts von der Forecast im UI.

BTW: Ich empfehle unbedingt Solcast. Die Vorhersage von Forecast passt bei mir in Home Assistant überhaupt nicht.

So habe ich es gerade auch bei mir hinzugefügt.

Site -> Die Ressource ID aus dem Solcast Dashboard
Token -> API Key aus dem Solcast Dashboard

EVCC startet auch problemlos aber allerdings sehe ich nirgends etwas davon.
In den Logs auch keinen Eintrag.

Kann man das auch mehrmals eintragen wenn man mehrere Ressources IDS und Tokens entsprechend hat?
Ich habe nämlich 2 Accounts mit 3 unterschiedlichen Himmelsrichtungen (OST,West,Süd).

Bei HA kann man nämlich bei der Solcast Integration zwei Keys kommagetrennt hinterlegen.

@naltatis
Copy link
Member

Die Doku ist nun aktualisiert: https://docs.evcc.io/docs/tariffs#pv-vorhersage

@undauntedjogging
Copy link

Die Doku ist nun aktualisiert: https://docs.evcc.io/docs/tariffs#pv-vorhersage

Danke @naltatis
ist es möglich auch mehrere Ressource IDś und Tokens zu hinterlegen?
Annahme:
2 Accounts mit 3 oder 4 verschiedenen RessourceIDS.
Der free Account bringt nämlich nur maximal 2 Sites mit.

@naltatis
Copy link
Member

Aktuell nicht

@andig
Copy link
Member Author

andig commented Feb 14, 2025

Der free Account bringt nämlich nur maximal 2 Sites mit.

Ich denke ehrlich gesagt, dass wir auch nicht bewusst Limits der Anbieter umgehen sondern good citizens sein sollten.

@undauntedjogging
Copy link

Der free Account bringt nämlich nur maximal 2 Sites mit.

Ich denke ehrlich gesagt, dass wir auch nicht bewusst Limits der Anbieter umgehen sondern good citizens sein sollten.

Bei Solcast ist es so, dass du mit einer Site nur eine Ausrichtung abdeckst.
Hast du ein Dach mit 2 oder 3 verschiedenen Ausrichtungen (was ja nicht unüblich ist) benötigst du entsprechend eine neue Ressource ID.
Wenn ich in EVCC zukünftig nur eine Ressource ID eintrage (Beispiel für die Ausrichtung OST) würden mir die anderen entsprechend fehlen was sehr schade wäre für die entsprechende Prognose.

@mucki12
Copy link
Contributor

mucki12 commented Feb 14, 2025

Bei Solcast ist es so, dass du mit einer Site nur eine Ausrichtung abdeckst.

Sind es nicht zwei Ausrichtungen? Oder hat sich das mit neuen Anmeldungen geändert?
Zitat:
Your hobbyist account is limited to the creation of 2 Home PV arrays within 1km of each other.

@undauntedjogging
Copy link

Bei Solcast ist es so, dass du mit einer Site nur eine Ausrichtung abdeckst.

Sind es nicht zwei Ausrichtungen? Oder hat sich das mit neuen Anmeldungen geändert? Zitat: Your hobbyist account is limited to the creation of 2 Home PV arrays within 1km of each other.

Das ist das was ich im Account bei mir angezeigt bekomme:
Da ich beispielsweise 3 verschiedene Ausrichtungen (O,S,W) habe, habe ich entsprechend 3 Ressource IDS mit 2 API Keys mit 2 entsprechenden verschiedenen Email Accounts.

Your hobbyist account is limited to the creation of 2 Home PV arrays within 1km of each other.
If you have multiple arrays, learn how to configure a split array.

@naltatis
Copy link
Member

@undauntedjogging @mucki12 siehe Diskussionsverlauf oben. Mehrere Ressource IDs für Solcast sind geplant aber waren für diesen PR out-of-scope.

@undauntedjogging
Copy link

@undauntedjogging @mucki12 siehe Diskussionsverlauf oben. Mehrere Ressource IDs für Solcast sind geplant aber waren für diesen PR out-of-scope.

Das hört sich doch super an - Vielen Dank!

@mucki12
Copy link
Contributor

mucki12 commented Feb 14, 2025

@naltatis
Vollkommen klar. Habe es zugegebenerweise noch nicht mit evcc getestet, aber wenn ich die zwei offiziell erlaubten zwei pv Arrays in Solcast hinterlege und die Solcast API in HA befrage, bekomme ich natürlich das Gesamtergebnis.
Daher auch mein Hinweis, dass zwei Ausrichtungen heute schon möglich sind.

@StefanSchoof
Copy link
Contributor

Das ist das was ich im Account bei mir angezeigt bekomme: Da ich beispielsweise 3 verschiedene Ausrichtungen (O,S,W) habe, habe ich entsprechend 3 Ressource IDS mit 2 API Keys mit 2 entsprechenden verschiedenen Email Accounts.

Das ist laut deren Terms of Use nicht erlaubt:

REASONABLE USAGE
3. To not create more than one account, ask others to create accounts on your behalf, or use software designed to generate accounts

@Timer2000
Copy link

Super cool wie das hier weitergeht.

Mal eine Frage von einem User ohne tiefergehenden Programmierkentnissen, wäre es für die Home Assistant User nicht am einfachsten die Werte aus HA zu verwenden? Der API Zugriff ist nehmlich begrenzt und wird von HA bereits ausgenutzt. Bei der Weiterleitung würden keine zusätzlichen API Abfragen entstehen. Zum anderen habe ich da bereits Summen meiner Dachflächen vorliegen.

@andig
Copy link
Member Author

andig commented Feb 14, 2025

Forecast ist auch nur ein Tarif. Also ja.

evcc: ["skiptest"]
group: solar
params:
- name: lat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sollten lat und lon auch in die Liste der redactSecrets?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you like...

@premultiply
Copy link
Member

premultiply commented Feb 14, 2025

Können wir bei Forecast.Solar noch den horizon-Parameter ergänzen?
Dieser dient um Verschattungen in die Prognose einzubinden.
Siehe https://doc.forecast.solar/horizon

@djfanatix
Copy link
Contributor

Super cool wie das hier weitergeht.

Mal eine Frage von einem User ohne tiefergehenden Programmierkentnissen, wäre es für die Home Assistant User nicht am einfachsten die Werte aus HA zu verwenden? Der API Zugriff ist nehmlich begrenzt und wird von HA bereits ausgenutzt. Bei der Weiterleitung würden keine zusätzlichen API Abfragen entstehen. Zum anderen habe ich da bereits Summen meiner Dachflächen vorliegen.

I think this is also a good solution, the HA Solcast integration (HACS), saves all data in a JSON in HA.
Can EVCC get this data or can we send it to EVCC?

@andig
Copy link
Member Author

andig commented Feb 15, 2025

Locking this PR. Apparently the exact same question can be asked any number of times…

@evcc-io evcc-io locked as resolved and limited conversation to collaborators Feb 15, 2025
@naltatis
Copy link
Member

In short answer: Yes, other integrations with new datasources or pass-throughs from other systems like HA are possible. Please create PRs or Issues with details infos of the desired scenario.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backlog Things to do later experimental Experimental feature needs documentation Triggers issue creation in evcc-io/docs tariffs Specific tariff support
Projects
None yet
Development

Successfully merging this pull request may close these issues.