Skip to content

Commit

Permalink
Merge pull request #333 from Moohan/master
Browse files Browse the repository at this point in the history
Fix typos, and improve spelling and grammar throughout the docs
  • Loading branch information
davidusb-geek committed Jul 31, 2024
2 parents eaeb807 + e246a87 commit 24ab7b5
Show file tree
Hide file tree
Showing 11 changed files with 227 additions and 227 deletions.
114 changes: 57 additions & 57 deletions README.md

Large diffs are not rendered by default.

50 changes: 25 additions & 25 deletions docs/config.md

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docs/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ The recommended steps to run are:
### Method 3 - Docker Virtual Environment
With Docker, you can test EMHASS in both standalone and add-on mode via modifying the build argument: `build_version` with values: `standalone`, `addon-pip`, `addon-git`, `addon-local`.
Since emhass-add-on is using the same docker base, this method is good to test the add-on functionality of your code. _(addon-local)_
Since emhass-add-on uses the same docker base, this method is good to test the add-on functionality of your code. _(addon-local)_
Depending on your choice of running standalone or addon, `docker run` will require different passed variables/arguments to function. See following examples:
Depending on your choice of running standalone or addon, `docker run` will require different passed variables/arguments to function. See the following examples:
_Note: Make sure your terminal is in the root `emhass` directory before running the docker build._
Expand Down Expand Up @@ -193,7 +193,7 @@ docker build -t emhass/docker --build-arg build_version=addon-pip .
docker run -it -p 5000:5000 --name emhass-container -e LAT="45.83" -e LON="6.86" -e ALT="4807.8" -e TIME_ZONE="Europe/Paris" -v $(pwd)/options.json:/app/options.json emhass/docker --url YOURHAURLHERE --key YOURHAKEYHERE
```
To build with specific pip version, set with build arg: `build_pip_version`:
To build with a specific pip version, set with build arg: `build_pip_version`:
```bash
docker build -t emhass/docker --build-arg build_version=addon-pip --build-arg build_pip_version='==0.7.7' .
Expand Down Expand Up @@ -227,7 +227,7 @@ docker run... -v $(pwd)/data/heating_prediction.csv:/app/data/ ...
```
#### Issue with TARGETARCH
If your docker build fails with an error related to `TARGETARCH`. It may be best to add your devices architecture manually:
If your docker build fails with an error related to `TARGETARCH`. It may be best to add your device's architecture manually:

Example with armhf architecture
```bash
Expand Down Expand Up @@ -257,7 +257,7 @@ _Linux:_
docker build -t emhass/docker --build-arg build_version=addon-local . && docker run --rm -it -p 5000:5000 -v $(pwd)/secrets_emhass.yaml:/app/secrets_emhass.yaml --name emhass-container emhass/docker
```

_The example command chain rebuilds Docker image, and runs new container with newly built image. `--rm` has been added to the `docker run` to delete the container once ended to avoid manual deletion every time._
_The example command chain rebuilds the Docker image and runs a new container with the newly built image. `--rm` has been added to the `docker run` to delete the container once ended to avoid manual deletion every time._
_This use case may not require any volume mounts (unless you use secrets_emhass.yaml) as the Docker build process will pull the latest versions of the configs as it builds._


Expand All @@ -270,7 +270,7 @@ docker build -t emhass/docker --build-arg build_version=addon-local .
docker run -it -p 5000:5000 --name emhass-container -e URL="YOURHAURLHERE" -e KEY="YOURHAKEYHERE" -e LAT="45.83" -e LON="6.86" -e ALT="4807.8" -e TIME_ZONE="Europe/Paris" emhass/docker
```

This allows the user to set variables prior to build
This allows the user to set variables before the build
Linux:

```bash
Expand Down Expand Up @@ -356,4 +356,4 @@ User may wish to re-test with tweaked parameters such as `lp_solver`, `weather_f
## Step 3 - Pull request

Once developed, commit your code, and push to your fork.
Then submit a pull request with your fork to the [davidusb-geek/emhass@master](https://github.com/davidusb-geek/emhass) repository.
Then submit a pull request with your fork to the [davidusb-geek/emhass@master](https://github.com/davidusb-geek/emhass) repository.
16 changes: 8 additions & 8 deletions docs/differences.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# EMHASS & EMHASS-Add-on differences
User will pass parameters into EMHASS differently, based on running *Standalone* mode or *addon* Mode.
Users will pass parameters into EMHASS differently, based on running *Standalone* mode or *addon* Mode.
This page tries to help to resolve the common confusion between the two.
_Its best to see EMHASS-Add-on as a Home Assistant Docker wrapper for EMHASS. However, because of this containerization, certain changes are made between the two modes._
_It's best to see EMHASS-Add-on as a Home Assistant Docker wrapper for EMHASS. However, because of this containerization, certain changes are made between the two modes._

## Configuration & parameter differences
Both EMHASS & EMHASS-Add-on utilize `config_emhass.yaml` for receiving parameters.
Where they diverge is EMHASS-Add-ons additional use of `options.json`, generated by Home Assistants `Configuration Page`.
Any passed parameters given in `options.json` will overwrite the parameters hidden in the `config_emhass.yaml` file in EMHASS. _(this results in `config_emhass.yaml` used for parameter default fall back if certain required parameters were missing in `options.json`)_
Any passed parameters given in `options.json` will overwrite the parameters hidden in the `config_emhass.yaml` file in EMHASS. _(this results in `config_emhass.yaml` used for parameter default fallback if certain required parameters were missing in `options.json`)_

The parameters naming convention has also been changed in `options.json`, designed to make it easier for the user to understand.

See bellow for a list of associations between the parameters from `config_emhass.yaml` and `options.json`:
See below for a list of associations between the parameters from `config_emhass.yaml` and `options.json`:
*You can view the current parameter differences in the [`Utils.py`](https://github.com/davidusb-geek/emhass/blob/master/src/emhass/utils.py) file under the `build_params` function.*

| config | config_emhass.yaml | options.json | options.json list dictionary key |
Expand Down Expand Up @@ -73,7 +73,7 @@ See bellow for a list of associations between the parameters from `config_emhass
| plant_conf | SOCmax | battery_maximum_state_of_charge | |
| plant_conf | SOCtarget | battery_target_state_of_charge | |

Descriptions of each parameter, can be found at:
Descriptions of each parameter can be found at:
- [`Configuration file`](https://emhass.readthedocs.io/en/latest/config.html) on EMHASS
- [`en.yaml`](https://github.com/davidusb-geek/emhass-add-on/blob/main/emhass/translations/en.yaml) on EMHASS-Add-on

Expand All @@ -87,14 +87,14 @@ Running EMHASS in standalone mode's default workflow retrieves all secret parame
For users who are running EMHASS with methods other than EMHASS-Add-on, secret parameters can be passed with the use of arguments and/or environment variables. _(instead of `secrets_emhass.yaml`)_

Some arguments include: `--url` and `--key`
Some environment variables include: `TIME_ZONE`, `LAT` , `LON`, `ALT`, `EMHASS_URL`, `EMHASS_KEY`
Some environment variables include: `TIME_ZONE`, `LAT`, `LON`, `ALT`, `EMHASS_URL`, `EMHASS_KEY`

_Note: As of writing, EMHASS standalone will override ARG/ENV secret parameters if file is present._
_Note: As of writing, EMHASS standalone will override ARG/ENV secret parameters if the file is present._

For more information on passing arguments and environment variables using docker, have a look at some examples from [Configuration and Installation](https://emhass.readthedocs.io/en/latest/intro.html#configuration-and-installation) and [EMHASS Development](https://emhass.readthedocs.io/en/latest/develop.html) pages.

### EMHASS-Add-on (addon mode)
By default the `URL` and `KEY` parameters have been set to `empty`/blank. This results in EMHASS calling to its Supervisor API to gain access locally. This is the easiest method, as there is no user input necessary.
By default, the `URL` and `KEY` parameters have been set to `empty`/blank. This results in EMHASS calling its Supervisor API to gain access locally. This is the easiest method, as there is no user input necessary.

However, if you wish to receive/send sensor data to a different Home Assistant environment, set url and key values in the `hass_url` & `long_lived_token` hidden parameters.
- `hass_url` example: `https://192.168.1.2:8123/`
Expand Down
Loading

0 comments on commit 24ab7b5

Please sign in to comment.