emhass 0.12.0__tar.gz → 0.12.2__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 (64) hide show
  1. {emhass-0.12.0 → emhass-0.12.2}/CHANGELOG.md +13 -3
  2. {emhass-0.12.0 → emhass-0.12.2}/PKG-INFO +2 -5
  3. {emhass-0.12.0 → emhass-0.12.2}/README.md +1 -4
  4. {emhass-0.12.0 → emhass-0.12.2}/pyproject.toml +1 -1
  5. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/command_line.py +8 -7
  6. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/retrieve_hass.py +17 -3
  7. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/utils.py +1 -0
  8. {emhass-0.12.0 → emhass-0.12.2}/src/emhass.egg-info/PKG-INFO +2 -5
  9. {emhass-0.12.0 → emhass-0.12.2}/CODE_OF_CONDUCT.md +0 -0
  10. {emhass-0.12.0 → emhass-0.12.2}/CONTRIBUTING.md +0 -0
  11. {emhass-0.12.0 → emhass-0.12.2}/LICENSE +0 -0
  12. {emhass-0.12.0 → emhass-0.12.2}/MANIFEST.in +0 -0
  13. {emhass-0.12.0 → emhass-0.12.2}/data/data_load_cost_forecast.csv +0 -0
  14. {emhass-0.12.0 → emhass-0.12.2}/data/data_load_forecast.csv +0 -0
  15. {emhass-0.12.0 → emhass-0.12.2}/data/data_prod_price_forecast.csv +0 -0
  16. {emhass-0.12.0 → emhass-0.12.2}/data/data_train_load_clustering.pkl +0 -0
  17. {emhass-0.12.0 → emhass-0.12.2}/data/data_train_load_forecast.pkl +0 -0
  18. {emhass-0.12.0 → emhass-0.12.2}/data/data_weather_forecast.csv +0 -0
  19. {emhass-0.12.0 → emhass-0.12.2}/data/heating_prediction.csv +0 -0
  20. {emhass-0.12.0 → emhass-0.12.2}/data/opt_res_latest.csv +0 -0
  21. {emhass-0.12.0 → emhass-0.12.2}/data/opt_res_perfect_optim_cost.csv +0 -0
  22. {emhass-0.12.0 → emhass-0.12.2}/data/opt_res_perfect_optim_profit.csv +0 -0
  23. {emhass-0.12.0 → emhass-0.12.2}/data/opt_res_perfect_optim_self-consumption.csv +0 -0
  24. {emhass-0.12.0 → emhass-0.12.2}/data/test_df_final.pkl +0 -0
  25. {emhass-0.12.0 → emhass-0.12.2}/data/test_response_get_data_get_method.pbz2 +0 -0
  26. {emhass-0.12.0 → emhass-0.12.2}/data/test_response_scrapper_get_method.pbz2 +0 -0
  27. {emhass-0.12.0 → emhass-0.12.2}/data/test_response_solarforecast_get_method.pbz2 +0 -0
  28. {emhass-0.12.0 → emhass-0.12.2}/data/test_response_solcast_get_method.pbz2 +0 -0
  29. {emhass-0.12.0 → emhass-0.12.2}/setup.cfg +0 -0
  30. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/__init__.py +0 -0
  31. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/data/associations.csv +0 -0
  32. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/data/cec_inverters.pbz2 +0 -0
  33. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/data/cec_modules.pbz2 +0 -0
  34. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/data/config_defaults.json +0 -0
  35. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/forecast.py +0 -0
  36. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/machine_learning_forecaster.py +0 -0
  37. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/machine_learning_regressor.py +0 -0
  38. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/optimization.py +0 -0
  39. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/static/advanced.html +0 -0
  40. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/static/basic.html +0 -0
  41. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/static/configuration_list.html +0 -0
  42. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/static/configuration_script.js +0 -0
  43. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/static/data/param_definitions.json +0 -0
  44. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/static/img/emhass_icon.png +0 -0
  45. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/static/img/emhass_logo_short.svg +0 -0
  46. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/static/img/feather-sprite.svg +0 -0
  47. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/static/script.js +0 -0
  48. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/static/style.css +0 -0
  49. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/templates/configuration.html +0 -0
  50. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/templates/index.html +0 -0
  51. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/templates/template.html +0 -0
  52. {emhass-0.12.0 → emhass-0.12.2}/src/emhass/web_server.py +0 -0
  53. {emhass-0.12.0 → emhass-0.12.2}/src/emhass.egg-info/SOURCES.txt +0 -0
  54. {emhass-0.12.0 → emhass-0.12.2}/src/emhass.egg-info/dependency_links.txt +0 -0
  55. {emhass-0.12.0 → emhass-0.12.2}/src/emhass.egg-info/entry_points.txt +0 -0
  56. {emhass-0.12.0 → emhass-0.12.2}/src/emhass.egg-info/requires.txt +0 -0
  57. {emhass-0.12.0 → emhass-0.12.2}/src/emhass.egg-info/top_level.txt +0 -0
  58. {emhass-0.12.0 → emhass-0.12.2}/tests/test_command_line_utils.py +0 -0
  59. {emhass-0.12.0 → emhass-0.12.2}/tests/test_forecast.py +0 -0
  60. {emhass-0.12.0 → emhass-0.12.2}/tests/test_machine_learning_forecaster.py +0 -0
  61. {emhass-0.12.0 → emhass-0.12.2}/tests/test_machine_learning_regressor.py +0 -0
  62. {emhass-0.12.0 → emhass-0.12.2}/tests/test_optimization.py +0 -0
  63. {emhass-0.12.0 → emhass-0.12.2}/tests/test_retrieve_hass.py +0 -0
  64. {emhass-0.12.0 → emhass-0.12.2}/tests/test_utils.py +0 -0
