emhass 0.12.4__tar.gz → 0.12.5__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 (155) hide show
  1. {emhass-0.12.4 → emhass-0.12.5}/.gitignore +1 -0
  2. {emhass-0.12.4 → emhass-0.12.5}/PKG-INFO +34 -17
  3. {emhass-0.12.4 → emhass-0.12.5}/README.md +20 -4
  4. emhass-0.12.5/pyproject.toml +84 -0
  5. emhass-0.12.4/.devcontainer/devcontainer.json +0 -49
  6. emhass-0.12.4/.github/ISSUE_TEMPLATE/bug_report.md +0 -35
  7. emhass-0.12.4/.github/dependabot.yml +0 -17
  8. emhass-0.12.4/.github/workflows/codecov.yaml +0 -38
  9. emhass-0.12.4/.github/workflows/codeql.yml +0 -55
  10. emhass-0.12.4/.github/workflows/docker-build-test.yaml +0 -87
  11. emhass-0.12.4/.github/workflows/publish_docker-test.yaml +0 -177
  12. emhass-0.12.4/.github/workflows/publish_docker.yaml +0 -173
  13. emhass-0.12.4/.github/workflows/python-test.yml +0 -60
  14. emhass-0.12.4/.github/workflows/updatePVLibDB.yaml +0 -38
  15. emhass-0.12.4/.github/workflows/upload-package-to-pypi.yaml +0 -57
  16. emhass-0.12.4/.python-version +0 -1
  17. emhass-0.12.4/.readthedocs.yaml +0 -28
  18. emhass-0.12.4/CHANGELOG.md +0 -700
  19. emhass-0.12.4/CODE_OF_CONDUCT.md +0 -128
  20. emhass-0.12.4/CONTRIBUTING.md +0 -14
  21. emhass-0.12.4/Dockerfile +0 -142
  22. emhass-0.12.4/MANIFEST.in +0 -13
  23. emhass-0.12.4/data/data_load_cost_forecast.csv +0 -48
  24. emhass-0.12.4/data/data_load_forecast.csv +0 -48
  25. emhass-0.12.4/data/data_prod_price_forecast.csv +0 -48
  26. emhass-0.12.4/data/data_weather_forecast.csv +0 -48
  27. emhass-0.12.4/data/heating_prediction.csv +0 -130
  28. emhass-0.12.4/data/opt_res_latest.csv +0 -49
  29. emhass-0.12.4/data/opt_res_perfect_optim_cost.csv +0 -385
  30. emhass-0.12.4/data/opt_res_perfect_optim_profit.csv +0 -385
  31. emhass-0.12.4/data/opt_res_perfect_optim_self-consumption.csv +0 -385
  32. emhass-0.12.4/data/test_response_get_data_get_method.pbz2 +0 -0
  33. emhass-0.12.4/data/test_response_scrapper_get_method.pbz2 +0 -0
  34. emhass-0.12.4/data/test_response_solarforecast_get_method.pbz2 +0 -0
  35. emhass-0.12.4/data/test_response_solcast_get_method.pbz2 +0 -0
  36. emhass-0.12.4/deploy_docker.mk +0 -12
  37. emhass-0.12.4/docs/Makefile +0 -20
  38. emhass-0.12.4/docs/_static/css/custom.css +0 -375
  39. emhass-0.12.4/docs/conf.py +0 -62
  40. emhass-0.12.4/docs/config.md +0 -123
  41. emhass-0.12.4/docs/develop.md +0 -340
  42. emhass-0.12.4/docs/differences.md +0 -121
  43. emhass-0.12.4/docs/emhass.md +0 -55
  44. emhass-0.12.4/docs/forecasts.md +0 -345
  45. emhass-0.12.4/docs/images/Community_button.svg +0 -40
  46. emhass-0.12.4/docs/images/Documentation_button.svg +0 -40
  47. emhass-0.12.4/docs/images/EMHASS_Add_on_button.svg +0 -40
  48. emhass-0.12.4/docs/images/EMHASS_button.svg +0 -40
  49. emhass-0.12.4/docs/images/Issues_button.svg +0 -40
  50. emhass-0.12.4/docs/images/deferrable_timewindow_addon_config.png +0 -0
  51. emhass-0.12.4/docs/images/deferrable_timewindow_edge_cases.png +0 -0
  52. emhass-0.12.4/docs/images/deferrable_timewindow_evexample.png +0 -0
  53. emhass-0.12.4/docs/images/emhass_logo.png +0 -0
  54. emhass-0.12.4/docs/images/emhass_logo.svg +0 -563
  55. emhass-0.12.4/docs/images/ems_schema.png +0 -0
  56. emhass-0.12.4/docs/images/ems_schema.svg +0 -5062
  57. emhass-0.12.4/docs/images/forecasted_PV_data.png +0 -0
  58. emhass-0.12.4/docs/images/hp_hc_periods.png +0 -0
  59. emhass-0.12.4/docs/images/hp_hc_periods.svg +0 -1679
  60. emhass-0.12.4/docs/images/inputs_cost_price.png +0 -0
  61. emhass-0.12.4/docs/images/inputs_cost_price.svg +0 -1
  62. emhass-0.12.4/docs/images/inputs_dayahead.png +0 -0
  63. emhass-0.12.4/docs/images/inputs_dayahead.svg +0 -1
  64. emhass-0.12.4/docs/images/inputs_power.png +0 -0
  65. emhass-0.12.4/docs/images/inputs_power.svg +0 -1
  66. emhass-0.12.4/docs/images/inputs_power_load_forecast.svg +0 -1
  67. emhass-0.12.4/docs/images/load_forecast_knn_bare.svg +0 -1
  68. emhass-0.12.4/docs/images/load_forecast_knn_bare_backtest.svg +0 -1
  69. emhass-0.12.4/docs/images/load_forecast_knn_optimized.svg +0 -1
  70. emhass-0.12.4/docs/images/load_forecast_production.svg +0 -1
  71. emhass-0.12.4/docs/images/naive_forecast.png +0 -0
  72. emhass-0.12.4/docs/images/naive_forecast.svg +0 -1778
  73. emhass-0.12.4/docs/images/optim_results_PV_Batt_defLoads_dayaheadOptim.png +0 -0
  74. emhass-0.12.4/docs/images/optim_results_PV_Batt_defLoads_dayaheadOptim.svg +0 -1
  75. emhass-0.12.4/docs/images/optim_results_PV_Batt_defLoads_dayaheadOptim_SOC.png +0 -0
  76. emhass-0.12.4/docs/images/optim_results_PV_Batt_defLoads_dayaheadOptim_SOC.svg +0 -1
  77. emhass-0.12.4/docs/images/optim_results_PV_defLoads_dayaheadOptim.png +0 -0
  78. emhass-0.12.4/docs/images/optim_results_PV_defLoads_dayaheadOptim.svg +0 -1
  79. emhass-0.12.4/docs/images/optim_results_PV_defLoads_perfectOptim.png +0 -0
  80. emhass-0.12.4/docs/images/optim_results_PV_defLoads_perfectOptim.svg +0 -1
  81. emhass-0.12.4/docs/images/optim_results_bar_plot.png +0 -0
  82. emhass-0.12.4/docs/images/optim_results_defLoads_dayaheadOptim.png +0 -0
  83. emhass-0.12.4/docs/images/optim_results_defLoads_dayaheadOptim.svg +0 -1
  84. emhass-0.12.4/docs/images/optimization_graphics.png +0 -0
  85. emhass-0.12.4/docs/images/optimization_graphics.svg +0 -4701
  86. emhass-0.12.4/docs/images/thermal_load_diagram.svg +0 -733
  87. emhass-0.12.4/docs/images/workflow.png +0 -0
  88. emhass-0.12.4/docs/images/workflow.svg +0 -6568
  89. emhass-0.12.4/docs/index.md +0 -37
  90. emhass-0.12.4/docs/intro.md +0 -4
  91. emhass-0.12.4/docs/log.txt +0 -48
  92. emhass-0.12.4/docs/lpems.md +0 -259
  93. emhass-0.12.4/docs/make.bat +0 -35
  94. emhass-0.12.4/docs/mlforecaster.md +0 -170
  95. emhass-0.12.4/docs/mlregressor.md +0 -191
  96. emhass-0.12.4/docs/requirements.txt +0 -6
  97. emhass-0.12.4/docs/study_case.md +0 -167
  98. emhass-0.12.4/docs/thermal_model.md +0 -125
  99. emhass-0.12.4/gunicorn.conf.py +0 -11
  100. emhass-0.12.4/options.json +0 -13
  101. emhass-0.12.4/pyproject.toml +0 -79
  102. emhass-0.12.4/scripts/dayahead_optim.sh +0 -3
  103. emhass-0.12.4/scripts/load_clustering.py +0 -265
  104. emhass-0.12.4/scripts/load_forecast_sklearn.py +0 -376
  105. emhass-0.12.4/scripts/optim_results_analysis.py +0 -214
  106. emhass-0.12.4/scripts/publish_data.sh +0 -3
  107. emhass-0.12.4/scripts/read_csv_plot_data.py +0 -207
  108. emhass-0.12.4/scripts/requirements.txt +0 -3
  109. emhass-0.12.4/scripts/save_pvlib_module_inverter_database.py +0 -138
  110. emhass-0.12.4/scripts/script_debug_forecasts.py +0 -75
  111. emhass-0.12.4/scripts/script_debug_optim.py +0 -184
  112. emhass-0.12.4/scripts/script_simple_thermal_model.py +0 -215
  113. emhass-0.12.4/scripts/script_thermal_model_optim.py +0 -209
  114. emhass-0.12.4/scripts/special_config_analysis.py +0 -356
  115. emhass-0.12.4/scripts/special_options.json +0 -89
  116. emhass-0.12.4/scripts/use_cases_analysis.py +0 -282
  117. emhass-0.12.4/secrets_emhass(example).yaml +0 -13
  118. emhass-0.12.4/src/emhass/__init__.py +0 -0
  119. emhass-0.12.4/src/emhass/command_line.py +0 -1748
  120. emhass-0.12.4/src/emhass/data/emhass_inverters.csv +0 -8
  121. emhass-0.12.4/src/emhass/data/emhass_modules.csv +0 -6
  122. emhass-0.12.4/src/emhass/forecast.py +0 -1348
  123. emhass-0.12.4/src/emhass/machine_learning_forecaster.py +0 -397
  124. emhass-0.12.4/src/emhass/machine_learning_regressor.py +0 -275
  125. emhass-0.12.4/src/emhass/optimization.py +0 -1504
  126. emhass-0.12.4/src/emhass/retrieve_hass.py +0 -670
  127. emhass-0.12.4/src/emhass/static/img/emhass_icon.png +0 -0
  128. emhass-0.12.4/src/emhass/utils.py +0 -1678
  129. emhass-0.12.4/src/emhass/web_server.py +0 -756
  130. emhass-0.12.4/tests/__init__.py +0 -0
  131. emhass-0.12.4/tests/test_command_line_utils.py +0 -935
  132. emhass-0.12.4/tests/test_forecast.py +0 -1004
  133. emhass-0.12.4/tests/test_machine_learning_forecaster.py +0 -180
  134. emhass-0.12.4/tests/test_machine_learning_regressor.py +0 -117
  135. emhass-0.12.4/tests/test_optimization.py +0 -815
  136. emhass-0.12.4/tests/test_retrieve_hass.py +0 -342
  137. emhass-0.12.4/tests/test_utils.py +0 -1070
  138. {emhass-0.12.4 → emhass-0.12.5}/LICENSE +0 -0
  139. {emhass-0.12.4 → emhass-0.12.5}/src/emhass/data/associations.csv +0 -0
  140. {emhass-0.12.4 → emhass-0.12.5}/src/emhass/data/cec_inverters.pbz2 +0 -0
  141. {emhass-0.12.4 → emhass-0.12.5}/src/emhass/data/cec_modules.pbz2 +0 -0
  142. {emhass-0.12.4 → emhass-0.12.5}/src/emhass/data/config_defaults.json +0 -0
  143. {emhass-0.12.4 → emhass-0.12.5}/src/emhass/static/advanced.html +0 -0
  144. {emhass-0.12.4 → emhass-0.12.5}/src/emhass/static/basic.html +0 -0
  145. {emhass-0.12.4 → emhass-0.12.5}/src/emhass/static/configuration_list.html +0 -0
  146. {emhass-0.12.4 → emhass-0.12.5}/src/emhass/static/configuration_script.js +0 -0
  147. {emhass-0.12.4 → emhass-0.12.5}/src/emhass/static/data/param_definitions.json +0 -0
  148. {emhass-0.12.4/src/emhass → emhass-0.12.5/src/emhass/static}/img/emhass_icon.png +0 -0
  149. {emhass-0.12.4 → emhass-0.12.5}/src/emhass/static/img/emhass_logo_short.svg +0 -0
  150. {emhass-0.12.4 → emhass-0.12.5}/src/emhass/static/img/feather-sprite.svg +0 -0
  151. {emhass-0.12.4 → emhass-0.12.5}/src/emhass/static/script.js +0 -0
  152. {emhass-0.12.4 → emhass-0.12.5}/src/emhass/static/style.css +0 -0
  153. {emhass-0.12.4 → emhass-0.12.5}/src/emhass/templates/configuration.html +0 -0
  154. {emhass-0.12.4 → emhass-0.12.5}/src/emhass/templates/index.html +0 -0
  155. {emhass-0.12.4 → emhass-0.12.5}/src/emhass/templates/template.html +0 -0
@@ -11,6 +11,7 @@ secrets_emhass.yaml
11
11
  .vscode/launch.json
12
12
  .vscode/settings.json
13
13
  .vscode/tasks.json
14
+ .devcontainer/devcontainer.json
14
15
  *.pkl
15
16
  **/app
16
17
 
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: emhass
3
- Version: 0.12.4
3
+ Version: 0.12.5
4
4
  Summary: An Energy Management System for Home Assistant
5
5
  Project-URL: Homepage, https://github.com/davidusb-geek/emhass
6
6
  Author-email: David HERNANDEZ <davidusb@gmail.com>
7
- License: MIT
7
+ License-Expression: MIT
8
8
  License-File: LICENSE
9
9
  Keywords: energy,hass,management,optimization
10
10
  Classifier: Development Status :: 5 - Production/Stable
@@ -13,23 +13,23 @@ Classifier: License :: OSI Approved :: MIT License
13
13
  Classifier: Operating System :: OS Independent
14
14
  Classifier: Programming Language :: Python :: 3.11
15
15
  Classifier: Topic :: Software Development :: Build Tools
16
- Requires-Python: <3.12,>=3.10
16
+ Requires-Python: <3.13,>=3.10
17
17
  Requires-Dist: beautifulsoup4>=4.12.3
