emhass 0.12.8__tar.gz → 0.13.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 (26) hide show
  1. {emhass-0.12.8 → emhass-0.13.1}/.gitignore +4 -0
  2. {emhass-0.12.8 → emhass-0.13.1}/PKG-INFO +12 -4
  3. emhass-0.13.1/pyproject.toml +104 -0
  4. {emhass-0.12.8 → emhass-0.13.1}/src/emhass/data/associations.csv +7 -0
  5. emhass-0.13.1/src/emhass/data/cec_inverters.pbz2 +0 -0
  6. emhass-0.13.1/src/emhass/data/cec_modules.pbz2 +0 -0
  7. {emhass-0.12.8 → emhass-0.13.1}/src/emhass/data/config_defaults.json +16 -5
  8. {emhass-0.12.8 → emhass-0.13.1}/src/emhass/static/data/param_definitions.json +51 -1
  9. emhass-0.13.1/src/emhass/static/img/emhass_icon.png +0 -0
  10. emhass-0.12.8/pyproject.toml +0 -84
  11. emhass-0.12.8/src/emhass/data/cec_inverters.pbz2 +0 -0
  12. emhass-0.12.8/src/emhass/data/cec_modules.pbz2 +0 -0
  13. {emhass-0.12.8 → emhass-0.13.1}/LICENSE +0 -0
  14. {emhass-0.12.8 → emhass-0.13.1}/README.md +0 -0
  15. {emhass-0.12.8/src/emhass/static → emhass-0.13.1/src/emhass}/img/emhass_icon.png +0 -0
  16. {emhass-0.12.8 → emhass-0.13.1}/src/emhass/static/advanced.html +0 -0
  17. {emhass-0.12.8 → emhass-0.13.1}/src/emhass/static/basic.html +0 -0
  18. {emhass-0.12.8 → emhass-0.13.1}/src/emhass/static/configuration_list.html +0 -0
  19. {emhass-0.12.8 → emhass-0.13.1}/src/emhass/static/configuration_script.js +0 -0
  20. {emhass-0.12.8 → emhass-0.13.1}/src/emhass/static/img/emhass_logo_short.svg +0 -0
  21. {emhass-0.12.8 → emhass-0.13.1}/src/emhass/static/img/feather-sprite.svg +0 -0
  22. {emhass-0.12.8 → emhass-0.13.1}/src/emhass/static/script.js +0 -0
  23. {emhass-0.12.8 → emhass-0.13.1}/src/emhass/static/style.css +0 -0
  24. {emhass-0.12.8 → emhass-0.13.1}/src/emhass/templates/configuration.html +0 -0
  25. {emhass-0.12.8 → emhass-0.13.1}/src/emhass/templates/index.html +0 -0
  26. {emhass-0.12.8 → emhass-0.13.1}/src/emhass/templates/template.html +0 -0
@@ -14,6 +14,7 @@ secrets_emhass.yaml
14
14
  .devcontainer/devcontainer.json
15
15
  *.pkl
16
16
  **/app
17
+ .cache.sqlite
17
18
 
18
19
 
19
20
  # Byte-compiled / optimized / DLL files
@@ -46,6 +47,8 @@ MANIFEST
46
47
 
47
48
  # Local session data
48
49
  data/actionLogs.txt
50
+ data/debug-*.csv
51
+ data/cached-open-meteo-forecast.json
49
52
  data/entities/*.json
50
53
 
51
54
  # PyInstaller
@@ -161,3 +164,4 @@ dmypy.json
161
164
  # Cython debug symbols
162
165
  cython_debug/
163
166
 
167
+ docs/EMHASS_presentation.pdf
@@ -1,20 +1,26 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: emhass
3
- Version: 0.12.8
3
+ Version: 0.13.1
4
4
  Summary: An Energy Management System for Home Assistant
5
5
  Project-URL: Homepage, https://github.com/davidusb-geek/emhass
6
+ Project-URL: Source, https://github.com/davidusb-geek/emhass
7
+ Project-URL: Issues, https://github.com/davidusb-geek/emhass/issues
8
+ Project-URL: Documentation, https://emhass.readthedocs.io/en/latest/
9
+ Project-URL: Community, https://community.home-assistant.io/t/emhass-an-energy-management-for-home-assistant
6
10
  Author-email: David HERNANDEZ <davidusb@gmail.com>
7
- License-Expression: MIT
11
+ License: MIT
8
12
  License-File: LICENSE
9
13
  Keywords: energy,hass,management,optimization
10
14
  Classifier: Development Status :: 5 - Production/Stable
11
15
  Classifier: Intended Audience :: Developers
12
16
  Classifier: License :: OSI Approved :: MIT License
13
17
  Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
14
21
  Classifier: Programming Language :: Python :: 3.12
15
- Classifier: Topic :: Software Development :: Build Tools
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
23
  Requires-Python: <3.13,>=3.10
17
- Requires-Dist: beautifulsoup4>=4.12.3
18
24
  Requires-Dist: flask>=3.1.0
19
25
  Requires-Dist: gunicorn>=23.0.0
20
26
  Requires-Dist: h5py>=3.12.1
@@ -31,6 +37,8 @@ Requires-Dist: scipy>=1.15.0
31
37
  Requires-Dist: skforecast>=0.14.0
32
38
  Requires-Dist: tables>=3.10.0
33
39
  Requires-Dist: waitress>=3.0.2
40
+ Provides-Extra: dev
41
+ Requires-Dist: ruff; extra == 'dev'
34
42
  Provides-Extra: docs
35
43
  Requires-Dist: myst-parser; extra == 'docs'
36
44
  Requires-Dist: sphinx; extra == 'docs'
@@ -0,0 +1,104 @@
1
+ [project]
2
+ name = "emhass"
3
+ version = "0.13.1"
4
+ description = "An Energy Management System for Home Assistant"
5
+ readme = "README.md"
6
+ requires-python = ">=3.10, <3.13"
7
+ authors = [
8
+ { name = "David HERNANDEZ", email = "davidusb@gmail.com" },
9
+ ]
10
+ license = { text = "MIT" }
11
+ keywords = ["energy", "management", "optimization", "hass"]
12
+ classifiers = [
13
+ "Development Status :: 5 - Production/Stable",
14
+ "Intended Audience :: Developers",
15
+ "Topic :: Software Development :: Libraries :: Python Modules",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Programming Language :: Python :: 3 :: Only",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Operating System :: OS Independent",
22
+ ]
23
+ dependencies = [
24
+ "numpy>=2.0.0, <2.3.0",
25
+ "scipy>=1.15.0",
26
+ "pandas>=2.2.0",
27
+ "pvlib>=0.11.0",
28
+ "protobuf>=5.29.3",
29
+ "pytz>=2024.2",
30
+ "requests>=2.32.2",
31
+ "h5py>=3.12.1",
32
+ "pulp>=2.8.0",
33
+ "pyyaml>=6.0.2",
34
+ "tables>=3.10.0",
35
+ "skforecast>=0.14.0",
36
+ "flask>=3.1.0",
37
+ "waitress>=3.0.2",
38
+ "plotly>=6.0.0",
39
+ "gunicorn>=23.0.0",
40
+ ]
41
+ [build-system]
42
+ requires = ["hatchling"]
43
+ build-backend = "hatchling.build"
44
+
45
+
46
+ [tool.uv.workspace]
47
+ members = ["emhass"]
48
+
49
+ [tool.uv.sources]
50
+ emhass = { workspace = true }
51
+
52
+ [tool.uv]
53
+ default-groups = "all"
54
+ package = true
55
+
56
+ [project.optional-dependencies]
57
+ docs = ["sphinx", "sphinx-rtd-theme", "myst-parser"]
58
+ test = ["requests-mock", "pytest", "coverage", "snakeviz", "ruff", "tabulate", "hatchling"]
59
+ dev = ["ruff"]
60
+
61
+ [tool.hatch.build.targets.wheel]
62
+ packages = ["src/emhass"]
63
+ package-data = { "emhass" = [
64
+ "templates/*",
65
+ "static/*",
66
+ "img/*",
67
+ "data/cec_modules.pbz2",
68
+ "data/cec_inverters.pbz2",
69
+ "data/associations.csv",
70
+ "data/config_defaults.json"]}
71
+
72
+ [tool.hatch.build.targets.sdist]
73
+ include = [
74
+ "src/emhass/templates/",
75
+ "src/emhass/static/",
76
+ "src/emhass/img/",
77
+ "src/emhass/data/cec_modules.pbz2",
78
+ "src/emhass/data/cec_inverters.pbz2",
79
+ "src/emhass/data/associations.csv",
80
+ "src/emhass/data/config_defaults.json",
81
+ ]
82
+
83
+ [project.scripts]
84
+ emhass = "emhass.command_line:main"
85
+
86
+ [project.urls]
87
+ Homepage = "https://github.com/davidusb-geek/emhass"
88
+ Source = "https://github.com/davidusb-geek/emhass"
89
+ Issues = "https://github.com/davidusb-geek/emhass/issues"
90
+ Documentation = "https://emhass.readthedocs.io/en/latest/"
91
+ Community = "https://community.home-assistant.io/t/emhass-an-energy-management-for-home-assistant"
92
+
93
+ [tool.ruff.lint]
94
+ select = ["E", "W", "F", "I", "C", "B", "Q", "UP", "YTT", "PYI"]
95
+ ignore = ["E501", "B008", "B905", "C901"]
96
+
97
+ [dependency-groups]
98
+ dev = [
99
+ "emhass",
100
+ ]
101
+
102
+ [tool.ruff]
103
+ target-version = "py311"
104
+ src = ["src", "tests"]
@@ -2,6 +2,7 @@ config_categorie,legacy_parameter_name,parameter,list_name
2
2
  retrieve_hass_conf,freq,optimization_time_step
3
3
  retrieve_hass_conf,days_to_retrieve,historic_days_to_retrieve
4
4
  retrieve_hass_conf,var_PV,sensor_power_photovoltaics
5
+ retrieve_hass_conf,var_PV_forecast,sensor_power_photovoltaics_forecast
5
6
  retrieve_hass_conf,var_load,sensor_power_load_no_var_loads
6
7
  retrieve_hass_conf,load_negative,load_negative
7
8
  retrieve_hass_conf,set_zero_min,set_zero_min
@@ -16,9 +17,13 @@ params_secrets,alt,Altitude
16
17
  optim_conf,costfun,costfun
17
18
  optim_conf,logging_level,logging_level
18
19
  optim_conf,set_use_pv,set_use_pv
20
+ optim_conf,set_use_adjusted_pv,set_use_adjusted_pv
21
+ optim_conf,adjusted_pv_regression_model,adjusted_pv_regression_model
22
+ optim_conf,adjusted_pv_solar_elevation_threshold,adjusted_pv_solar_elevation_threshold
19
23
  optim_conf,set_use_battery,set_use_battery
20
24
  optim_conf,num_def_loads,number_of_deferrable_loads
21
25
  optim_conf,P_deferrable_nom,nominal_power_of_deferrable_loads,list_nominal_power_of_deferrable_loads
26
+ optim_conf,minimum_power_of_deferrable_loads,minimum_power_of_deferrable_loads
22
27
  optim_conf,def_total_hours,operating_hours_of_each_deferrable_load,list_operating_hours_of_each_deferrable_load
23
28
  optim_conf,treat_def_as_semi_cont,treat_deferrable_load_as_semi_cont,list_treat_deferrable_load_as_semi_cont
24
29
  optim_conf,set_def_constant,set_deferrable_load_single_constant,list_set_deferrable_load_single_constant
@@ -33,6 +38,7 @@ optim_conf,prod_sell_price,photovoltaic_production_sell_price
33
38
  optim_conf,set_total_pv_sell,set_total_pv_sell
34
39
  optim_conf,lp_solver,lp_solver
35
40
  optim_conf,lp_solver_path,lp_solver_path
41
+ optim_conf,lp_solver_timeout,lp_solver_timeout
36
42
  optim_conf,set_nocharge_from_grid,set_nocharge_from_grid
37
43
  optim_conf,set_nodischarge_to_grid,set_nodischarge_to_grid
38
44
  optim_conf,set_battery_dynamic,set_battery_dynamic
@@ -41,6 +47,7 @@ optim_conf,battery_dynamic_min,battery_dynamic_min
41
47
  optim_conf,weight_battery_discharge,weight_battery_discharge
42
48
  optim_conf,weight_battery_charge,weight_battery_charge
43
49
  optim_conf,weather_forecast_method,weather_forecast_method
50
+ optim_conf,open_meteo_cache_max_age,open_meteo_cache_max_age
44
51
  optim_conf,def_start_timestep,start_timesteps_of_each_deferrable_load,list_start_timesteps_of_each_deferrable_load
45
52
  optim_conf,def_end_timestep,end_timesteps_of_each_deferrable_load,list_end_timesteps_of_each_deferrable_load
46
53
  optim_conf,list_hp_periods,load_peak_hour_periods
@@ -2,24 +2,27 @@
2
2
  "logging_level": "INFO",
3
3
  "costfun": "profit",
4
4
  "optimization_time_step": 30,
5
- "historic_days_to_retrieve": 2,
5
+ "historic_days_to_retrieve": 9,
6
6
  "method_ts_round": "nearest",
7
7
  "continual_publish": false,
8
8
  "data_path": "default",
9
9
  "set_total_pv_sell": false,
10
10
  "lp_solver": "default",
11
11
  "lp_solver_path": "empty",
12
+ "lp_solver_timeout": 45,
12
13
  "set_nocharge_from_grid": false,
13
14
  "set_nodischarge_to_grid": true,
14
15
  "set_battery_dynamic": false,
15
16
  "battery_dynamic_max": 0.9,
16
17
  "battery_dynamic_min": -0.9,
17
- "weight_battery_discharge": 1.0,
18
- "weight_battery_charge": 1.0,
18
+ "weight_battery_discharge": 0.0,
19
+ "weight_battery_charge": 0.0,
19
20
  "sensor_power_photovoltaics": "sensor.power_photovoltaics",
21
+ "sensor_power_photovoltaics_forecast": "sensor.p_pv_forecast",
20
22
  "sensor_power_load_no_var_loads": "sensor.power_load_no_var_loads",
21
23
  "sensor_replace_zero": [
22
- "sensor.power_photovoltaics"
24
+ "sensor.power_photovoltaics",
25
+ "sensor.p_pv_forecast"
23
26
  ],
24
27
  "sensor_linear_interp": [
25
28
  "sensor.power_photovoltaics",
@@ -32,11 +35,16 @@
32
35
  3000.0,
33
36
  750.0
34
37
  ],
38
+ "minimum_power_of_deferrable_loads": [
39
+ 0.0,
40
+ 0.0
41
+ ],
35
42
  "operating_hours_of_each_deferrable_load": [
36
43
  4,
37
44
  0
38
45
  ],
39
46
  "weather_forecast_method": "open-meteo",
47
+ "open_meteo_cache_max_age": 30,
40
48
  "load_forecast_method": "naive",
41
49
  "delta_forecast_daily": 1,
42
50
  "load_cost_forecast_method": "hp_hc_periods",
@@ -85,6 +93,9 @@
85
93
  "maximum_power_from_grid": 9000,
86
94
  "maximum_power_to_grid": 9000,
87
95
  "set_use_pv": false,
96
+ "set_use_adjusted_pv": false,
97
+ "adjusted_pv_regression_model": "LassoRegression",
98
+ "adjusted_pv_solar_elevation_threshold": 10,
88
99
  "pv_module_model": [
89
100
  "CSUN_Eurasia_Energy_Systems_Industry_and_Trade_CSUN295_60M"
90
101
  ],
@@ -114,4 +125,4 @@
114
125
  "battery_minimum_state_of_charge": 0.3,
115
126
  "battery_maximum_state_of_charge": 0.9,
116
127
  "battery_target_state_of_charge": 0.6
117
- }
128
+ }
@@ -12,11 +12,17 @@
12
12
  "default_value": "profit"
13
13
  },
14
14
  "sensor_power_photovoltaics": {
15
- "friendly_name": "Sensor power sensor",
15
+ "friendly_name": "Sensor power photovoltaic",
16
16
  "Description": "This is the name of the photovoltaic power-produced sensor in Watts from Home Assistant. For example: ‘sensor.power_photovoltaics’.",
17
17
  "input": "string",
18
18
  "default_value": "sensor.power_photovoltaics"
19
19
  },
20
+ "sensor_power_photovoltaics_forecast": {
21
+ "friendly_name": "Sensor power photovoltaic forecast",
22
+ "Description": "This is the name of the photovoltaic forecast sensor in Watts from Home Assistant. For example: ‘sensor.p_pv_forecast’.",
23
+ "input": "string",
24
+ "default_value": "sensor.p_pv_forecast"
25
+ },
20
26
  "sensor_power_load_no_var_loads": {
21
27
  "friendly_name": "Sensor power loads with no variable loads",
22
28
  "Description": "The name of the household power consumption sensor in Watts from Home Assistant. The deferrable loads that we will want to include in the optimization problem should be subtracted from this sensor in HASS. For example: ‘sensor.power_load_no_var_loads’",
@@ -132,6 +138,12 @@
132
138
  "input": "text",
133
139
  "default_value": "/usr/bin/cbc"
134
140
  },
141
+ "lp_solver_timeout": {
142
+ "friendly_name": "Linear programming solver timeout",
143
+ "Description": "Set the maximum time (in seconds) for the LP solver. Defaults to 45.",
144
+ "input": "int",
145
+ "default_value": 45
146
+ },
135
147
  "weather_forecast_method": {
136
148
  "friendly_name": "Weather forecast method",
137
149
  "Description": "This will define the weather forecast method that will be used. options are 'open-meteo', 'Solcast', 'solar.forecast' (forecast.solar) and 'csv' to load a CSV file. When loading a CSV file this will be directly considered as the PV power forecast in Watts.",
@@ -144,6 +156,12 @@
144
156
  ],
145
157
  "default_value": "open-meteo"
146
158
  },
159
+ "open_meteo_cache_max_age": {
160
+ "friendly_name": "Open-Meteo Cache Max Age",
161
+ "Description": "The maximum age, in minutes, of the cached open-meteo json response, after which a new version will be fetched from Open-Meteo. Defaults to 30.",
162
+ "input": "int",
163
+ "default_value": 30
164
+ },
147
165
  "maximum_power_from_grid": {
148
166
  "friendly_name": "Max power from grid",
149
167
  "Description": "The maximum power that can be supplied by the utility grid in Watts (consumption). Defaults to 9000.",
@@ -236,6 +254,32 @@
236
254
  "input": "boolean",
237
255
  "default_value": false
238
256
  },
257
+ "set_use_adjusted_pv": {
258
+ "friendly_name": "Enable adjusted PV system",
259
+ "Description": "Set to True if we should consider an adjusted solar PV system. Defaults to False",
260
+ "input": "boolean",
261
+ "default_value": false
262
+ },
263
+ "adjusted_pv_regression_model": {
264
+ "friendly_name": "Regression model for adjusted PV",
265
+ "Description": "Set the type of regression model that will be used to adjust the solr PV production to local conditions. Defaults to LassoRegression",
266
+ "input": "select",
267
+ "select_options": [
268
+ "LinearRegression",
269
+ "RidgeRegression",
270
+ "LassoRegression",
271
+ "RandomForestRegression",
272
+ "GradientBoostingRegression",
273
+ "AdaBoostRegression"
274
+ ],
275
+ "default_value": "LassoRegression"
276
+ },
277
+ "adjusted_pv_solar_elevation_threshold": {
278
+ "friendly_name": "Solar elevation threshold",
279
+ "Description": "This is the solar elevation threshold parameter used to identify the early morning or late evening periods. Defaults to 10.",
280
+ "input": "int",
281
+ "default_value": 10
282
+ },
239
283
  "pv_module_model": {
240
284
  "friendly_name": "PV module model name",
241
285
  "Description": "The PV module model. This parameter can be a list of items to enable the simulation of mixed orientation systems.",
@@ -288,6 +332,12 @@
288
332
  "input": "array.float",
289
333
  "default_value": 3000.0
290
334
  },
335
+ "minimum_power_of_deferrable_loads": {
336
+ "friendly_name": "Deferrable load minimum power",
337
+ "Description": "The minimum power for each deferrable load in Watts.",
338
+ "input": "array.float",
339
+ "default_value": 0.0
340
+ },
291
341
  "operating_hours_of_each_deferrable_load": {
292
342
  "friendly_name": "Deferrable load operating hours",
293
343
  "Description": "The total number of hours that each deferrable load should operate",
@@ -1,84 +0,0 @@
1
- [build-system]
2
- # These are the assumed default build requirements from pip:
3
- # https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support
4
- requires = ["hatchling>=1.27.0"]
5
- build-backend = "hatchling.build"
6
-
7
- [tool.uv.workspace]
8
- members = ["emhass"]
9
-
10
- [tool.hatch.build.targets.wheel]
11
- packages = ["src/emhass"]
12
-
13
- [project]
14
- name = "emhass"
15
- version = "0.12.8"
16
- description = "An Energy Management System for Home Assistant"
17
- readme = "README.md"
18
- requires-python = ">=3.10, <3.13"
19
- authors = [{ name = "David HERNANDEZ", email = "davidusb@gmail.com" }]
20
- license = "MIT"
21
- keywords = ["energy", "management", "optimization", "hass"]
22
- classifiers = [
23
- "Development Status :: 5 - Production/Stable",
24
- "Intended Audience :: Developers",
25
- "Topic :: Software Development :: Build Tools",
26
- "License :: OSI Approved :: MIT License",
27
- "Programming Language :: Python :: 3.12",
28
- "Operating System :: OS Independent",
29
- ]
30
- dependencies = [
31
- "numpy>=2.0.0, <2.3.0",
32
- "scipy>=1.15.0",
33
- "pandas>=2.2.0",
34
- "pvlib>=0.11.0",
35
- "protobuf>=5.29.3",
36
- "pytz>=2024.2",
37
- "requests>=2.32.2",
38
- "beautifulsoup4>=4.12.3",
39
- "h5py>=3.12.1",
40
- "pulp>=2.8.0",
41
- "pyyaml>=6.0.2",
42
- "tables>=3.10.0",
43
- "skforecast>=0.14.0",
44
- "flask>=3.1.0",
45
- "waitress>=3.0.2",
46
- "plotly>=6.0.0",
47
- "gunicorn>=23.0.0",
48
- ]
49
-
50
- [project.optional-dependencies]
51
- docs = ["sphinx", "sphinx-rtd-theme", "myst-parser"]
52
- # can add "mypy"
53
- test = ["requests_mock", "pytest", "coverage", "snakeviz", "ruff", "tabulate", "hatchling"]
54
-
55
- [tool.hatch.build.targets.sdist]
56
- include = [
57
- "/src/emhass/templates/index.html",
58
- "/src/emhass/templates/template.html",
59
- "/src/emhass/templates/configuration.html",
60
- "/src/emhass/static/advanced.html",
61
- "/src/emhass/static/basic.html",
62
- "/src/emhass/static/script.js",
63
- "/src/emhass/static/configuration_script.js",
64
- "/src/emhass/static/style.css",
65
- "/src/emhass/static/configuration_list.html",
66
- "/src/emhass/static/img/emhass_icon.png",
67
- "/src/emhass/static/img/emhass_logo_short.svg",
68
- "/src/emhass/static/img/feather-sprite.svg",
69
- "/src/emhass/static/data/param_definitions.json",
70
- "/src/emhass/data/cec_modules.pbz2",
71
- "/src/emhass/data/cec_inverters.pbz2",
72
- "/src/emhass/data/associations.csv",
73
- "/src/emhass/data/config_defaults.json"
74
- ]
75
-
76
- [project.scripts]
77
- emhass = "emhass.command_line:main"
78
-
79
- [project.urls]
80
- Homepage = "https://github.com/davidusb-geek/emhass"
81
-
82
- #strict is strict
83
- #[tool.mypy]
84
- #strict = true
File without changes
File without changes