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

[WIP] Implement Battery-Inverter Nature, Generic-ESS and KACO blueplanet gridsave as SunSpec #1099

Merged
merged 22 commits into from
Jun 4, 2020

Conversation

sfeilmeier
Copy link
Contributor

No description provided.

@sfeilmeier sfeilmeier force-pushed the feature/kaco-sunspec branch from 85aa60e to d14b30c Compare April 29, 2020 21:06
- components need to implement StartStoppable
- it adds a channel "StartStop" of type StartStop.START/STOP/UNDEFINED
- the component needs to have a configuration property "startStop" of type StartStopConfig
…Ess start-up routines

- Major refactoring/improvements on Test-Framework. Makes it compatible with all kinds of OpenemsComponents
- Improved fluent methods in Test-Framework and MyConfig
- Improvements to DummyConfigurationAdmin, DummyBattery
- New DummyManagedSymmetricBatteryInverter, DummyModbusBridge, DummyCycle
# Conflicts:
#	io.openems.edge.ess.sinexcel/src/io/openems/edge/ess/sinexcel/EssSinexcel.java
@sfeilmeier sfeilmeier requested a review from wgerbl May 6, 2020 21:51
@sfeilmeier
Copy link
Contributor Author

Review by @sfeilmeier, @wgerbl

This pull-request contains following major developments and design ideas:

  • Generic implementation of State-Machines
  • Implement Start-Stop feature
  • Split components in Interface (Name) and implementation (NameImpl)
  • Getters and Setters for Nature-Channels
  • JUnit Test-Framework for all kinds of OpenemsComponents
  • Refactoring of "Battery" interface
  • New interface "BatteryInverter" (ManagedSymmetricBatteryInverter, SymmetricBatteryInverter)
  • Implement Generic-Ess

Generic implementation of State-Machines

  • based on State enum
  • uses 'Context' for each State-Handler
  • 'StateMachine' object can be used directly

Implement Start-Stop feature

  • new interface 'StartStoppable' marks a device that can be started or stopped

Split components in Interface (Name) and implementation (NameImpl)

  • the interface holds the ChannelId enum

Getters and Setters for Nature-Channels

JUnit Test-Framework for all kinds of OpenemsComponents

Refactoring of "Battery" interface

  • drop 'READY_FOR_WORKING' channel
  • extends "StartStoppable"
  • To indicate, that the Battery is ready for charging/discharging, the following Channels need to be set:
    • StartStoppable.ChannelId.START_STOP must be set to 'START'
    • No 'Fault'-StateChannels are set (i.e. 'OpenemsComponent.ChannelId.STATE' is < 3)
    • CHARGE_MAX_VOLTAGE, CHARGE_MAX_CURRENT, DISCHARGE_MIN_VOLTAGE and DISCHARGE_MAX_CURRENT are != null

New interface "BatteryInverter" (ManagedSymmetricBatteryInverter, SymmetricBatteryInverter)

  • main entry point is the 'apply()' method

Implement Generic-Ess

- fix setNextWriteChannel calls
- adjust BatteryInverter Nature
- long names for types of generics
- add TODOs
@sfeilmeier sfeilmeier force-pushed the feature/kaco-sunspec branch from f9b508e to 0069cc3 Compare May 22, 2020 08:52
sfeilmeier and others added 2 commits May 22, 2020 14:13
… properly now with this implementation!

- Fix duplicated Channel-Id
- Fix wrong Scalefactor
- Set ESS.Generic default startstop to START
- Set 'startStopTarget' only on change, to avoid interrupting the internal state-machine
- Add Fault-Channel INVALID_CURRENT_STATE to represent when the 'CurrentState' is not ready. This triggers entering ErrorHandling state
- Trigger Watchdog always; otherwise KACO would not start (-> Cycle can be removed from Context)
- Set Active and ReactivePower channels
- Add StPcu (Vendor Operating State) values from manual
- Abort 'GoRunning' if there is a Fault

SunSpec improvements:
- Read all Channels - no matter if their value is 'defined' or not
- Filter undefined values using an ElementToChannelConverter
Finished test with Soltaro Cluster C + KACO blueplanet gridsave 50 + Generic Ess
Copy link
Contributor

@wgerbl wgerbl left a comment

Choose a reason for hiding this comment

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

Fine work it will open a wide field for discussions ;)

I did not check the implementation changes on the test frame work. This would be a separate part to review.

@sfeilmeier sfeilmeier merged commit bf07607 into develop Jun 4, 2020
@sfeilmeier sfeilmeier deleted the feature/kaco-sunspec branch June 4, 2020 20:45
sfeilmeier added a commit that referenced this pull request Jun 12, 2020
Update methods to access Channels as discussed in #1046 and started in #1099. This avoids calls to `setNextValue()` and `setNextWriteValue()` and should make the framework much more understandable and lower the learning curve.

Each Read-Channel of a Nature Interface gets following methods: (example for a Channel `NAME` of type Integer)
* `IntegerReadChannel getNameChannel()`
* `Integer getName()`
* `_setName(Integer value)`
* `_setName(int value)`

Write-Channels also get a method
* `setName(Integer value)` that internally calls the `setNextWriteValue()` method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants