Implements VirtualMeter on PvInverterCluster#3085
Implements VirtualMeter on PvInverterCluster#3085sfeilmeier merged 9 commits intoOpenEMS:developfrom
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (12.50%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #3085 +/- ##
=============================================
- Coverage 59.76% 59.75% -0.00%
Complexity 105 105
=============================================
Files 2951 2952 +1
Lines 127746 127747 +1
Branches 9552 9551 -1
=============================================
- Hits 76332 76327 -5
+ Misses 48515 48514 -1
- Partials 2899 2906 +7 🚀 New features to boost your workflow:
|
| boolean enabled() default true; | ||
|
|
||
| @AttributeDefinition(name = "Meter-Type", description = "Production meter (=default)") | ||
| MeterType meterType() default MeterType.PRODUCTION; |
There was a problem hiding this comment.
Could this ever be anything else than PRODUCTION? If we don't set it here, we might have to add it in UI isProducer(), though: https://github.com/OpenEMS/openems/blob/develop/ui/src/app/shared/components/edge/edgeconfig.ts#L582
There was a problem hiding this comment.
okay true ... I guess in most cases this will be PRODUCTION. I think there is PRODUCTION returned as default in ManagedSymmetricPvInverter interface anyway, so we could drop this completely. To be honest, I cannot remember anymore, why I added it.
| MeterType meterType() default MeterType.PRODUCTION; | ||
|
|
||
| @AttributeDefinition(name = "Add to Sum?", description = "Should the data of this cluster be added to the Sum?") | ||
| boolean addToSum() default true; |
There was a problem hiding this comment.
For Energy Storage Systems this is identified via MetaEss Interface. We should establish similar approaches for the same logic throughout OpenEMS, don't you think? Maybe addToSum() is in fact the most flexible approach - see #3238. I am open for discussion.
There was a problem hiding this comment.
I looks like the VirtualMeter interface was just created for this use case. I would suggest to implement it in SymmetricEss (and everywhere else needed) and test for it before the switch once bailing out if needed. I'm not really sure about the other PR. As the result value is hardcoded in the interface to true, there is nothing won for existing meters. Of course you could overwrite it and return false in an own meter, but then you could also just implement existing VirtualMeter interface and no change of SumImpl is needed. But maybe I did not get the idea.
EDIT: Maybe the name should be changed or a new interface added, as it seems to refer to the MeterVirtualAdd and MeterVirtualSubstract.
|
I did not see further discussion, so I just added the interface and adopted sum calculation. Was this the solution, which you had in mind? |
Added VirtualMeter interface to PvInverterCluster. This allows to configure, if values are added to the sum. Otherwise you end up with doubled values, as the sum will take the cluster as a normal pvInverter.
Made MeterType on the way configurable ... maybe useful for something.