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

Feature/add hoymiles wifi inverter as a meter #16204

Closed

Conversation

BLun78
Copy link

@BLun78 BLun78 commented Sep 18, 2024

Hello Evcc Team,

thx for your good work.
I will now pay some thing bag with this pull request.
It includes the feature:

  • Hoymiles Wifi Inverter (tested with HMS-800W-2T) as a Meter in evcc.

To my person:

  • I develop over years software.
  • It is my first go lang project.

Configuration Inverter:

  • Only the host/ipaddress is need.
  • The Hoymiles Inverter must add to the Hoymiles Cloud. Then it is possible for the inverter to join the wlan and to get the local ipaddress.

Library:

Som thing for claification:

  • for me it is not clear, if i have write the hoymiles-wifi.yaml correct. So please check it.

Example:

meters:
  - type: template
    template: hoymiles-wifi
    usage: pv
    host: 192.168.1.10
    name: GarageStrasse
  - type: template
    template: hoymiles-wifi
    host: 192.168.1.11
    name: GrageGarten
site:
  title: Mein Zuhause
  meters:
    pv:
      - GarageStrasse
      - GrageGarten

@andig andig added the devices Specific device support label Sep 18, 2024
meter/hoymiles_wifi.go Outdated Show resolved Hide resolved
meter/hoymiles_wifi.go Outdated Show resolved Hide resolved
meter/hoymiles_wifi.go Outdated Show resolved Hide resolved
meter/hoymiles_wifi.go Outdated Show resolved Hide resolved
meter/hoymiles_wifi.go Outdated Show resolved Hide resolved
meter/hoymiles_wifi.go Show resolved Hide resolved
meter/hoymiles_wifi.go Outdated Show resolved Hide resolved
meter/hoymiles_wifi.go Outdated Show resolved Hide resolved
meter/hoymiles_wifi.go Outdated Show resolved Hide resolved
meter/hoymiles_wifi.go Outdated Show resolved Hide resolved
@andig andig marked this pull request as draft September 20, 2024 09:50
Björn Lundström and others added 3 commits September 25, 2024 20:23
@BLun78 BLun78 marked this pull request as ready for review September 25, 2024 18:44
// int32 would not be Year 2038 safe
// See https://en.wikipedia.org/wiki/Year_2038_problem
// Not 100% sure if the models are self-defined or provided by hoymiles
request.Time = int32(time.Now().Unix())
Copy link
Member

Choose a reason for hiding this comment

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

Das kann in. Die Initialisierung des Requests mit rein. Eigentlich scheint das aber in die Lib zu gehören?


result, err := hmWifi.client.GetRealDataNew(request)
if err != nil {
if hmWifi.lastValue != 0 && !hmWifi.lastValueUpdated.Add(time.Minute*15).Before(time.Now()) {
Copy link
Member

Choose a reason for hiding this comment

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

Wozu dient das?

if hmWifi.lastValue != 0 && !hmWifi.lastValueUpdated.Add(time.Minute*15).Before(time.Now()) {
hmWifi.lastValue = 0
}
if err.Error() == "client connection is closed" {
Copy link
Member

Choose a reason for hiding this comment

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

Offline ist offline- das sollte das Gerät nicht überbrücken.

sysErr, ok2 := opErr.Err.(*os.SyscallError)
if ok2 && sysErr.Err == syscall.Errno(10060) {
hmWifi.log.DEBUG.Printf("HoymilesWifi the Host is offline: %s", hmWifi.cc.Host)
return hmWifi.lastValue, nil
Copy link
Member

Choose a reason for hiding this comment

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

Dito

return value, err
}

defer func(client *hoymiles_wifi.ClientData) {
Copy link
Member

Choose a reason for hiding this comment

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

Das wäre dann

defer client.CloseConnection()

Copy link
Member

Choose a reason for hiding this comment

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

Aber wozu brauchts das überhaupt?

meter/hoymiles_wifi.go Outdated Show resolved Hide resolved
meter/hoymiles_wifi.go Outdated Show resolved Hide resolved
meter/hoymiles_wifi.go Outdated Show resolved Hide resolved
Björn Lundström and others added 6 commits September 27, 2024 21:55
…r-meter' into feature/add-hoymiles-wifi-inverter-meter
Co-authored-by: andig <cpuidle@gmail.com>
Co-authored-by: andig <cpuidle@gmail.com>
Co-authored-by: andig <cpuidle@gmail.com>
@andig andig marked this pull request as draft September 29, 2024 13:06
@github-actions github-actions bot added the stale Outdated and ready to close label Oct 6, 2024
@github-actions github-actions bot closed this Oct 11, 2024
@jmtatsch
Copy link

I would be really sad if this weren't integrated.
I think this is the most sold balcony inverter in Germany.
And uncounted inverters mess up evcc surplus charging so i needed to install a tasmota device as meter.

@BLun78
Copy link
Author

BLun78 commented Oct 22, 2024

I will prepare a new Commit. I test ist at home.

@andig
Copy link
Member

andig commented Oct 22, 2024

Let's reopen when updated- thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devices Specific device support stale Outdated and ready to close
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants