Advertisement
Guest User

Untitled

a guest
Nov 18th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. load_one = True
  2. load_two = True
  3. load_three = True
  4. power_reference = 0.0
  5. pv_mode = PVMode.ON
  6. max_charging = 5.0
  7. predicted_consumption = 2
  8.  
  9. if msg.grid_status:
  10. if msg.bessSOC < 1 and msg.buying_price == msg.selling_price:
  11. power_reference = -max_charging
  12. msg.mainGridPower = msg.current_load + max_charging - msg.solar_production
  13. elif (msg.bessSOC * 20) > (predicted_consumption * 1.5) and msg.buying_price == 8.0:
  14. power_reference = max_charging
  15. msg.mainGridPower = msg.current_load - max_charging - msg.solar_production
  16.  
  17.  
  18. if msg.solar_production > msg.current_load and msg.bessSOC != 1:
  19. power_reference = msg.current_load - msg.solar_production
  20. elif msg.solar_production > msg.current_load and msg.buying_price == 3.0:
  21. msg.mainGridPower = msg.current_load - msg.solar_production
  22.  
  23. else:
  24. power_reference = max_charging
  25. if msg.current_load < msg.solar_production and msg.bessSOC == 1:
  26. pv_mode = PVMode.OFF
  27.  
  28.  
  29. if msg.current_load > (max_charging + msg.solar_production):
  30. load_three = False
  31. if msg.current_load > (max_charging + msg.solar_production):
  32. load_two = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement