Skip to content

Commit

Permalink
Feat - Preparing a new release following revamping of emhass core module
Browse files Browse the repository at this point in the history
  • Loading branch information
davidusb-geek committed May 12, 2022
1 parent 8a43942 commit 4272bdb
Show file tree
Hide file tree
Showing 11 changed files with 120 additions and 863 deletions.
24 changes: 23 additions & 1 deletion emhass/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.0] - 2022-05-13
### Improvement
- New version of this add-on following revamping of emhass core module and release v0.3.0
- Moved the webserver to the core emhass module for easier development.
- Added Model Predictive Control optimization.

## [0.1.42] - 2022-05-05
### Fix
- Fixed issue on correct defferable load total energy computation, following emhass v0.2.14.
Expand Down Expand Up @@ -154,4 +160,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[0.1.24]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.24
[0.1.25]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.25
[0.1.26]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.26
[0.1.27]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.27
[0.1.27]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.27
[0.1.28]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.28
[0.1.29]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.29
[0.1.30]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.30
[0.1.31]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.31
[0.1.32]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.32
[0.1.33]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.33
[0.1.34]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.34
[0.1.35]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.35
[0.1.36]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.36
[0.1.37]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.37
[0.1.38]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.38
[0.1.39]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.39
[0.1.40]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.40
[0.1.41]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.41
[0.1.42]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.1.42
[0.2.0]: https://github.com/davidusb-geek/emhass-add-on/releases/tag/v0.2.0
28 changes: 28 additions & 0 deletions emhass/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,34 @@ The possible dictionnary keys to pass data are:

- `prod_price_forecast` for the PV production selling price forecast.

### A naive Model Predictive Controller

A MPC controller was introduced in v0.3.0 of the core emhass moule. This an informal/naive representation of a MPC controller.

A MPC controller performs the following actions:

- Set the prediction horizon and receiding horizon parameters.
- Perform an optimization on the prediction horizon.
- Apply the first element of the obtained optimized control variables.
- Repeat at a relatively high frequency, ex: 5 min.

This is the receiding horizon principle.

When applyin this controller, the following `runtimeparams` should be defined:

- `prediction_horizon` for the MPC prediction horizon. Fix this at at least 5 times the optimization time step.

- `soc_init` for the initial value of the battery SOC for the current iteration of the MPC.

- `soc_final` for the final value of the battery SOC for the current iteration of the MPC.

- `def_total_hours` for the list of deferrable loads functioning hours. These values can decrease as the day advances to take into account receidding horizon daily energy objectives for each deferrable load.

A correct call for a MPC optimization should look like:

```
curl -i -H "Content-Type: application/json" -X POST -d '{"pv_power_forecast":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 141.22, 246.18, 513.5, 753.27, 1049.89, 1797.93, 1697.3, 3078.93, 1164.33, 1046.68, 1559.1, 2091.26, 1556.76, 1166.73, 1516.63, 1391.13, 1720.13, 820.75, 804.41, 251.63, 79.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "prediction_horizon":10, "soc_init":0.5,"soc_final":0.6,"def_total_hours":[1,3]}' http://localhost:5000/action/naive-mpc-optim
```

## Disclaimer

Expand Down
5 changes: 1 addition & 4 deletions emhass/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ RUN apt-get update \
WORKDIR /

# copy contents
COPY app_server.py /usr/src
COPY config_emhass.json /usr/src
COPY templates /usr/src/templates
COPY static /usr/src/static
COPY config_emhass.yaml /usr/src
COPY data /usr/src/data
COPY rootfs /

Expand Down
224 changes: 0 additions & 224 deletions emhass/app_server.py

This file was deleted.

2 changes: 1 addition & 1 deletion emhass/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: EMHASS
description: Energy Management for Home Assistant
url: https://github.com/davidusb-geek/emhass
version: 0.1.42
version: 0.2.0
slug: emhass
arch:
- aarch64
Expand Down
55 changes: 0 additions & 55 deletions emhass/config_emhass.json

This file was deleted.

Loading

0 comments on commit 4272bdb

Please sign in to comment.