18
18
  Requires-Dist: flask>=3.1.0
19
19
  Requires-Dist: gunicorn>=23.0.0
20
20
  Requires-Dist: h5py>=3.12.1
21
21
  Requires-Dist: numpy<2.3.0,>=2.0.0
22
- Requires-Dist: pandas>=2.1.1
23
- Requires-Dist: plotly>=6.0.0rc0
24
- Requires-Dist: protobuf>=5.29.1
22
+ Requires-Dist: pandas>=2.2.0
23
+ Requires-Dist: plotly>=6.0.0
24
+ Requires-Dist: protobuf>=5.29.3
25
25
  Requires-Dist: pulp>=2.8.0
26
- Requires-Dist: pvlib>=0.10.3
27
- Requires-Dist: pytz>=2023.4
28
- Requires-Dist: pyyaml>=6.0.1
29
- Requires-Dist: requests>=2.25.1
30
- Requires-Dist: scipy>=1.14.0
31
- Requires-Dist: skforecast>=0.9.0
32
- Requires-Dist: tables>=3.9.1
26
+ Requires-Dist: pvlib>=0.11.0
27
+ Requires-Dist: pytz>=2024.2
28
+ Requires-Dist: pyyaml>=6.0.2
29
+ Requires-Dist: requests>=2.32.2
30
+ Requires-Dist: scipy>=1.15.0
31
+ Requires-Dist: skforecast>=0.14.0
32
+ Requires-Dist: tables>=3.10.0
33
33
  Requires-Dist: waitress>=3.0.2
34
34
  Provides-Extra: docs
35
35
  Requires-Dist: myst-parser; extra == 'docs'
@@ -37,6 +37,7 @@ Requires-Dist: sphinx; extra == 'docs'
37
37
  Requires-Dist: sphinx-rtd-theme; extra == 'docs'
38
38
  Provides-Extra: test
39
39
  Requires-Dist: coverage; extra == 'test'
40
+ Requires-Dist: hatchling; extra == 'test'
40
41
  Requires-Dist: pytest; extra == 'test'
41
42
  Requires-Dist: requests-mock; extra == 'test'
42
43
  Requires-Dist: ruff; extra == 'test'
@@ -59,9 +60,6 @@ Description-Content-Type: text/markdown
59
60
  <a style="text-decoration:none" href="https://github.com/davidusb-geek/emhass/actions">
60
61
  <img alt="EMHASS GitHub Workflow Status" src="https://github.com/davidusb-geek/emhass/actions/workflows/publish_docker.yaml/badge.svg?event=release">
61
62
  </a>
62
- <a hstyle="text-decoration:none" ref="https://codecov.io/github/davidusb-geek/emhass" >
63
- <img src="https://codecov.io/github/davidusb-geek/emhass/branch/master/graph/badge.svg?token=BW7KSCHN90"/>
64
- </a>
65
63
  <a style="text-decoration:none" href="https://github.com/davidusb-geek/emhass/blob/master/LICENSE">
66
64
  <img alt="GitHub" src="https://img.shields.io/github/license/davidusb-geek/emhass">
67
65
  </a>
@@ -74,6 +72,25 @@ Description-Content-Type: text/markdown
74
72
  <a style="text-decoration:none" href="https://emhass.readthedocs.io/en/latest/">
75
73
  <img alt="Read the Docs" src="https://img.shields.io/readthedocs/emhass">
76
74
  </a>
75
+ <a hstyle="text-decoration:none" ref="https://codecov.io/github/davidusb-geek/emhass" >
76
+ <img src="https://codecov.io/github/davidusb-geek/emhass/branch/master/graph/badge.svg?token=BW7KSCHN90"/>
77
+ </a>
78
+ <a hstyle="text-decoration:none" ref="https://github.com/davidusb-geek/emhass/actions/workflows/codeql.yml" >
79
+ <img src="https://github.com/davidusb-geek/emhass/actions/workflows/codeql.yml/badge.svg?branch=master&event=schedule"/>
80
+ </a>
81
+ <a style="text-decoration:none" href=https://sonarcloud.io/summary/new_code?id=davidusb-geek_emhass">
82
+ <img alt="SonarQube security rating" src="https://sonarcloud.io/api/project_badges/measure?project=davidusb-geek_emhass&metric=security_rating">
83
+ </a>
84
+ <a style="text-decoration:none" href=https://sonarcloud.io/summary/new_code?id=davidusb-geek_emhass">
85
+ <img alt="SonarQube security Vulnerabilities" src="https://sonarcloud.io/api/project_badges/measure?project=davidusb-geek_emhass&metric=vulnerabilities">
86
+ </a>
87
+ <a style="text-decoration:none" href=https://sonarcloud.io/summary/new_code?id=davidusb-geek_emhass">
88
+ <img alt="SonarQube reliability" src="https://sonarcloud.io/api/project_badges/measure?project=davidusb-geek_emhass&metric=reliability_rating">
89
+ </a>
90
+ <a style="text-decoration:none" href=https://sonarcloud.io/summary/new_code?id=davidusb-geek_emhass">
91
+ <img alt="SonarQube bugs" src="https://sonarcloud.io/api/project_badges/measure?project=davidusb-geek_emhass&metric=bugs">
92
+ </a>
93
+
77
94
  </p>
78
95
 
79
96
  <div align="center">
@@ -638,7 +655,7 @@ curl -i -H 'Content-Type:application/json' -X POST -d '{"pv_power_forecast":[0,
638
655
  ```
639
656
  *Example with :`operating_hours_of_each_deferrable_load`, `start_timesteps_of_each_deferrable_load`, `end_timesteps_of_each_deferrable_load`.*
640
657
  ```bash
