frequenz-floss / frequenz-sdk-python

Frequenz Python Software Development Kit (SDK)
https://frequenz-floss.github.io/frequenz-sdk-python/
MIT License
13 stars 17 forks source link

Add (re)active and apperent power to FormulaEngine #882

Open matthias-wende-frequenz opened 7 months ago

matthias-wende-frequenz commented 7 months ago

What's needed?

At the moment when calling a high level power function we always return the active component of the power. We also want to be able to use the logical meter high level interface to read the other power components power.

Proposed solution

My suggested solution would be to add an optional parameter to the interface.

grid = microgrid.grid(power_component = ComponentMetricId.REACTIVE_POWER)

and add this as a parameter to the formula generator.

Use cases

No response

Alternatives and workarounds

No response

Additional context

No response

shsms commented 7 months ago

Do we only need reactive power or do we need apparent power also? And do we need it just for the grid?

I think it has to be a separate function microgrid.grid().reactive_power, because that has a different unit(VAR) and needs a different Quantity type. Same for apparent_power, which is (VA).

shsms commented 7 months ago

Also does it have to be per-phase or single 3-phase values? did you have a usecase in mind for adding these, because that might tell us what the data should look like.

merlin-esser-frequenz commented 6 months ago

@shsms This ticket has been created based on a usecase which doesnt really need the SDK and can be solved using the Reporting API or the Microgrid API. However, for the future it could be useful to also read out all the meter and inverter values via the FormulaEngine. But currently there is no priority for it.

matthias-wende-frequenz commented 6 months ago

First we need to support these metrics here -> https://github.com/frequenz-floss/frequenz-client-microgrid-python/blob/v0.x.x/src/frequenz/client/microgrid/_component.py