Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoDerp committed May 12, 2024
2 parents e138e3a + 44127ad commit 682a1d7
Show file tree
Hide file tree
Showing 44 changed files with 3,016 additions and 975 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM mcr.microsoft.com/devcontainers/python:0-3.11
# EXPOSE 5000:5000
COPY .devcontainer/setup.sh requirements.txt ./
COPY .devcontainer/setup.sh ./
COPY requirements.txt ./
RUN ./setup.sh
11 changes: 9 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@
},
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
}
},
//"appPort": ["5000:5000"] //used to access app from external device (User discretion advised)


"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": ["ms-python.debugpy", "ms-python.python"]
}
}


// Features to add to the dev container. More info: https://containers.dev/features.
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ secrets_emhass.yaml
.vscode/launch.json
.vscode/settings.json
.vscode/tasks.json
*.csv
*.html
*.pkl
data/actionLogs.txt
**/app


# Byte-compiled / optimized / DLL files
Expand Down
20 changes: 13 additions & 7 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
"request": "launch",
"module": "emhass.web_server",
"console": "integratedTerminal",
"purpose":["debug-in-terminal"],
"purpose": [
"debug-in-terminal"
],
"justMyCode": true,
"env": {
"CONFIG_PATH": "/workspaces/emhass/config_emhass.yaml",
"OPTIONS_PATH": "/workspaces/emhass/options.json",
"SECRETS_PATH": "/workspaces/emhass/secrets_emhass.yaml",
"DATA_PATH": "/workspaces/emhass/data/",
"LOGGING_LEVEL": "DEBUG"
}
},
{
Expand All @@ -30,8 +31,15 @@
"request": "launch",
"module": "emhass.web_server",
"console": "integratedTerminal",
"args": ["--addon", "true", "--no_response", "true"],
"purpose":["debug-in-terminal"],
"args": [
"--addon",
"true",
"--no_response",
"true"
],
"purpose": [
"debug-in-terminal"
],
"justMyCode": true,
"env": {
"CONFIG_PATH": "/workspaces/emhass/config_emhass.yaml",
Expand All @@ -44,9 +52,7 @@
"LAT": "45.83", //optional change
"LON": "6.86", //optional change
"ALT": "4807.8", //optional change
"LOGGING_LEVEL": "DEBUG" //optional change
},

}
}
]
}
22 changes: 21 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,27 @@
"isDefault": true
},
"args": [
"install", "--no-deps", "--force-reinstall", "."
"install",
"--no-deps",
"--force-reinstall",
"--editable",
"."
],
"presentation": {
"echo": true,
"panel": "shared",
"focus": true
}
},
{
"label": "EMHASS install with dependencies",
"command": "pip3",
"group": {
"kind": "build",
"isDefault": true
},
"args": [
"install", "--force-reinstall", "."
],
"presentation": {
"echo": true,
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.9.0 - 2024-05-10
### Improvement
- On this new version we now have a new method to train a regression model using Scikit-Learn methods. This is the contribution of @gieljnssns. Check the dedicated section the documentation to this new feature: [https://emhass.readthedocs.io/en/latest/mlregressor.html](https://emhass.readthedocs.io/en/latest/mlregressor.html)
- Again another bunch of nice improvements by @GeoDerp:
- Added Dictionary var containing EMHASS paths
- MLForcaster error suppression
- Add `freq` as runtime parameter
- Improved documentation added README buttons
- Bumping dependencies:
- Bump h5py from 3.10.0 to 3.11.0
- Bump myst-parser from 2.0.0 to 3.0.1
- Bump skforecast from 0.11.0 to 0.12.0

## 0.8.6 - 2024-04-07
### Fix
- Fixed bug from forecast out method related to issue 240
Expand Down
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@
<img alt="Read the Docs" src="https://img.shields.io/readthedocs/emhass">
</a>
</p>
<div align="center">
<a href="https://emhass.readthedocs.io/en/latest/">
<img src="https://raw.githubusercontent.com/davidusb-geek/emhass/master/docs/images/Documentation_button.svg" alt="Documentation">
</a>
<a href="https://community.home-assistant.io/t/emhass-an-energy-management-for-home-assistant/338126">
<img src="https://raw.githubusercontent.com/davidusb-geek/emhass/master/docs/images/Community_button.svg" alt="Community">
</a>
<a href="https://github.com/davidusb-geek/emhass/issues">
<img src="https://raw.githubusercontent.com/davidusb-geek/emhass/master/docs/images/Issues_button.svg" alt="Issues">
</a>
<a href="https://github.com/davidusb-geek/emhass-add-on">
<img src="https://raw.githubusercontent.com/davidusb-geek/emhass/master/docs/images/EMHASS_Add_on_button.svg" alt="EMHASS Add-on">
</a>
</div>
<br>
<p align="center">
If you like this work please consider buying a coffee ;-)
Expand Down Expand Up @@ -72,7 +86,7 @@ You must follow these steps to make EMHASS work properly:

1) Define all the parameters in the configuration file according to your installation. See the description for each parameter in the **configuration** section.

2) You most notably will need to define the main data entering EMHASS. This will be the `sensor_power_photovoltaics` for the name of the your hass variable containing the PV produced power and the 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.
2) You most notably will need to define the main data entering EMHASS. This will be the `sensor.power_photovoltaics` for the name of the your hass variable containing the PV produced power and the 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.

3) Launch the actual optimization and check the results. This can be done manually using the buttons in the web ui or with a `curl` command like this: `curl -i -H 'Content-Type:application/json' -X POST -d '{}' http://localhost:5000/action/dayahead-optim`.

Expand Down Expand Up @@ -335,7 +349,7 @@ In EMHASS we have basically 4 forecasts to deal with:
- PV production selling price forecast: at what price are you selling your excess PV production on the next 24h. This is given in EUR/kWh.
The sensor containing the load data should be specified in parameter `var_load` in the configuration file. As we want to optimize the household energies, when need to forecast the load power conumption. The default method for this is a naive approach using 1-day persistence. The load data variable should not contain the data from the deferrable loads themselves. For example, lets say that you set your deferrable load to be the washing machine. The variable that you should enter in EMHASS will be: `var_load: 'sensor.power_load_no_var_loads'` and `sensor_power_load_no_var_loads = sensor_power_load - sensor_power_washing_machine`. This is supposing that the overall load of your house is contained in variable: `sensor_power_load`. The sensor `sensor_power_load_no_var_loads` can be easily created with a new template sensor in Home Assistant.
The sensor containing the load data should be specified in parameter `var_load` in the configuration file. As we want to optimize the household energies, when need to forecast the load power conumption. The default method for this is a naive approach using 1-day persistence. The load data variable should not contain the data from the deferrable loads themselves. For example, lets say that you set your deferrable load to be the washing machine. The variable that you should enter in EMHASS will be: `var_load: 'sensor.power_load_no_var_loads'` and `sensor.power_load_no_var_loads = sensor.power_load - sensor.power_washing_machine`. This is supposing that the overall load of your house is contained in variable: `sensor.power_load`. The sensor `sensor.power_load_no_var_loads` can be easily created with a new template sensor in Home Assistant.
If you are implementing a MPC controller, then you should also need to provide some data at the optimization runtime using the key `runtimeparams`.
Expand Down
130 changes: 130 additions & 0 deletions data/heating_prediction.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
timestamp,degreeday,solar,hour
2023-11-10 23:59:32.458039+01:00,12.23,3.982,2.87
2023-11-11 23:59:32.459778+01:00,12.94,13.723,3.14
2023-11-12 23:59:32.462220+01:00,14.45,4.925,3.5
2023-11-13 23:59:32.462167+01:00,8.49,2.138,3.19
2023-11-14 23:59:32.338942+01:00,8.61,2.444,2.91
2023-11-15 23:59:32.195198+01:00,9.83,10.685,2.88
2023-11-16 23:59:32.501044+01:00,12.8,1.955,1.28
2023-11-17 23:59:32.316366+01:00,13.35,8.742,2.97
2023-11-18 23:59:32.082785+01:00,11.84,0.849,3.42
2023-11-19 23:59:32.077198+01:00,7.3,10.85,1.9
2023-11-20 23:59:32.431964+01:00,9.91,6.395,2.48
2023-11-21 23:59:32.295705+01:00,11.44,2.678,2.91
2023-11-22 23:59:32.377740+01:00,16.14,2.994,2.96
2023-11-23 23:59:32.385890+01:00,9.31,5.346,2.91
2023-11-24 23:59:32.376194+01:00,12.96,8.61,2.9
2023-11-25 23:59:32.373666+01:00,14.91,12.31,3.47
2023-11-26 23:59:32.373647+01:00,14.79,2.589,3.69
2023-11-27 23:59:32.379920+01:00,14.92,0.322,6.05
2023-11-28 23:59:32.213947+01:00,18.59,20.342,2.94
2023-11-29 23:59:32.217384+01:00,19.05,5.393,5.41
2023-11-30 23:59:32.222641+01:00,21.27,1.899,6.77
2023-12-01 23:59:32.224533+01:00,21.3,1.233,5.75
2023-12-02 23:59:32.107119+01:00,21.97,14.653,2.96
2023-12-03 23:59:32.107436+01:00,20.61,4.766,8.89
2023-12-04 23:59:32.116642+01:00,18.36,1.349,6.73
2023-12-05 23:59:32.191254+01:00,16.93,0.869,6.17
2023-12-06 23:59:32.176803+01:00,16.8,5.413,5.38
2023-12-07 23:59:32.251031+01:00,17.67,8.089,5.98
2023-12-08 23:59:32.255888+01:00,14.37,1.203,5.63
2023-12-09 23:59:32.109040+01:00,11.94,0.814,5.08
2023-12-10 23:59:32.103738+01:00,9.72,6.051,3.42
2023-12-11 23:59:32.497717+01:00,9.83,1.459,3.87
2023-12-12 23:59:32.502503+01:00,11.18,4.176,3.31
2023-12-13 23:59:32.504794+01:00,11.09,2.91,3.1
2023-12-14 23:59:32.177489+01:00,13.88,7.53,2.89
2023-12-15 23:59:32.186292+01:00,12.18,2.129,5.68
2023-12-16 23:59:32.176812+01:00,11.75,1.641,3.46
2023-12-17 23:59:32.119874+01:00,12.18,14.868,3.46
2023-12-18 23:59:32.120168+01:00,14.75,1.283,3.12
2023-12-19 23:59:32.120101+01:00,12.82,0.09,5.07
2023-12-20 23:59:32.249731+01:00,12.8,3.803,3.6
2023-12-21 23:59:32.249135+01:00,8.73,2.096,3.55
2023-12-22 23:59:32.385164+01:00,9.12,1.278,0.85
2023-12-23 23:59:32.382910+01:00,8.99,1.848,0.0
2023-12-24 23:59:32.382457+01:00,8.04,0.165,7.42
2023-12-25 23:59:32.303520+01:00,7.56,1.028,2.93
2023-12-26 23:59:32.105788+01:00,10.55,9.274,2.92
2023-12-27 23:59:32.183107+01:00,11.78,2.026,3.39
2023-12-28 23:59:32.183405+01:00,8.91,3.68,3.19
2023-12-29 23:59:32.399740+01:00,9.35,2.464,2.95
2023-12-30 23:59:32.091110+01:00,11.07,7.948,3.44
2023-12-31 23:59:32.257530+01:00,10.51,3.5,3.48
2024-01-01 23:59:32.106161+01:00,12.75,4.046,3.08
2024-01-02 23:59:32.103187+01:00,8.81,0.562,4.46
2024-01-03 23:59:32.429947+01:00,10.03,2.184,3.26
2024-01-04 23:59:32.436773+01:00,11.22,5.662,2.97
2024-01-05 23:59:32.165969+01:00,12.42,1.199,3.6
2024-01-06 23:59:32.110208+01:00,15.35,0.295,4.32
2024-01-07 23:59:32.147775+01:00,19.88,0.896,6.19
2024-01-08 23:59:32.242815+01:00,22.74,6.468,5.82
2024-01-09 23:59:32.201342+01:00,24.38,21.307,6.92
2024-01-10 23:59:32.411136+01:00,24.84,18.89,1.53
2024-01-11 23:59:32.399433+01:00,23.57,19.27,3.05
2024-01-12 23:59:32.467622+01:00,18.22,1.977,13.98
2024-01-13 23:59:32.077428+01:00,17.9,0.472,6.93
2024-01-14 23:59:32.127844+01:00,19.65,1.346,6.95
2024-01-15 23:59:32.125062+01:00,19.49,4.35,7.82
2024-01-16 23:59:32.280474+01:00,21.21,9.238,5.7
2024-01-17 23:59:32.283951+01:00,23.17,1.193,7.37
2024-01-18 23:59:32.361241+01:00,21.61,17.307,6.67
2024-01-19 23:59:32.341654+01:00,22.06,21.004,6.24
2024-01-20 23:59:32.359151+01:00,21.95,12.912,6.43
2024-01-21 23:59:32.126221+01:00,17.38,3.28,7.45
2024-01-22 23:59:32.126346+01:00,9.47,7.645,6.1
2024-01-23 23:59:32.417727+01:00,11.87,7.689,4.76
2024-01-24 23:59:32.420933+01:00,8.15,10.052,3.62
2024-01-25 23:59:32.419138+01:00,12.38,3.785,3.98
2024-01-26 23:59:32.422066+01:00,11.4,11.94,3.1
2024-01-27 23:59:32.176538+01:00,17.96,19.741,3.45
2024-01-28 23:59:32.168328+01:00,16.72,20.366,4.85
2024-01-29 23:59:32.173916+01:00,13.11,16.972,4.51
2024-01-30 23:59:32.503034+01:00,11.21,4.013,3.99
2024-01-31 23:59:32.179265+01:00,12.79,4.766,3.73
2024-02-01 23:59:32.487147+01:00,12.74,23.924,2.98
2024-02-02 23:59:32.570084+01:00,13.0,2.98,5.04
2024-02-03 23:59:32.484878+01:00,9.26,1.413,3.48
2024-02-04 23:59:32.472168+01:00,8.35,4.306,3.47
2024-02-05 23:59:32.409856+01:00,9.78,5.704,0.0
2024-02-06 23:59:32.439147+01:00,9.15,2.431,6.56
2024-02-07 23:59:32.235231+01:00,14.42,3.839,3.07
2024-02-08 23:59:32.441543+01:00,13.9,1.412,5.94
2024-02-09 23:59:32.443230+01:00,8.2,7.246,2.96
2024-02-10 23:59:32.504326+01:00,8.37,8.567,3.48
2024-02-11 23:59:32.452959+01:00,10.44,5.304,0.0
2024-02-12 23:59:32.450999+01:00,12.65,16.004,3.42
2024-02-13 23:59:32.343162+01:00,13.84,19.809,3.16
2024-02-14 23:59:32.339408+01:00,8.48,1.98,4.52
2024-02-15 23:59:32.339971+01:00,6.13,9.952,2.98
2024-02-16 23:59:32.455273+01:00,7.66,3.675,3.06
2024-02-17 23:59:32.097937+01:00,8.56,12.269,3.48
2024-02-18 23:59:32.126377+01:00,9.59,2.205,3.04
2024-02-19 23:59:32.421243+01:00,10.22,3.731,2.97
2024-02-20 23:59:32.421985+01:00,11.61,13.775,0.0
2024-02-21 23:59:32.371300+01:00,10.52,4.856,3.02
2024-02-22 23:59:32.373153+01:00,9.53,4.256,3.48
2024-02-23 23:59:32.372545+01:00,13.66,8.743,4.09
2024-02-24 23:59:32.197044+01:00,14.44,7.842,4.3
2024-02-25 23:59:32.196386+01:00,12.41,16.235,3.48
2024-02-26 23:59:32.409648+01:00,14.63,2.096,5.05
2024-02-27 23:59:32.373347+01:00,14.5,29.437,3.21
2024-02-28 23:59:32.407538+01:00,15.38,6.475,4.88
2024-02-29 23:59:32.194724+01:00,11.83,3.238,4.68
2024-03-01 23:59:32.084520+01:00,10.56,14.352,3.8
2024-03-02 23:59:32.066434+01:00,9.94,25.356,3.49
2024-03-03 23:59:32.270878+01:00,8.9,10.577,3.19
2024-03-04 23:59:32.274918+01:00,10.67,28.096,2.08
2024-03-05 23:59:32.315023+01:00,12.19,10.553,2.95
2024-03-06 23:59:32.441001+01:00,11.38,32.597,2.91
2024-03-07 23:59:32.440044+01:00,12.39,28.856,2.96
2024-03-08 23:59:32.228265+01:00,12.01,37.395,2.96
2024-03-09 23:59:32.081874+01:00,8.72,17.66,3.5
2024-03-10 23:59:32.335321+01:00,8.0,12.207,3.47
2024-03-11 23:59:32.139531+01:00,10.39,2.526,2.96
2024-03-12 23:59:32.136709+01:00,10.24,8.211,2.98
2024-03-13 23:59:32.407174+01:00,7.19,6.425,2.95
2024-03-14 23:59:32.342436+01:00,6.06,33.389,1.64
2024-03-15 23:59:32.266278+01:00,5.63,12.628,2.96
2024-03-16 23:59:32.155245+01:00,9.57,12.103,3.0
2024-03-17 23:59:32.366155+01:00,8.43,14.302,0.25
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.8.6'
release = '0.9.0'

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

Expand Down
Loading

0 comments on commit 682a1d7

Please sign in to comment.