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

Added support for SMA Meters #59

Merged
merged 14 commits into from
Apr 27, 2020
Merged

Added support for SMA Meters #59

merged 14 commits into from
Apr 27, 2020

Conversation

DerAndereAndi
Copy link
Contributor

@DerAndereAndi DerAndereAndi commented Apr 26, 2020

Fix #49 Added Support for SMA Meters

  • Support for SMA Home Manager 2.0, this is a Grid meter
  • Support for SMA Energy Meter 30, this can be used as a Grid meter or PV meter
  • Both devices use UDP multicast to send a binary message with the current power values overall and for each phase encoded with OBIS codes
  • Including two test cases with sample multicast data packages

- Support for SMA Home Manager 2.0, this is a Grid meter
- Support for SMA Energy Meter 30, this can be used as a Grid meter or PV meter
- Both devices use UDP multicast to send a binary message with the current power values overall and for each phase encoded with OBIS codes
- Little refactor to make testing easier
- Added test cases with sample multicast data packages
@DerAndereAndi DerAndereAndi changed the title Feature/49 sma home energy manager Added support for SMA Meters Apr 26, 2020
@andig
Copy link
Member

andig commented Apr 26, 2020

Did you test concurrency using go run -race to ensure this doesn't contain any racy code?

@DerAndereAndi
Copy link
Contributor Author

Just did, works fine. After a few seconds the multicast data packages take longer than the timeout, but I guess that is because of the -race flag triggering this as it increasing the timing.

@DerAndereAndi
Copy link
Contributor Author

Running a build with this from now on, let's see how it works tomorrow :)

meter/smameter.go Outdated Show resolved Hide resolved
meter/smameter.go Outdated Show resolved Hide resolved
meter/smameter.go Outdated Show resolved Hide resolved
meter/smameter.go Outdated Show resolved Hide resolved
meter/smameter.go Outdated Show resolved Hide resolved
- Changed naming
- Updated logging prefix
- Other minor fixes
@DerAndereAndi
Copy link
Contributor Author

DerAndereAndi commented Apr 27, 2020

Test build failed with golangci/golangci-lint crit unable to find '' - use 'latest' or see https://github.com/golangci/golangci-lint/releases for details

The linter showed no errors on my local run.

meter/sma.go Outdated Show resolved Hide resolved
meter/sma.go Outdated Show resolved Hide resolved
meter/sma.go Outdated Show resolved Hide resolved
meter/sma.go Outdated Show resolved Hide resolved
meter/sma.go Outdated Show resolved Hide resolved
meter/sma/listener.go Outdated Show resolved Hide resolved
meter/sma/listener.go Outdated Show resolved Hide resolved
meter/sma/listener.go Outdated Show resolved Hide resolved
meter/sma/listener.go Outdated Show resolved Hide resolved
meter/sma/listener.go Outdated Show resolved Hide resolved
@andig andig added the enhancement New feature or request label Apr 27, 2020
- code restructuring
- simplifications
- bugfixes
This fixes bugs of the previous commits changes and simplifies the code
@DerAndereAndi
Copy link
Contributor Author

Hier hätte ich die Konstante nicht verwendet, aber ist Geschmackssage.

Ich schon 😁

@andig
Copy link
Member

andig commented Apr 27, 2020

meter/sma.go Outdated Show resolved Hide resolved
meter/sma.go Show resolved Hide resolved
meter/sma/listener.go Outdated Show resolved Hide resolved
meter/sma/listener.go Outdated Show resolved Hide resolved
meter/sma/listener.go Outdated Show resolved Hide resolved
meter/sma/listener_test.go Outdated Show resolved Hide resolved
meter/sma/listener.go Outdated Show resolved Hide resolved
meter/sma/listener.go Outdated Show resolved Hide resolved
meter/sma/listener.go Show resolved Hide resolved
@andig
Copy link
Member

andig commented Apr 27, 2020

/cc @premultiply- is this something you would want to test while in PR status?

@premultiply
Copy link
Member

@andig Vor Morgen werde ich leider nicht dazu kommen können etwas zu testen.
Also gerne schon mal mergen wenn es von der Theorie her gehen sollte ;-)

@DerAndereAndi
Copy link
Contributor Author

@premultiply das geht nicht nur von der Theorie, das läuft hier sogar praktisch 😁

@andig andig merged commit 0f7fe7a into evcc-io:master Apr 27, 2020
@DerAndereAndi DerAndereAndi deleted the feature/49-sma-home-energy-manager branch April 27, 2020 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding support for SMA meters
3 participants