Skip to content

Add solarprognose.de#19364

Closed
thlink68 wants to merge 17 commits into
evcc-io:masterfrom
thlink68:patch-2
Closed

Add solarprognose.de#19364
thlink68 wants to merge 17 commits into
evcc-io:masterfrom
thlink68:patch-2

Conversation

@thlink68
Copy link
Copy Markdown
Contributor

@thlink68 thlink68 commented Mar 3, 2025

Depends on #19474

Template um www.solarprognose.de als Tarifdefinition für die Solarprognose hinzuzufügen

Template um www.solarprognosede als Tarifdefinition für die Solarprognose hinzuzufügen
@andig andig added the tariffs Specific tariff support label Mar 3, 2025
@andig andig changed the title Create solarprognose.de Add solarprognose.de Mar 3, 2025
Comment thread templates/definition/tariff/solarprognose.de Outdated
Comment thread templates/definition/tariff/solarprognose.de Outdated
Comment thread templates/definition/tariff/solarprognose.de Outdated
Comment thread templates/definition/tariff/solarprognose.de Outdated
Comment thread templates/definition/tariff/solarprognose.de Outdated
@andig andig marked this pull request as draft March 3, 2025 11:31
Copy link
Copy Markdown
Contributor

@StefanSchoof StefanSchoof left a comment

Choose a reason for hiding this comment

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

Ich denke der Dateiname sollte noch auf solarprognose-de.yaml geändert werden.

Copy link
Copy Markdown
Contributor

@StefanSchoof StefanSchoof left a comment

Choose a reason for hiding this comment

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

Ich habe das template mal ausprobiert und mit dem unquote funktioniert das template

Comment thread templates/definition/tariff/solarprognose-de.yaml Outdated
Comment thread templates/definition/tariff/solarprognose-de.yaml Outdated
thlink68 and others added 2 commits March 4, 2025 08:40
Co-authored-by: StefanSchoof <4662023+StefanSchoof@users.noreply.github.com>
Co-authored-by: StefanSchoof <4662023+StefanSchoof@users.noreply.github.com>
Comment thread templates/definition/tariff/solarprognose-de.yaml Outdated
Comment thread templates/definition/tariff/solarprognose-de.yaml Outdated
Comment thread templates/definition/tariff/solarprognose-de.yaml Outdated
Comment thread templates/definition/tariff/solarprognose-de.yaml Outdated
Comment thread templates/definition/tariff/solarprognose-de.yaml Outdated
@github-actions github-actions Bot added the stale Outdated and ready to close label Mar 17, 2025
@tolot27
Copy link
Copy Markdown
Contributor

tolot27 commented Mar 19, 2025

Template um www.solarprognosede als Tarifdefinition für die Solarprognose hinzuzufügen

Unwichtig, aber praktisch: kannst du den Link korrigieren, so dass er funktioniert? Oder ist das eine Policy?

@github-actions github-actions Bot removed the stale Outdated and ready to close label Mar 19, 2025
@github-actions github-actions Bot added the stale Outdated and ready to close label Mar 26, 2025
@github-actions github-actions Bot closed this Mar 31, 2025
Comment thread templates/definition/tariff/solarprognose-de.yaml Outdated
@andig andig reopened this Apr 9, 2025
@github-actions github-actions Bot removed the stale Outdated and ready to close label Apr 9, 2025
Co-authored-by: StefanSchoof <4662023+StefanSchoof@users.noreply.github.com>
@andig andig marked this pull request as ready for review April 9, 2025 07:18
Comment thread templates/definition/tariff/solarprognose-de.yaml Outdated
Comment thread templates/definition/tariff/solarprognose-de.yaml
Comment thread templates/definition/tariff/solarprognose-de.yaml Outdated
@github-actions github-actions Bot added the stale Outdated and ready to close label Apr 16, 2025
@github-actions github-actions Bot closed this Apr 21, 2025
@tolot27
Copy link
Copy Markdown
Contributor

tolot27 commented Sep 7, 2025

Nun wurde der PR vom bot geschlossen. Könnte er wieder geöffnet und gemerged werden, falls ready?

@andig andig reopened this Sep 7, 2025
@andig
Copy link
Copy Markdown
Member