@@ -1,11 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.12.2 - 2025-01-01
4
+ ### Patch fix
5
+ - Fixed Problem with calling weather-forecast-cache
6
+ ### Improvement
7
+ - Updated readthedocs.yml, got rid of duplicated requirements.txt
8
+
9
+ ## 0.12.1 - 2024-12-30
10
+ ### Patch fix
11
+ - Fixed error with retrieve config from HA
12
+
3
13
  ## 0.12.0 - 2024-12-29
4
14
  ### BREAKING CHANGE
5
- - The solar PV system is now optional. If you have a PV system then use the switch on the webui or set the `set_use_pv` parameter to `True`.
15
+ - The solar PV system is now optional. If you have a PV system then use the switch on the webui or set the `set_use_pv` parameter to `True`
6
16
  ### Improvement
7
- - A new load power forecast method based on statistic and typical household load power consumption. This and the optional PV, will make it easier for new users to on-board EMHASS because this new default behavior does not require any data retrieval from Home Assistant or any other external source.
8
- - Updated documentation.
17
+ - A new load power forecast method based on statistic and typical household load power consumption. This and the optional PV, will make it easier for new users to on-board EMHASS because this new default behavior does not require any data retrieval from Home Assistant or any other external source
18
+ - Updated documentation
9
19
 
10
20
  ## 0.11.4 - 2024-12-24
11
21
  ### Fix
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: emhass
3
- Version: 0.12.0
3
+ Version: 0.12.2
4
4
  Summary: An Energy Management System for Home Assistant
5
5
  Author-email: David HERNANDEZ <davidusb@gmail.com>
6
6
  License: MIT
@@ -135,10 +135,7 @@ You must follow these steps to make EMHASS work properly:
135
135
  - There are multiple methods of installing and Running EMHASS. See [Installation Method](#Installation-Methods) below to pick a method that best suits your use case.
136
136
 
137
137
  2) Define all the parameters in the configuration file *(`config.json`)* or configuration page *(`YOURIP:5000/configuration`)*.
138
- ```{note}
139
-
140
- New in EMHASS v0.12.0: the default configuration does not need to retrieve any data from Home Assistant! After installing and running the add-on, EMHASS should start and it will be ready to launch an optimization.
141
- ```
138
+ - Since EMHASS v0.12.0: the default configuration does not need to retrieve any data from Home Assistant! After installing and running the add-on, EMHASS should start and it will be ready to launch an optimization.
142
139
  - See the description for each parameter in the [configuration](https://emhass.readthedocs.io/en/latest/config.html) docs.
143
140
  - EMHASS has a default configuration with 2 deferrable loads, no solar PV, no batteries and a basic load power forecasting method.
144
141
  - If you want to consider solar PV and more advanced load power forecast methods, you will need to define the main data entering EMHASS. This will be the Home Assistant sensor/variable `sensor.power_load_no_var_loads`, for the load power of your household excluding the power of the deferrable loads that you want to optimize, and the sensor/variable `sensor.power_photovoltaics` for the name of your Home Assistant variable containing the PV produced power (if solar PV is activated).
@@ -91,10 +91,7 @@ You must follow these steps to make EMHASS work properly:
91
91
  - There are multiple methods of installing and Running EMHASS. See [Installation Method](#Installation-Methods) below to pick a method that best suits your use case.
92
92
 
93
93
  2) Define all the parameters in the configuration file *(`config.json`)* or configuration page *(`YOURIP:5000/configuration`)*.
94
- ```{note}
95
-
96
- New in EMHASS v0.12.0: the default configuration does not need to retrieve any data from Home Assistant! After installing and running the add-on, EMHASS should start and it will be ready to launch an optimization.
97
- ```
94
+ - Since EMHASS v0.12.0: the default configuration does not need to retrieve any data from Home Assistant! After installing and running the add-on, EMHASS should start and it will be ready to launch an optimization.
98
95
  - See the description for each parameter in the [configuration](https://emhass.readthedocs.io/en/latest/config.html) docs.
99
96
  - EMHASS has a default configuration with 2 deferrable loads, no solar PV, no batteries and a basic load power forecasting method.
100
97
  - If you want to consider solar PV and more advanced load power forecast methods, you will need to define the main data entering EMHASS. This will be the Home Assistant sensor/variable `sensor.power_load_no_var_loads`, for the load power of your household excluding the power of the deferrable loads that you want to optimize, and the sensor/variable `sensor.power_photovoltaics` for the name of your Home Assistant variable containing the PV produced power (if solar PV is activated).
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "emhass"
9
- version = "0.12.0"
9
+ version = "0.12.2"
10
10
  description = "An Energy Management System for Home Assistant"
11
11
  readme = "README.md"
12
12
  requires-python = ">=3.10, <3.12"
@@ -69,7 +69,7 @@ def set_input_data_dict(
69
69
  retrieve_hass_conf, optim_conf, plant_conf = utils.get_yaml_parse(params, logger)
70
70
  if type(retrieve_hass_conf) is bool:
71
71
  return False
72
-
72
+
73
73
  # Treat runtimeparams
74
74
  params, retrieve_hass_conf, optim_conf, plant_conf = utils.treat_runtimeparams(
75
75
  runtimeparams,
@@ -81,7 +81,7 @@ def set_input_data_dict(
81
81
  logger,
82
82
  emhass_conf,
83
83
  )
84
-
84
+
85
85
  # Define the data retrieve object
86
86
  rh = RetrieveHass(
87
87
  retrieve_hass_conf["hass_url"],
@@ -93,20 +93,22 @@ def set_input_data_dict(
93
93
  logger,
94
94
  get_data_from_file=get_data_from_file,
95
95
  )
96
-
96
+
97
97
  # Retrieve basic configuration data from hass
98
98
  if get_data_from_file:
99
99
  with open(emhass_conf["data_path"] / "test_df_final.pkl", "rb") as inp:
100
100
  _, _, _, rh.ha_config = pickle.load(inp)
101
101
  else:
102
- rh.get_ha_config()
103
-
102
+ response = rh.get_ha_config()
103
+ if type(response) is bool:
104
+ return False
105
+
104
106
  # Update the params dict using data from the HA configuration
105
107
  params = utils.update_params_with_ha_config(
106
108
  params,
107
109
  rh.ha_config,
108
110
  )
109
-
111
+
110
112
  # Define the forecast and optimization objects
111
113
  fcst = Forecast(
112
114
  retrieve_hass_conf,
@@ -444,7 +446,6 @@ def weather_forecast_cache(
444
446
  "forecast",
445
447
  logger,
446
448
  emhass_conf,
447
- {},
448
449
  )
449
450
  # Make sure weather_forecast_cache is true
450
451
  if (params != None) and (params != "null"):
@@ -90,9 +90,23 @@ class RetrieveHass:
90
90
  "Authorization": "Bearer " + self.long_lived_token,
91
91
  "content-type": "application/json",
92
92
  }
93
- url = self.hass_url + "api/config"
94
- response_config = get(url, headers=headers)
95
- self.ha_config = response_config.json()
93
+ if self.hass_url == "http://supervisor/core/api":
94
+ url = self.hass_url + "/config"
95
+ else:
96
+ url = self.hass_url + "api/config"
97
+
98
+ try:
99
+ response_config = get(url, headers=headers)
100
+ except Exception:
101
+ self.logger.error("Unable to access Home Assistance instance, check URL")
102
+ self.logger.error("If using addon, try setting url and token to 'empty'")
103
+ return False
104
+
105
+ try:
106
+ self.ha_config = response_config.json()
107
+ except Exception:
108
+ self.logger.error("EMHASS was unable to obtain configuration data from HA")
109
+ return False
96
110
 
97
111
  def get_data(
98
112
  self,
@@ -171,6 +171,7 @@ def update_params_with_ha_config(
171
171
  'CHF': 'CHF', # Swiss Franc has no special symbol
172
172
  'CNY': '¥',
173
173
  'INR': '₹',
174
+ 'CZK': 'Kč',
174
175
  # Add more as needed
175
176
  }
176
177
  if 'currency' in ha_config.keys():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: emhass
3
- Version: 0.12.0
3
+ Version: 0.12.2
4
4
  Summary: An Energy Management System for Home Assistant
5
5
  Author-email: David HERNANDEZ <davidusb@gmail.com>
6
6
  License: MIT
@@ -135,10 +135,7 @@ You must follow these steps to make EMHASS work properly:
135
135
  - There are multiple methods of installing and Running EMHASS. See [Installation Method](#Installation-Methods) below to pick a method that best suits your use case.
136
136
 
137
137
  2) Define all the parameters in the configuration file *(`config.json`)* or configuration page *(`YOURIP:5000/configuration`)*.
138
- ```{note}
139
-
140
- New in EMHASS v0.12.0: the default configuration does not need to retrieve any data from Home Assistant! After installing and running the add-on, EMHASS should start and it will be ready to launch an optimization.
141
- ```
138
+ - Since EMHASS v0.12.0: the default configuration does not need to retrieve any data from Home Assistant! After installing and running the add-on, EMHASS should start and it will be ready to launch an optimization.
142
139
  - See the description for each parameter in the [configuration](https://emhass.readthedocs.io/en/latest/config.html) docs.
143
140
  - EMHASS has a default configuration with 2 deferrable loads, no solar PV, no batteries and a basic load power forecasting method.
144
141
  - If you want to consider solar PV and more advanced load power forecast methods, you will need to define the main data entering EMHASS. This will be the Home Assistant sensor/variable `sensor.power_load_no_var_loads`, for the load power of your household excluding the power of the deferrable loads that you want to optimize, and the sensor/variable `sensor.power_photovoltaics` for the name of your Home Assistant variable containing the PV produced power (if solar PV is activated).
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