Use sun power

This commit is contained in:
Aart van Halteren
2022-01-10 21:27:09 +01:00
parent 1372f01000
commit 86c09b6bf9

View File

@@ -42,10 +42,10 @@ class Entsoe
sorted_prices = prices_at(date).to_a.sort_by(&:last) # sort according to price sorted_prices = prices_at(date).to_a.sort_by(&:last) # sort according to price
highest_hour = sorted_prices.last[0] highest_hour = sorted_prices.last[0]
# From Apr-Oct: do not charge; every hour that has cost > charge_rate is a high_hour # From Apr-Oct: do not charge; every hour that has cost > 0 is a high_hour
if [4,5,6,7,8,9,10].include?(date.month) if [4,5,6,7,8,9,10].include?(date.month)
lowest_hour = "" # effectively no charging from grid lowest_hour = "" # effectively no charging from grid
high_hours = sorted_prices.select{|p| p[1] > storage_cost} high_hours = sorted_prices.select{|p| p[1] > 0}
else else
lowest_hour = sorted_prices.first[0] lowest_hour = sorted_prices.first[0]