emhass 0.11.0__tar.gz → 0.11.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. {emhass-0.11.0 → emhass-0.11.1}/CHANGELOG.md +6 -0
  2. {emhass-0.11.0 → emhass-0.11.1}/PKG-INFO +3 -3
  3. {emhass-0.11.0 → emhass-0.11.1}/README.md +2 -2
  4. {emhass-0.11.0 → emhass-0.11.1}/setup.py +1 -1
  5. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/data/associations.csv +2 -0
  6. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/static/configuration_script.js +2 -1
  7. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/utils.py +12 -5
  8. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/web_server.py +0 -1
  9. {emhass-0.11.0 → emhass-0.11.1}/src/emhass.egg-info/PKG-INFO +3 -3
  10. {emhass-0.11.0 → emhass-0.11.1}/CODE_OF_CONDUCT.md +0 -0
  11. {emhass-0.11.0 → emhass-0.11.1}/CONTRIBUTING.md +0 -0
  12. {emhass-0.11.0 → emhass-0.11.1}/LICENSE +0 -0
  13. {emhass-0.11.0 → emhass-0.11.1}/MANIFEST.in +0 -0
  14. {emhass-0.11.0 → emhass-0.11.1}/data/data_load_cost_forecast.csv +0 -0
  15. {emhass-0.11.0 → emhass-0.11.1}/data/data_load_forecast.csv +0 -0
  16. {emhass-0.11.0 → emhass-0.11.1}/data/data_prod_price_forecast.csv +0 -0
  17. {emhass-0.11.0 → emhass-0.11.1}/data/data_train_load_clustering.pkl +0 -0
  18. {emhass-0.11.0 → emhass-0.11.1}/data/data_train_load_forecast.pkl +0 -0
  19. {emhass-0.11.0 → emhass-0.11.1}/data/data_weather_forecast.csv +0 -0
  20. {emhass-0.11.0 → emhass-0.11.1}/data/heating_prediction.csv +0 -0
  21. {emhass-0.11.0 → emhass-0.11.1}/data/opt_res_latest.csv +0 -0
  22. {emhass-0.11.0 → emhass-0.11.1}/data/opt_res_perfect_optim_cost.csv +0 -0
  23. {emhass-0.11.0 → emhass-0.11.1}/data/opt_res_perfect_optim_profit.csv +0 -0
  24. {emhass-0.11.0 → emhass-0.11.1}/data/opt_res_perfect_optim_self-consumption.csv +0 -0
  25. {emhass-0.11.0 → emhass-0.11.1}/data/test_df_final.pkl +0 -0
  26. {emhass-0.11.0 → emhass-0.11.1}/data/test_response_get_data_get_method.pbz2 +0 -0
  27. {emhass-0.11.0 → emhass-0.11.1}/data/test_response_scrapper_get_method.pbz2 +0 -0
  28. {emhass-0.11.0 → emhass-0.11.1}/data/test_response_solarforecast_get_method.pbz2 +0 -0
  29. {emhass-0.11.0 → emhass-0.11.1}/data/test_response_solcast_get_method.pbz2 +0 -0
  30. {emhass-0.11.0 → emhass-0.11.1}/pyproject.toml +0 -0
  31. {emhass-0.11.0 → emhass-0.11.1}/setup.cfg +0 -0
  32. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/__init__.py +0 -0
  33. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/command_line.py +0 -0
  34. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/data/cec_inverters.pbz2 +0 -0
  35. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/data/cec_modules.pbz2 +0 -0
  36. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/data/config_defaults.json +0 -0
  37. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/forecast.py +0 -0
  38. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/machine_learning_forecaster.py +0 -0
  39. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/machine_learning_regressor.py +0 -0
  40. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/optimization.py +0 -0
  41. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/retrieve_hass.py +0 -0
  42. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/static/advanced.html +0 -0
  43. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/static/basic.html +0 -0
  44. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/static/configuration_list.html +0 -0
  45. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/static/data/param_definitions.json +0 -0
  46. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/static/img/emhass_icon.png +0 -0
  47. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/static/img/emhass_logo_short.svg +0 -0
  48. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/static/img/feather-sprite.svg +0 -0
  49. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/static/script.js +0 -0
  50. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/static/style.css +0 -0
  51. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/templates/configuration.html +0 -0
  52. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/templates/index.html +0 -0
  53. {emhass-0.11.0 → emhass-0.11.1}/src/emhass/templates/template.html +0 -0
  54. {emhass-0.11.0 → emhass-0.11.1}/src/emhass.egg-info/SOURCES.txt +0 -0
  55. {emhass-0.11.0 → emhass-0.11.1}/src/emhass.egg-info/dependency_links.txt +0 -0
  56. {emhass-0.11.0 → emhass-0.11.1}/src/emhass.egg-info/entry_points.txt +0 -0
  57. {emhass-0.11.0 → emhass-0.11.1}/src/emhass.egg-info/requires.txt +0 -0
  58. {emhass-0.11.0 → emhass-0.11.1}/src/emhass.egg-info/top_level.txt +0 -0
  59. {emhass-0.11.0 → emhass-0.11.1}/tests/test_command_line_utils.py +0 -0
  60. {emhass-0.11.0 → emhass-0.11.1}/tests/test_forecast.py +0 -0
  61. {emhass-0.11.0 → emhass-0.11.1}/tests/test_machine_learning_forecaster.py +0 -0
  62. {emhass-0.11.0 → emhass-0.11.1}/tests/test_machine_learning_regressor.py +0 -0
  63. {emhass-0.11.0 → emhass-0.11.1}/tests/test_optimization.py +0 -0
  64. {emhass-0.11.0 → emhass-0.11.1}/tests/test_retrieve_hass.py +0 -0
  65. {emhass-0.11.0 → emhass-0.11.1}/tests/test_utils.py +0 -0
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.11.1 - 2024-10-29
4
+ ### Fix
5
+ - Fix parameter saving and duplicate battery bugs
6
+ - utils.py add more specific logging information for config
7
+ - Fix issue where thermal runtime parameters were not being propagated into optim_conf
8
+
3
9
  ## 0.11.0 - 2024-10-25
4
10
 
5
11
  This version marks huge improvement works by @GeoDerp aiming to simplfy the intial and normal setup of EMHASS. The workflow for setting the EMHASS configuration regardless of the installation method has now been centralized on the single `config.json` file. The webserver has now a configuration tab that can be used to to modify and save the `config.json` file.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: emhass
3
- Version: 0.11.0
3
+ Version: 0.11.1
4
4
  Summary: An Energy Management System for Home Assistant
5
5
  Home-page: https://github.com/davidusb-geek/emhass
6
6
  Author: David HERNANDEZ
@@ -164,7 +164,7 @@ _Note: Both EMHASS via Docker and EMHASS-Add-on contain the same Docker image. T
164
164
  You can also install EMHASS using Docker as a container. This can be in the same machine as Home Assistant (if your running Home Assistant as a Docker container) or in a different distant machine. To install first pull the latest image:
165
165
  ```bash
166
166
  # pull Docker image
167
- docker docker pull ghcr.io/davidusb-geek/emhass:latest
167
+ docker pull ghcr.io/davidusb-geek/emhass:latest
168
168
  # run Docker image, mounting config.json and secrets_emhass.yaml from host
169
169
  docker run --rm -it --restart always -p 5000:5000 --name emhass-container -v ./config.json:/share/config.json -v ./secrets_emhass.yaml:/app/secrets_emhass.yaml ghcr.io/davidusb-geek/emhass:latest
170
170
  ```
@@ -173,7 +173,7 @@ docker run --rm -it --restart always -p 5000:5000 --name emhass-container -v ./
173
173
  You can also build your image locally. For this clone this repository, and build the image from the Dockerfile:
174
174
  ```bash
175
175
  # git clone EMHASS repo
176
- git clone docker pull ghcr.io/geoderp/emhass:v0.21.3
176
+ git clone https://github.com/davidusb-geek/emhass.git
177
177
  # move to EMHASS directory
178
178
  cd emhass
179
179
  # build Docker image
@@ -129,7 +129,7 @@ _Note: Both EMHASS via Docker and EMHASS-Add-on contain the same Docker image. T
129
129
  You can also install EMHASS using Docker as a container. This can be in the same machine as Home Assistant (if your running Home Assistant as a Docker container) or in a different distant machine. To install first pull the latest image:
130
130
  ```bash
131
131
  # pull Docker image
132
- docker docker pull ghcr.io/davidusb-geek/emhass:latest
132
+ docker pull ghcr.io/davidusb-geek/emhass:latest
133
133
  # run Docker image, mounting config.json and secrets_emhass.yaml from host
134
134
  docker run --rm -it --restart always -p 5000:5000 --name emhass-container -v ./config.json:/share/config.json -v ./secrets_emhass.yaml:/app/secrets_emhass.yaml ghcr.io/davidusb-geek/emhass:latest
135
135
  ```
@@ -138,7 +138,7 @@ docker run --rm -it --restart always -p 5000:5000 --name emhass-container -v ./
138
138
  You can also build your image locally. For this clone this repository, and build the image from the Dockerfile:
139
139
  ```bash
140
140
  # git clone EMHASS repo
141
- git clone docker pull ghcr.io/geoderp/emhass:v0.21.3
141
+ git clone https://github.com/davidusb-geek/emhass.git
142
142
  # move to EMHASS directory
143
143
  cd emhass
144
144
  # build Docker image
@@ -19,7 +19,7 @@ long_description = (here / 'README.md').read_text(encoding='utf-8')
19
19
 
20
20
  setup(
21
21
  name='emhass', # Required
22
- version='0.11.0', # Required
22
+ version='0.11.1', # Required
23
23
  description='An Energy Management System for Home Assistant', # Optional
24
24
  long_description=long_description, # Optional
25
25
  long_description_content_type='text/markdown', # Optional (see note above)
@@ -1,4 +1,5 @@
1
1
  config_categorie,legacy_parameter_name,parameter,list_name
2
+ retrieve_hass_conf,logging_level,logging_level
2
3
  retrieve_hass_conf,freq,optimization_time_step
3
4
  retrieve_hass_conf,days_to_retrieve,historic_days_to_retrieve
4
5
  retrieve_hass_conf,var_PV,sensor_power_photovoltaics
@@ -13,6 +14,7 @@ params_secrets,time_zone,time_zone
13
14
  params_secrets,lat,Latitude
14
15
  params_secrets,lon,Longitude
15
16
  params_secrets,alt,Altitude
17
+ optim_conf,costfun,costfun
16
18
  optim_conf,set_use_battery,set_use_battery
17
19
  optim_conf,num_def_loads,number_of_deferrable_loads
18
20
  optim_conf,P_deferrable_nom,nominal_power_of_deferrable_loads,list_nominal_power_of_deferrable_loads
@@ -249,7 +249,7 @@ function buildParamContainers(
249
249
  `;
250
250
  }
251
251
 
252
- //After looping though, build and appending the parameters in the corresponding section:
252
+ //after looping though, build and appending the parameters in the corresponding section:
253
253
  //create add button (array plus) event listeners
254
254
  let plus = SectionContainer.querySelectorAll(".input-plus");
255
255
  plus.forEach(function (answer) {
@@ -549,6 +549,7 @@ function headerElement(element, param_definitions, config) {
549
549
  //if set_use_battery, add or remove battery section (inc. params)
550
550
  case "set_use_battery":
551
551
  if (element.checked) {
552
+ param_container.innerHTML = "";
552
553
  buildParamContainers("Battery", param_definitions["Battery"], config, [
553
554
  "set_use_battery",
554
555
  ]);
@@ -314,9 +314,16 @@ def treat_runtimeparams(runtimeparams: str, params: str, retrieve_hass_conf: dic
314
314
  else:
315
315
  def_end_timestep = runtimeparams.get(
316
316
  'def_end_timestep', optim_conf['end_timesteps_of_each_deferrable_load'])
317
- params["passed_data"]['end_timesteps_of_each_deferrable_load'] = def_end_timestep
318
- forecast_dates = copy.deepcopy(forecast_dates)[
319
- 0:prediction_horizon]
317
+ params["passed_data"]["end_timesteps_of_each_deferrable_load"] = def_end_timestep
318
+ forecast_dates = copy.deepcopy(forecast_dates)[0:prediction_horizon]
319
+ # Load the default config
320
+ if "def_load_config" in optim_conf:
321
+ for k in range(len(optim_conf["def_load_config"])):
322
+ if "thermal_config" in optim_conf["def_load_config"][k]:
323
+ if ("heater_desired_temperatures" in runtimeparams and len(runtimeparams["heater_desired_temperatures"]) > k):
324
+ optim_conf["def_load_config"][k]["thermal_config"]["desired_temperatures"] = runtimeparams["heater_desired_temperatures"][k]
325
+ if ("heater_start_temperatures" in runtimeparams and len(runtimeparams["heater_start_temperatures"]) > k):
326
+ optim_conf["def_load_config"][k]["thermal_config"]["start_temperature"] = runtimeparams["heater_start_temperatures"][k]
320
327
  else:
321
328
  params["passed_data"]["prediction_horizon"] = None
322
329
  params["passed_data"]["soc_init"] = None
@@ -843,7 +850,7 @@ def build_config(emhass_conf: dict, logger: logging.Logger, defaults_path: str,
843
850
  logger.info("Obtaining parameters from config.json:")
844
851
  config.update(json.load(data))
845
852
  else:
846
- logger.info("config.json does not exist, or has not been passed")
853
+ logger.info("config.json does not exist, or has not been passed. config parameters may default to config_defaults.json")
847
854
  logger.info("you may like to generate the config.json file on the configuration page")
848
855
 
849
856
  # Check to see if legacy config_emhass.yaml was provided (default /app/config_emhass.yaml)
@@ -853,7 +860,7 @@ def build_config(emhass_conf: dict, logger: logging.Logger, defaults_path: str,
853
860
  legacy_config = yaml.load(data, Loader=yaml.FullLoader)
854
861
  legacy_config_parameters = build_legacy_config_params(emhass_conf,legacy_config,logger)
855
862
  if type(legacy_config_parameters) is not bool:
856
- logger.info("Obtaining parameters from config_emhass.yaml:")
863
+ logger.info("Obtaining parameters from config_emhass.yaml: (will overwrite config parameters)")
857
864
  config.update(legacy_config_parameters)
858
865
 
859
866
  return config
@@ -271,7 +271,6 @@ def parameter_set():
271
271
  else:
272
272
  return make_response(["Unable to save config file"],500)
273
273
  request_data
274
- app.logger.info(params)
275
274
 
276
275
  # Save params with updated config
277
276
  if os.path.exists(emhass_conf['data_path']):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: emhass
3
- Version: 0.11.0
3
+ Version: 0.11.1
4
4
  Summary: An Energy Management System for Home Assistant
5
5
  Home-page: https://github.com/davidusb-geek/emhass
6
6
  Author: David HERNANDEZ
@@ -164,7 +164,7 @@ _Note: Both EMHASS via Docker and EMHASS-Add-on contain the same Docker image. T
164
164
  You can also install EMHASS using Docker as a container. This can be in the same machine as Home Assistant (if your running Home Assistant as a Docker container) or in a different distant machine. To install first pull the latest image:
165
165
  ```bash
166
166
  # pull Docker image
167
- docker docker pull ghcr.io/davidusb-geek/emhass:latest
167
+ docker pull ghcr.io/davidusb-geek/emhass:latest
168
168
  # run Docker image, mounting config.json and secrets_emhass.yaml from host
169
169
  docker run --rm -it --restart always -p 5000:5000 --name emhass-container -v ./config.json:/share/config.json -v ./secrets_emhass.yaml:/app/secrets_emhass.yaml ghcr.io/davidusb-geek/emhass:latest
170
170
  ```
@@ -173,7 +173,7 @@ docker run --rm -it --restart always -p 5000:5000 --name emhass-container -v ./
173
173
  You can also build your image locally. For this clone this repository, and build the image from the Dockerfile:
174
174
  ```bash
175
175
  # git clone EMHASS repo
176
- git clone docker pull ghcr.io/geoderp/emhass:v0.21.3
176
+ git clone https://github.com/davidusb-geek/emhass.git
177
177
  # move to EMHASS directory
178
178
  cd emhass
179
179
  # build Docker image
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes