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

Sungrow-Hybrid: fix charge #12215

Merged
merged 6 commits into from
Jul 22, 2024
Merged

Sungrow-Hybrid: fix charge #12215

merged 6 commits into from
Jul 22, 2024

Conversation

premultiply
Copy link
Member

@premultiply premultiply commented Feb 12, 2024

Depends on #14960

@premultiply premultiply changed the title fix charge Sungrow-Hybrid: Fix charge Feb 12, 2024
@premultiply premultiply added the devices Specific device support label Feb 12, 2024
@naltatis
Copy link
Member

naltatis commented Feb 12, 2024

Scheint ein Fehler im Template zu sein:

[main  ] FATAL 2024/02/12 15:49:59 cannot create meter 'sungrow_battery': cannot create meter type 'template': cannot create meter type 'custom': battery mode: 1 error(s) decoding:

* '' has invalid keys: set

@premultiply
Copy link
Member Author

@andig Da braucht das Modbus-Plugin erst noch eine passende Set-Erweiterung, oder?

@andig
Copy link
Member

andig commented Feb 12, 2024

Was solls denn tun?

@premultiply
Copy link
Member Author

Wert aus Register A lesen (, skalieren) und dann in Register B schreiben.

So wie mit const-Plugin als Festwert auch.
Nur halt dynamisch via Modbus gelesen.

@andig
Copy link
Member

andig commented Feb 12, 2024

Mhhm. Keine Ahnung ob das mit dem Go Plugin gehen sollte (@GrimmiMeloni ?). Sonst bräuchte es wohl noch etwas Neues (copy). Langsam wirds unübersichtlich :O

@premultiply
Copy link
Member Author

Wie funktioniert das denn bei const?

@andig
Copy link
Member

andig commented Feb 12, 2024

Genauso. Aber in https://github.com/evcc-io/evcc/pull/12215/files#diff-0b0f0388fa0ea5962b68de7565e1131be1912c96e6d198ad57f6b53d77775b17R175 ist es ein modbus Plugin- das hat kein set.

Anders gesagt: const ist eigentlich eine Mischung aus copy und const. Die müssten wir jetzt- wenns orthogonal bleiben soll- aufsplitten und auch gleich alle Templates mit anpassen :O. Dann gäbe es ein eigenständiges copy plugin das hier zu verwenden wäre. Spannend wird dann nochmal, den passenden Typ zu finden bzw. zu matchen, ob input und output zueinander passen. Aber das haben wir ja schonmal irgendwie beim go Plugin gelöst. Müsste dann hier die gleiche Lösung werden.

Long story short: es braucht einen weiteren PR, der const umbaut und aufteilt.

@GrimmiMeloni
Copy link
Collaborator

Sorry, in der Ecke habe ich mich noch gar nicht umgeschaut.
Ganz neutral gefragt: was spricht denn gegen den Vorschlag von Premultiply? Der Beschreibung nach doch recht generisch einsetzbar?

@andig
Copy link
Member

andig commented Feb 14, 2024

Welches Problem wird denn hier überhaupt gelöst? Es ist kein Ticket verlinkt.

@andig
Copy link
Member

andig commented Feb 14, 2024

Und was hat das mit #12203 zu tun?

@premultiply
Copy link
Member Author

Die Zwangsladung funktioniert derzeit nicht.
Dies soll dieser PR beheben.

@andig andig changed the title Sungrow-Hybrid: Fix charge Sungrow-Hybrid: fix charge Feb 22, 2024
@github-actions github-actions bot added the stale Outdated and ready to close label Mar 14, 2024
@github-actions github-actions bot closed this Mar 19, 2024
@premultiply premultiply reopened this Mar 19, 2024
@premultiply premultiply added infrastructure Basic functionality backlog Things to do later and removed stale Outdated and ready to close labels Mar 19, 2024
@andig
Copy link
Member

andig commented Jul 14, 2024

@premultiply mit #14855 wird das wieder relevant.

@andig andig marked this pull request as ready for review July 20, 2024 11:37
@andig
Copy link
Member

andig commented Jul 20, 2024

@premultiply können wir das bitte testen?

@naltatis
Copy link
Member

@andig hier passt noch was nicht

go run main.go --config /Volumes/data/evcc/evcc.yaml meter sungrow_battery -b charge
[main  ] INFO 2024/07/21 11:49:40 evcc 0.0.0
[main  ] INFO 2024/07/21 11:49:40 using config file: /Volumes/data/evcc/evcc.yaml
[db    ] INFO 2024/07/21 11:49:41 using sqlite database: /Users/michael/.evcc/evcc.db
[mqtt  ] INFO 2024/07/21 11:49:41 connecting evcc-1227070342 at tcp://192.168.31.34:1883
[mqtt  ] DEBUG 2024/07/21 11:49:41 tcp://192.168.31.34:1883 connected
[main  ] FATAL 2024/07/21 11:49:41 set battery mode: panic: reflect: call of reflect.Value.Interface on zero Value
exit status 1

@naltatis
Copy link
Member

Hier mit mehr Logging.

go run main.go --config /Volumes/data/evcc/evcc.yaml meter sungrow_battery -b charge
[main  ] INFO 2024/07/21 15:05:23 evcc 0.0.0
[main  ] INFO 2024/07/21 15:05:23 using config file: /Volumes/data/evcc/evcc.yaml
[db    ] INFO 2024/07/21 15:05:23 using sqlite database: /Users/michael/.evcc/evcc.db
[modbus] TRACE 2024/07/21 15:05:23 modbus: send 00 01 00 00 00 06 01 06 32 f9 00 02
[modbus] TRACE 2024/07/21 15:05:23 modbus: recv 00 01 00 00 00 06 01 06 32 f9 00 02
[modbus] TRACE 2024/07/21 15:05:23 modbus: send 00 02 00 00 00 06 01 06 32 fa 00 aa
[modbus] TRACE 2024/07/21 15:05:23 modbus: recv 00 02 00 00 00 06 01 06 32 fa 00 aa
handleSetter param: batteryMode = 3
[modbus] TRACE 2024/07/21 15:05:23 modbus: send 00 03 00 00 00 06 01 04 15 fb 00 01
[modbus] TRACE 2024/07/21 15:05:23 modbus: recv 00 03 00 00 00 05 01 04 02 00 64
evaluate <invalid reflect.Value>
[main  ] FATAL 2024/07/21 15:05:23 set battery mode: panic: reflect: call of reflect.Value.Interface on zero Value
exit status 1

Ich hab der (p *Go) evaluate() methode mal nen Logging vor dem Return hinzugefügt. Da kommt <invalid reflect.Value> für v zurück.

@naltatis
Copy link
Member

Meine lokalen Tests waren jetzt alle erfolgreich. Charge Mode lädt jetzt wie gewünscht mit voller Leistung aus dem Netz.

@andig andig merged commit e41bfde into master Jul 22, 2024
6 checks passed
@andig andig deleted the fix/sungrow-batctrl branch July 22, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Things to do later devices Specific device support infrastructure Basic functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants