Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- load_one = True
- load_two = True
- load_three = True
- power_reference = 0.0
- pv_mode = PVMode.ON
- max_charging = 5.0
- predicted_consumption = 2
- if msg.grid_status:
- if msg.bessSOC < 1 and msg.buying_price == msg.selling_price:
- power_reference = -max_charging
- msg.mainGridPower = msg.current_load + max_charging - msg.solar_production
- elif (msg.bessSOC * 20) > (predicted_consumption * 1.5) and msg.buying_price == 8.0:
- power_reference = max_charging
- msg.mainGridPower = msg.current_load - max_charging - msg.solar_production
- if msg.solar_production > msg.current_load and msg.bessSOC != 1:
- power_reference = msg.current_load - msg.solar_production
- elif msg.solar_production > msg.current_load and msg.buying_price == 3.0:
- msg.mainGridPower = msg.current_load - msg.solar_production
- else:
- power_reference = max_charging
- if msg.current_load < msg.solar_production and msg.bessSOC == 1:
- pv_mode = PVMode.OFF
- if msg.current_load > (max_charging + msg.solar_production):
- load_three = False
- if msg.current_load > (max_charging + msg.solar_production):
- load_two = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement