diff --git a/app/models/entsoe.rb b/app/models/entsoe.rb index 7d9f3b5..fc681a8 100644 --- a/app/models/entsoe.rb +++ b/app/models/entsoe.rb @@ -42,10 +42,10 @@ class Entsoe sorted_prices = prices_at(date).to_a.sort_by(&:last) # sort according to price 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) 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 lowest_hour = sorted_prices.first[0]