Skip to content

Commit

Permalink
Fixed solver params input implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
davidusb-geek committed May 30, 2022
1 parent 879a0a2 commit af4db43
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.11] - 2022-05-23
## [0.3.13] - 2022-05-20
### Fix
- Fix wrong default value implementation for solver params.

## [0.3.12] - 2022-05-20
### Improvement
- Added support to provide solver name and path as parameters in the configuration file.

Expand Down Expand Up @@ -225,4 +229,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[0.2.14]: https://github.com/davidusb-geek/emhass/releases/tag/v0.2.14
[0.3.0]: https://github.com/davidusb-geek/emhass/releases/tag/v0.3.0
[0.3.6]: https://github.com/davidusb-geek/emhass/releases/tag/v0.3.6
[0.3.8]: https://github.com/davidusb-geek/emhass/releases/tag/v0.3.8
[0.3.8]: https://github.com/davidusb-geek/emhass/releases/tag/v0.3.8
[0.3.13]: https://github.com/davidusb-geek/emhass/releases/tag/v0.3.13
2 changes: 1 addition & 1 deletion config_emhass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ optim_conf:
- prod_sell_price: 0.065 # power production selling price in €/kWh (only needed if prod_price_forecast_method='constant')
- set_total_pv_sell: False # consider that all PV power is injected to the grid (self-consumption with total sell)
- lp_solver: 'PULP_CBC_CMD' # set the name of the linear programming solver that will be used
- lp_solver_path: '/usr/bin/cbc' # set the path to the LP solver
- lp_solver_path: 'empty' # set the path to the LP solver

plant_conf:
- P_grid_max: 9000 # The maximum power that can be supplied by the utility grid in Watts
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'David HERNANDEZ'

# The full version, including alpha/beta/rc tags
release = '0.3.12'
release = '0.3.13'

# -- General configuration ---------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The following parameters and definitions are only needed if load_cost_forecast_m
- prod_price_forecast_method: Define the method that will be used for PV power production price forecast. This is the price that is payed by the utility for energy injected to the grid. The options are 'constant' for a constant fixed value or 'csv' to load custom price forecast from a CSV file. The default CSV file path that will be used is '/data/data_prod_price_forecast.csv'.
- prod_sell_price: The paid price for energy injected to the grid from excedent PV production in €/kWh. Defaults to 0.065. This parameter is only needed if prod_price_forecast_method='constant'.
- lp_solver: Set the name of the linear programming solver that will be used. Defaults to 'PULP_CBC_CMD'.
- lp_solver_path: Set the path to the LP solver. Defaults to '/usr/bin/cbc'.
- lp_solver_path: Set the path to the LP solver. Defaults to 'empty.

## System configuration parameters

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

setup(
name='emhass', # Required
version='0.3.12', # Required
version='0.3.13', # Required
description='An Energy Management System for Home Assistant', # Optional
long_description=long_description, # Optional
long_description_content_type='text/markdown', # Optional (see note above)
Expand Down
4 changes: 2 additions & 2 deletions src/emhass/optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def __init__(self, retrieve_hass_conf: dict, optim_conf: dict, plant_conf: dict,
if 'lp_solver_path' in optim_conf.keys():
self.lp_solver_path = optim_conf['lp_solver_path']
else:
self.lp_solver_path = r'/usr/bin/cbc'
if self.lp_solver != 'COIN_CMD' and 'lp_solver_path' in optim_conf.keys():
self.lp_solver_path = 'empty'
if self.lp_solver != 'COIN_CMD' and self.lp_solver_path != 'empty':
self.logger.error("Use COIN_CMD solver name if you want to set a path for the LP solver")

def perform_optimization(self, data_opt: pd.DataFrame, P_PV: np.array, P_load: np.array,
Expand Down

0 comments on commit af4db43

Please sign in to comment.