641
- curl -i -H 'Content-Type:application/json' -X POST -d '{"pv_power_forecast":[0, 70, 141.22, 246.18, 513.5, 753.27, 1049.89, 1797.93, 1697.3, 3078.93], "prediction_horizon":10, "soc_init":0.5,"soc_final":0.6,'operating_hours_of_each_deferrable_load':[1,3],'start_timesteps_of_each_deferrable_load':[0,3],'end_timesteps_of_each_deferrable_load':[0,6]}' http://localhost:5000/action/naive-mpc-optim
658
+ curl -i -H 'Content-Type:application/json' -X POST -d '{"pv_power_forecast":[0, 70, 141.22, 246.18, 513.5, 753.27, 1049.89, 1797.93, 1697.3, 3078.93], "prediction_horizon":10, "soc_init":0.5,"soc_final":0.6,"operating_hours_of_each_deferrable_load":[1,3],"start_timesteps_of_each_deferrable_load":[0,3],"end_timesteps_of_each_deferrable_load":[0,6]}' http://localhost:5000/action/naive-mpc-optim
642
659
  ```
643
660
 
644
661
  ## A machine learning forecaster
@@ -13,9 +13,6 @@
13
13
  <a style="text-decoration:none" href="https://github.com/davidusb-geek/emhass/actions">
14
14
  <img alt="EMHASS GitHub Workflow Status" src="https://github.com/davidusb-geek/emhass/actions/workflows/publish_docker.yaml/badge.svg?event=release">
15
15
  </a>
16
- <a hstyle="text-decoration:none" ref="https://codecov.io/github/davidusb-geek/emhass" >
17
- <img src="https://codecov.io/github/davidusb-geek/emhass/branch/master/graph/badge.svg?token=BW7KSCHN90"/>
18
- </a>
19
16
  <a style="text-decoration:none" href="https://github.com/davidusb-geek/emhass/blob/master/LICENSE">
20
17
  <img alt="GitHub" src="https://img.shields.io/github/license/davidusb-geek/emhass">
21
18
  </a>
@@ -28,6 +25,25 @@
28
25
  <a style="text-decoration:none" href="https://emhass.readthedocs.io/en/latest/">
29
26
  <img alt="Read the Docs" src="https://img.shields.io/readthedocs/emhass">
30
27
  </a>
28
+ <a hstyle="text-decoration:none" ref="https://codecov.io/github/davidusb-geek/emhass" >
29
+ <img src="https://codecov.io/github/davidusb-geek/emhass/branch/master/graph/badge.svg?token=BW7KSCHN90"/>
30
+ </a>
31
+ <a hstyle="text-decoration:none" ref="https://github.com/davidusb-geek/emhass/actions/workflows/codeql.yml" >
32
+ <img src="https://github.com/davidusb-geek/emhass/actions/workflows/codeql.yml/badge.svg?branch=master&event=schedule"/>
33
+ </a>
34
+ <a style="text-decoration:none" href=https://sonarcloud.io/summary/new_code?id=davidusb-geek_emhass">
35
+ <img alt="SonarQube security rating" src="https://sonarcloud.io/api/project_badges/measure?project=davidusb-geek_emhass&metric=security_rating">
36
+ </a>
37
+ <a style="text-decoration:none" href=https://sonarcloud.io/summary/new_code?id=davidusb-geek_emhass">
38
+ <img alt="SonarQube security Vulnerabilities" src="https://sonarcloud.io/api/project_badges/measure?project=davidusb-geek_emhass&metric=vulnerabilities">
39
+ </a>
40
+ <a style="text-decoration:none" href=https://sonarcloud.io/summary/new_code?id=davidusb-geek_emhass">
41
+ <img alt="SonarQube reliability" src="https://sonarcloud.io/api/project_badges/measure?project=davidusb-geek_emhass&metric=reliability_rating">
42
+ </a>
43
+ <a style="text-decoration:none" href=https://sonarcloud.io/summary/new_code?id=davidusb-geek_emhass">
44
+ <img alt="SonarQube bugs" src="https://sonarcloud.io/api/project_badges/measure?project=davidusb-geek_emhass&metric=bugs">
45
+ </a>
46
+
31
47
  </p>
32
48
 
33
49
  <div align="center">
@@ -592,7 +608,7 @@ curl -i -H 'Content-Type:application/json' -X POST -d '{"pv_power_forecast":[0,
592
608
  ```
593
609
  *Example with :`operating_hours_of_each_deferrable_load`, `start_timesteps_of_each_deferrable_load`, `end_timesteps_of_each_deferrable_load`.*
594
610
  ```bash
595
- curl -i -H 'Content-Type:application/json' -X POST -d '{"pv_power_forecast":[0, 70, 141.22, 246.18, 513.5, 753.27, 1049.89, 1797.93, 1697.3, 3078.93], "prediction_horizon":10, "soc_init":0.5,"soc_final":0.6,'operating_hours_of_each_deferrable_load':[1,3],'start_timesteps_of_each_deferrable_load':[0,3],'end_timesteps_of_each_deferrable_load':[0,6]}' http://localhost:5000/action/naive-mpc-optim
611
+ curl -i -H 'Content-Type:application/json' -X POST -d '{"pv_power_forecast":[0, 70, 141.22, 246.18, 513.5, 753.27, 1049.89, 1797.93, 1697.3, 3078.93], "prediction_horizon":10, "soc_init":0.5,"soc_final":0.6,"operating_hours_of_each_deferrable_load":[1,3],"start_timesteps_of_each_deferrable_load":[0,3],"end_timesteps_of_each_deferrable_load":[0,6]}' http://localhost:5000/action/naive-mpc-optim
596
612
  ```
597
613
 
598
614
  ## A machine learning forecaster
@@ -0,0 +1,84 @@
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.5"
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.11",
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
@@ -1,49 +0,0 @@
1
- // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2
- // README at: https://github.com/devcontainers/templates/tree/main/src/python
3
- {
4
- "name": "EMHASS",
5
- "build": {
6
- "dockerfile": "../Dockerfile",
7
- "context": "../",
8
- "args": { "TARGETARCH": "amd64"}
9
- },
10
- "features": {
11
- "ghcr.io/devcontainers/features/common-utils:2": {
12
- "installBash": "true",
13
- "configureBashAsDefaultShell": "true"
14
- }
15
- // "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
16
- },
17
- //"appPort": ["5000:5000"] //used to access app from external device (User discretion advised)
18
-
19
-
20
- // Security issue, may be needed for Podman
21
- // "runArgs": [
22
- // "--userns=keep-id",
23
- // "--pid=host"
24
- // ],
25
- // "remoteUser": "root",
26
- // "containerUser": "root",
27
-
28
-
29
- "customizations": {
30
- // Configure properties specific to VS Code.
31
- "vscode": {
32
- // Add the IDs of extensions you want installed when the container is created.
33
- "extensions": ["ms-python.debugpy", "ms-python.python","charliermarsh.ruff"],
34
- "settings": {
35
- "[python]": {
36
- "editor.formatOnSave": true,
37
- "editor.codeActionsOnSave": {
38
- "source.fixAll": "explicit",
39
- "source.organizeImports": "explicit"
40
- },
41
- "editor.defaultFormatter": "charliermarsh.ruff"
42
- }
43
- }
44
- }
45
- },
46
-
47
- "postCreateCommand": [ "uv", "pip", "install", "--cache-dir", ".cache", "--verbose", ".[test]" ]
48
-
49
- }
@@ -1,35 +0,0 @@
1
- ---
2
- name: Bug report
3
- about: Create a report to help us improve
4
- title: ''
5
- labels: ''
6
- assignees: ''
7
-
8
- ---
9
-
10
- **Describe the bug**
11
- A clear and concise description of what the bug is.
12
-
13
- **To Reproduce**
14
- Steps to reproduce the behavior
15
-
16
- **Expected behavior**
17
- A clear and concise description of what you expected to happen.
18
-
19
- **Screenshots**
20
- If applicable, add screenshots to help explain your problem.
21
-
22
- **Home Assistant installation type**
23
- - Home Assistant OS
24
- - Home Assistant Supervised
25
- - Home Assistant Core
26
-
27
- **Your hardware**
28
- - OS: HA OS, Windows, Linux, etc
29
- - Architecture: amd64, armhf, armv7, aarch64
30
-
31
- **EMHASS installation type**
32
- - Add-on, Docker Standalone, Legacy Python virtual environment
33
-
34
- **Additional context**
35
- Add any other context about the problem here.
@@ -1,17 +0,0 @@
1
- # To get started with Dependabot version updates, you'll need to specify which
2
- # package ecosystems to update and where the package manifests are located.
3
- # Please see the documentation for all configuration options:
4
- # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
-
6
- version: 2
7
- updates:
8
- - package-ecosystem: "pip"
9
- directory: "/"
10
- schedule:
11
- interval: "weekly"
12
-
13
- # Enable version updates for Docker
14
- - package-ecosystem: "docker"
15
- directory: "/"
16
- schedule:
17
- interval: "weekly"
@@ -1,38 +0,0 @@
1
- name: CodeCov
2
-
3
- on:
4
- push:
5
- branches: [ master ]
6
- pull_request:
7
- branches: [ master ]
8
- jobs:
9
- run:
10
- runs-on: ${{ matrix.os }}
11
- strategy:
12
- matrix:
13
- os: [ubuntu-latest]
14
- env:
15
- OS: ${{ matrix.os }}
16
- PYTHON: '3.11'
17
- steps:
18
- - uses: actions/checkout@master
19
- - name: Install uv
20
- uses: astral-sh/setup-uv@v5
21
- - name: Set up Python
22
- uses: actions/setup-python@v5
23
- with:
24
- python-version-file: ".python-version"
25
- - name: Generate Report
26
- run: |
27
- uv venv
28
- uv pip install .[test]
29
- coverage run -m --source=emhass unittest
30
- coverage report
31
- coverage xml
32
- - name: Upload coverage reports to Codecov
33
- run: |
34
- # Replace `linux` below with the appropriate OS
35
- # Options are `alpine`, `linux`, `macos`, `windows`
36
- curl -Os https://uploader.codecov.io/latest/linux/codecov
37
- chmod +x codecov
38
- ./codecov -t ${CODECOV_TOKEN}
@@ -1,55 +0,0 @@
1
- # For most projects, this workflow file will not need changing; you simply need
2
- # to commit it to your repository.
3
- #
4
- # You may wish to alter this file to override the set of languages analyzed,
5
- # or to provide custom queries or build logic.
6
- #
7
- # ******** NOTE ********
8
- # We have attempted to detect the languages in your repository. Please check
9
- # the `language` matrix defined below to confirm you have the correct set of
10
- # supported CodeQL languages.
11
- #
12
- name: "CodeQL"
13
-
14
- on:
15
- pull_request:
16
- branches: [ "master" ]
17
- schedule:
18
- - cron: '22 3 * * 2'
19
-
20
- jobs:
21
- analyze:
22
- name: Analyze
23
- runs-on: ubuntu-latest
24
- permissions:
25
- actions: read
26
- contents: read
27
- security-events: write
28
-
29
- strategy:
30
- fail-fast: false
31
- matrix:
32
- language: [ 'python' , 'javascript' ]
33
- # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
34
- # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
35
-
36
- steps:
37
- - name: Checkout repository
38
- uses: actions/checkout@v3
39
-
40
- # Initializes the CodeQL tools for scanning.
41
- - name: Initialize CodeQL
42
- uses: github/codeql-action/init@v2
43
- with:
44
- languages: ${{ matrix.language }}
45
- # If you wish to specify custom queries, you can do so here or in a config file.
46
- # By default, queries listed here will override any specified in a config file.
47
- # Prefix the list here with "+" to use these queries and those in the config file.
48
-
49
- # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
50
- # queries: security-extended,security-and-quality
51
-
52
- - name: Perform CodeQL Analysis
53
- uses: github/codeql-action/analyze@v2
54
- with:
55
- category: "/language:${{matrix.language}}"
@@ -1,87 +0,0 @@
1
- #This action test builds EMHASS Docker images, in each architecture.
2
- name: "Test Building Docker Image"
3
-
4
- on:
5
- push:
6
- branches: [master]
7
- pull_request:
8
- branches: [master]
9
- workflow_dispatch:
10
-
11
- permissions:
12
- actions: read
13
- security-events: write
14
- contents: read
15
-
16
- jobs:
17
- build:
18
- runs-on: ubuntu-latest
19
- strategy:
20
- fail-fast: false
21
- matrix:
22
- platform:
23
- [
24
- { target_arch: amd64, os_version: debian },
25
- { target_arch: armv7, os_version: debian },
26
- { target_arch: armhf, os_version: raspbian },
27
- { target_arch: aarch64, os_version: debian },
28
- ]
29
- steps:
30
- - name: Checkout the repository
31
- uses: actions/checkout@v4
32
- - name: Set up QEMU
33
- uses: docker/setup-qemu-action@v3
34
- - name: Set up Docker Buildx
35
- uses: docker/setup-buildx-action@v3
36
- - name: Build and push by digest
37
- id: build
38
- uses: docker/build-push-action@v5
39
- with:
40
- context: .
41
- platforms: ${{ matrix.platform.buildx }}
42
- build-args: |
43
- TARGETARCH=${{ matrix.platform.target_arch }}
44
- os_version=${{ matrix.platform.os_version }}
45
- load: true
46
- - name: Test Image #Assume Docker fail with FileNotFound secrets_emhass.yaml error
47
- run: docker run --rm -it ${{ steps.build.outputs.imageid }} | grep -q secrets_emhass.yaml && echo 0 || echo 1
48
- # Google OSV-Scanner
49
- # Extract Debian and Python packadge list stored in Image
50
- - name: Export Debian package list
51
- run: mkdir OSV && docker run --rm --entrypoint '/bin/cat' ${{ steps.build.outputs.imageid }} /var/lib/dpkg/status >> ./OSV/${{ matrix.platform.target_arch }}.status
52
- - name: Export Python package list
53
- run: docker run --rm --entrypoint '/bin/cat' ${{ steps.build.outputs.imageid }} uv.lock >> ./OSV/${{ matrix.platform.target_arch }}.lock
54
- - name: Upload package list as digest
55
- uses: actions/upload-artifact@v4
56
- with:
57
- name: ${{ matrix.platform.target_arch }}-packages
58
- path: ./OSV/*
59
- if-no-files-found: error
60
- retention-days: 1
61
-
62
- osv-scan:
63
- needs:
64
- - build
65
- strategy:
66
- fail-fast: false
67
- matrix:
68
- platform:
69
- [
70
- { target_arch: amd64 },
71
- { target_arch: armv7 },
72
- { target_arch: armhf },
73
- { target_arch: aarch64 }
74
- ]
75
- # Check Docker image debian and python packages list for known vulnerabilities
76
- uses: "geoderp/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@v0.0.1"
77
- with:
78
- download-artifact: "${{ matrix.platform.target_arch }}-packages"
79
- matrix-property: "${{ matrix.platform.target_arch }}-"
80
- fail-on-vuln: false
81
- scan-args: |-
82
- --lockfile=dpkg-status:./${{ matrix.platform.target_arch }}.status
83
- --lockfile=poetry.lock:./${{matrix.platform.target_arch }}.lock
84
- permissions:
85
- security-events: write
86
- contents: read
87
- actions: read