Repository navigation
In message received from PvPool.power_status target_power is None until someone set value to the microgrid #1118
Copy link
Copy link
Open
Open
Enhancement
Copy link
Labels
part:docsAffects the documentationAffects the documentationpart:microgridAffects the interactions with the microgridAffects the interactions with the microgridpriority:❓We need to figure out how soon this should be addressedWe need to figure out how soon this should be addressedtype:enhancementNew feature or enhancement visitble to usersNew feature or enhancement visitble to users
Milestone
Description
What happened?
I would like to receive pv power on every update of pv power or its bounds.
I receive power status from pv_pool.power_status.new_receiver() but until I send pv_pool.propose_power, the target_power is None.
Also on every update pv status is send 2 times. I expect 1 message per update.
async def main():
await initialize_microgrid()
pv_pool = microgrid.new_pv_pool(priority=1)
pv_power = pv_pool.power.new_receiver()
pv_status = pv_pool.power_status.new_receiver()
counter = 0
async for selected in select(pv_power, pv_status):
if selected_from(selected, pv_power):
print(f"PV power: {selected.message.value}")
elif selected_from(selected, pv_status):
print(f"PV status: {selected.message}")
counter += 1
if counter % 10 == 0:
await pv_pool.propose_power(Power.from_watts(-counter))Logs:
PV status: _Report(target_power=None, _inclusion_bounds=Bounds(lower=Power(value=-30000.0, exponent=0), upper=Power(value=0.0, exponent=0)), _exclusion_bounds=Bounds(lower=Power(value=0.0, exponent=0), upper=Power(value=0.0, exponent=0)))
PV status: _Report(target_power=None, _inclusion_bounds=Bounds(lower=Power(value=-60000.0, exponent=0), upper=Power(value=0.0, exponent=0)), _exclusion_bounds=Bounds(lower=Power(value=0.0, exponent=0), upper=Power(value=0.0, exponent=0)))
PV power: -39 kW
PV power: -39 kW
PV power: -39 kW
PV power: -39 kW
PV power: -39 kW
PV power: -39 kW
PV power: -39 kW
PV power: -39 kW
PV status: _Report(target_power=Power(value=-10.0, exponent=0), _inclusion_bounds=Bounds(lower=Power(value=-60000.0, exponent=0), upper=Power(value=0.0, exponent=0)), _exclusion_bounds=Bounds(lower=Power(value=0.0, exponent=0), upper=Power(value=0.0, exponent=0)))
PV status: _Report(target_power=Power(value=-10.0, exponent=0), _inclusion_bounds=Bounds(lower=Power(value=-60000.0, exponent=0), upper=Power(value=0.0, exponent=0)), _exclusion_bounds=Bounds(lower=Power(value=0.0, exponent=0), upper=Power(value=0.0, exponent=0)))
What did you expect instead?
target_powerhas correct pv power since startup. (not None)- I expect 1 message per update.
Affected version(s)
v1.0.0-rc1200, v1.0.0-rc1300,
Affected part(s)
Microgrid (API, component graph, etc.) (part:microgrid)
Extra information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
part:docsAffects the documentationAffects the documentationpart:microgridAffects the interactions with the microgridAffects the interactions with the microgridpriority:❓We need to figure out how soon this should be addressedWe need to figure out how soon this should be addressedtype:enhancementNew feature or enhancement visitble to usersNew feature or enhancement visitble to users
Type
Fields
Priority
None yet
Effort
None yet
Projects
- StatusShow more project fieldsTo do
Activity
shsms commentedon Nov 26, 2024
target_poweris the power we want to set, not the measured power. So, I think the behaviour is correct. But maybe we can make it easier to understand.shsms commentedon Nov 26, 2024
This is also a known issue, just hasn't been prioritized: #818 (comment)
llucax commentedon Nov 27, 2024
Should we convert this issue to a docs improvement issue?
llucax commentedon Nov 27, 2024
The
power_statusdocs are definitely confusing as they talk about batteries, and I guess we could highlight there that is only for receiving the status of the power manager itself and not the readings from the components.The
PVPoolReport.target_powerdocs are not super verbose but the attribute itself seems clear that is a target and not the actual read value, no? Maybe we can be more verbose in the docs anyway.ela-kotulska-frequenz commentedon Nov 28, 2024
Yes, please! :) The name of the method is also confusing it could be
power_manager_statusor something else.