File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55sell_price_threshold_1 = 20 # sell in morning
66sell_price_threshold_2 = 1000 # Sell during peak
77buy_price_morning = 5 # Morning buy price
8+ buy_top_up_price = 20
89# This is when we expect the solar production to meet our house load
910minutes_after_sunrise_solar_matches_load = 30
1011solar_production_time = sunrise + timedelta (minutes = minutes_after_sunrise_solar_matches_load )
7980 action = 'export'
8081 reason = f'nsw: pre 5am use it or lose it down to { desired_soc } %'
8182
82- if 4 < hour and interval_time < solar_production_time and battery_soc > 10 and sell_price > 15 :
83+ if (hour > 21 or hour < 5 ) and (battery_soc < desired_soc ):
84+ if (buy_price < buy_top_up_price ):
85+ best_upcoming = min (buy_forecast )
86+ if buy_price < (best_upcoming + 2 ):
87+ action = 'import'
88+ reason = f'nsw: low soc and price under top up and within 2 cents of best upcoming { best_upcoming } '
89+ else :
90+ reason += f' not within 2 cents of best { best_upcoming } '
91+ else :
92+ reason += f' waiting to top up { buy_price } < { buy_top_up_price } '
93+
94+ if 4 < hour < 8 and interval_time < solar_production_time and battery_soc > 10 and sell_price > 15 :
8395 action = 'export'
84- reason = f'nsw: before solar production time use it or lose it { solar_production_time } '
96+ reason + = f'nsw: before solar production time use it or lose it { solar_production_time } '
8597
8698if rrp > 800 and battery_soc > min_sell_soc :
8799 action = 'export'
88- reason += f'take the money down to { min_sell_soc } %'
100+ reason += f'take the money down to { min_sell_soc } %'
You can’t perform that action at this time.
0 commit comments