andig commented Sep 7, 2025

Steht auf Fehler, daher kein Merge

@andig andig closed this Sep 7, 2025
@tolot27
Copy link
Copy Markdown
Contributor

tolot27 commented Sep 7, 2025

Steht auf Fehler, daher kein Merge

Ich fixe das gern. Dazu kann ich einen neuen PR aufmachen oder diesen fixen, falls ich Maintainer wäre (was ich noch nicht bin), sofern "Maintainers are allowed to edit this pull request." aktiviert ist. Also einen neuen PR...

@andig andig reopened this Sep 7, 2025
@andig andig closed this Sep 7, 2025
@github-actions github-actions Bot removed the stale Outdated and ready to close label Sep 7, 2025
@andig
Copy link
Copy Markdown
Member

andig commented Sep 7, 2025

Da Du den nicht anpassen kannst brauchts einen neuen PR.

Copy link
Copy Markdown
Contributor

@tolot27 tolot27 left a comment

Choose a reason for hiding this comment

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

@thlink68 Ich habe die notwendige Korrektur als copy-paste kommentiert. Willst du das noch einfügen? Sonst müsste ein neuer PR erstellt werden.

de: Zugriffs-Schlüssel aus Benutzer-Profil
required: true
- name: item
choice: ["location", "plant", "inverter"]
Copy link
Copy Markdown
Contributor

@tolot27 tolot27 Sep 7, 2025

Choose a reason for hiding this comment

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

"module_field" könnte zum Array noch hinzugefügt werden.

Außerdem fehlt für diesen Parameter eine Beschreibung, welches zum Fehlschlagen der github action führt. Es könnte folgende Beschreibung verwendet werden:

    description:
      en: Element type to be queried
      de: Elementtyp, der abgefragt werden soll

Dieser Parameter ist laut https://www.solarprognose.de/web/de-de/solarprediction/page/api nicht wirklich erforderlich, sofern nur ein Standort konfiguriert ist (häufigster Fall).

tariff: solar
forecast:
source: http
uri: https://www.solarprognose.de/web/solarprediction/api/v1?_format=json&access-token={{ .accesstoken }}&item={{ .item }}&token={{ unquote .uniquetoken }}&algorithm={{ .algorithm }}&type=hourly
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Falls item als required: false konfiguriert werden sollte, müsste das beim Zusammenbau der URL berücksichtigt werden.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Falls item als required: false konfiguriert werden sollte

Ich glaub required: false ist nicht richtig bzw. gibt es nicht mal. Es müsste advanced: true sein.

@thlink68
Copy link
Copy Markdown
Contributor Author

thlink68 commented Sep 7, 2025

@tolot27 Danke für den Hinweis. Die Beschreibung für Item und Erweiterung des Arrays habe ich hinzugefügt. Wie müßte ich denn die URL anpassen, um item nicht als required zu setzen?

@tolot27
Copy link
Copy Markdown
Contributor

tolot27 commented Sep 7, 2025

@tolot27 Danke für den Hinweis. Die Beschreibung für Item und Erweiterung des Arrays habe ich hinzugefügt. Wie müßte ich denn die URL anpassen, um item nicht als required zu setzen?

Ich habe es mal so umgesetzt, dass item/id/token auch optional sind, was es für die meisten Anwendungsfälle einfacher macht:

params:
  - name: token
    description:
      en: Access Token from User Profile
      de: Zugriffs-Schlüssel aus Benutzer-Profil
    advanced: true
  - name: item
    choice: ["location", "plant", "inverter", "module_field"]
    description:
      en: Item type to be queried.
      de: Elementtyp, der abgefragt werden soll.
    help:
      en: Item and id/token are only required if more than one location is configured or if a specific item is to be queried. Otherwise, the API returns the data for the first location. See also https://www.solarprognose.de/web/en-en/solarprediction/page/api
      de: Item und id/token werden nur benötigt, wenn mehr als ein Standort konfiguriert ist oder ein bestimmtes Element abgefragt werden soll. Ansonsten gibt die API die Daten für den ersten Standort zurück. Siehe auch https://www.solarprognose.de/web/de-de/solarprediction/page/api
    advanced: true
  - name: id
    description:
      en: Unique ID of the item to be queried
      de: Eindeutige ID des abzufragenden Elements
    advanced: true
  - name: uniquetoken
    description:
      en: Unique token of the item to be queried
      de: Eindeutiger Schlüssel des abzufragenden Elements
    advanced: true
  - name: algorithm
    choice: ["mosmix","own-v1","clearsky"]
    description:
      en: Forecasting Algorithm (mosmix, own-v1 or clearsky)
      de: Prognosealgorithmus (mosmix, own-v1 oder clearsky)
    default: mosmix
    advanced: true
  - name: interval
    default: 1h
    advanced: true
render: |
  type: custom
  tariff: solar
  forecast:
    source: http
    uri: https://www.solarprognose.de/web/solarprediction/api/v1?_format=json&access-token={{ .token }}{{ if .item }}&item={{ .item }}{{ if .id }}&id={{ .id }}{{ else }}{{ if .uniquetoken }}&token={{ unquote .uniquetoken }}{{ end }}{{ end }}{{ end }}&algorithm={{ .algorithm }}&type=hourly

Dann braucht man nur noch wie folgt zu konfigurieren:

solar:
  - type: template
    template: solarprognose
    token: *******

Bitte entferne auch überall die unnötigen Leerzeichen an Zeilenenden.

Ich fände es auch gut, wenn die Datei solarprognose.yaml heißen würde, also ohne -de. Bei Forecast.Solar ist ja auch kein -de im Namen und bei Solcast kein -au. Aber das nur am Rande.

Ich habe die verschiedenen Kombinationen auch getestet.
@andig gibt es für das solar forecasting auch unit tests? Ich habe da ad hoc keine gefunden, auch nicht für Tarife im allgemeinen.

PS: Das mit dem preferredNextApiRequestAt könnte man noch implementieren. Dazu benötigt es dann vermutlich ein Go Modul oder @andig?

@tolot27
Copy link
Copy Markdown
Contributor

tolot27 commented Sep 7, 2025

Muss eigentlich noch irgendwas ergänzt werden, so dass in der Konfiguration bei "PV-Vorhersage" etwas angezeigt wird, statt des Minus'?
image

@thlink68
Copy link
Copy Markdown
Contributor Author

@tolot27 Ich habe Deinen Vorschlag übernommen. überflüssige Leerzeichen konnte ich keine finden. Den Dateinamen kann ich gerne noch umbenennen, ich hatte ihn auf Vorschlag von @StefanSchoof von solarprognose.yaml auf solarprognose-de.yaml geändert.

@tolot27
Copy link
Copy Markdown
Contributor

tolot27 commented Sep 10, 2025

@thlink68 Kannst du bitte die Änderungen schon mal pushen, so dass die github checks laufen?
Bzgl. Dateiname: was sind sie Gründe für das "-de", @StefanSchoof ? Siehe auch meine vorangegangene Argumentation bzgl. der anderen templates. Von noch neu und lerne.

@StefanSchoof
Copy link
Copy Markdown
Contributor

Ging um Einheitlichkeit. https://github.com/evcc-io/evcc/blob/master/templates/definition/tariff/api-akkudoktor-de.yaml Aber zu dem Zeitpunkt gab es nur wenige Tarifs und ich denke die meisten anderen haben es jetzt nicht.

@thlink68
Copy link
Copy Markdown
Contributor Author

@tolot27: Ist jetzt wieder auf solarprognose.yaml benannt. Wie kann ich die Änderungen denn pushen?

@tolot27
Copy link
Copy Markdown
Contributor

tolot27 commented Sep 11, 2025

@tolot27: Ist jetzt wieder auf solarprognose.yaml benannt. Wie kann ich die Änderungen denn pushen?

Wo hast du denn die Änderungen alle gemacht? Bei dir lokal auf der Festplatte? Falls ja und falls du in deinem richtigen lokalen git branch thlink68:patch-2 bist, sollte ein git push genügen. Falls du lokal noch nicht in der Branch patch-2 bist, musst du erst mit git checkout patch-2 die branch wechseln und kannst dann pushen. Und falls du alles über GUI machst, dann die entsprechenden Operationen via GUI ausführen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tariffs Specific tariff support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants