# Everything Presence Standalone Docker: Zone Configurator [![Stars][stars-shield]][repo] [![Release][release-shield]][release] [![Discord][discord-shield]][discord] --- Use this installation method if your Home Assistant installation does **NOT** support [Add-ons][ha-addons], or you just want to run the Everything Presence Zone Configurator outside of your Home Assistant install. **[📚 Additional Zone Configurator Installation Documentation][epzc-install-docs]** ## Standalone Docker Image All of the deployment methods below use following the [`latest`][epzc-docker-latest] standalone image for non-Home Assistant OS installs: ```yaml everythingsmarthome/everything-presence-mmwave-configurator:latest ``` **NOTE:** The [`:addon`][epzc-ha-addon-tag] tag is the [Home Assistant Add-on](DOCS.md) base image and **requires** Supervisor to run. ### Zone Configurator Ports **_Resources:_** [Publishing & Exposing Ports in Docker][exposing-ports-docker] **App Port:** Port `42069` is exposed for the web interface. - **Port change (v2.0.11):** Existing Docker users can either update their port mapping to **`42069:42069`** or keep the old behavior by setting **`APP_PORT=3000`** and continuing to map **`3000:3000`**. **LAN Firmware Port:** Firmware updates are served over a local HTTP port for ESP devices. By default this uses port **`38080`**. - Home Assistant add-on: configure **`firmware_lan_port`** in the add-on **Configuration tab**. - Standalone Docker: set **`FIRMWARE_LAN_PORT`** and **map the same host port and docker port**. ## Deployment ### 1. Create a Long Lived Token In order for this software to communicate with your Home Assistant installation, you **MUST** create a Long Lived Token for this software to [authenticate][ha-auth-docs] with the [Home Assistant's API][ha-api-docs]. 1. Log into your Home Assistant instance and go to your **`User profile`** page by selecting on the **`circular icon`** at the very bottom of the sidebar. 1. At the **top** switch to the **`Security`** tab and scroll down to the **bottom** of the page to the **`Long-lived Access Tokens`** section. 1. Click on the **`Create Token`** button and give it a name (ex. Everything Presence Zone Configurator). 1. Copy the token generated and save it in a **secure place** (ex. password manager) if you plan on using this later. You will **NOT** be able to display this sting again. **If you lose this token, you will have to delete the old one and generate a fresh one.** ### 2. Create an `.env` File Settings for the standalone Docker are controlled via [**environment variables**][docker-compose-env-docs]. While it is not required, it is **recommended** you make an `.env` file in the root directory that you plan to run your commands. The `.env` file will allow you to more easily store your settings and not mistakenly commit your private information to this repository if you contribute. An `.env-example` file has been provided with sane defaults that you can copy and rename to `.env`. **Example `.env` file:** ```bash ################ ### OPTIONAL ### ################ # These environment variables are OPTIONAL for Docker Compose but mandatory for Portainer. APP_PORT="42069" FIRMWARE_LAN_PORT="38080" # These environment variables are OPTIONAL. VERIFY_SSL="False" ################ ### REQUIRED ### ################ # These environment variables are REQUIRED for ALL standalone deployment types. HA_BASE_URL="http://homeassistant.local:8123" HA_LONG_LIVED_TOKEN="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ``` | Parameter | Default | Required | Function |:----------------------|:----------------------------------|:---------:|:- | `APP_PORT` | `42069` | 🚫 | Port used to access web interface. | `FIRMWARE_LAN_PORT` | `38080` | 🚫 | Port ESP devices get served firmware updates. | `HA_BASE_URL` | `http://homeassistant.local:8123` | ✅ | URL to your Home Assistant Installation. | `HA_LONG_LIVED_TOKEN` | `N/A` | ✅ | Long Lived Web Token generated by Home Assistant. | `VERIFY_SSL` | `True` | 🚫 | Set to False if you are using a self-signed certificate. ### 3. Deploy Standalone Image After creating a [Long Lived Token](#1-create-a-long-lived-token) and understanding what each [environment variable](#2-create-an-env-file) does, you are ready to deploy the standalone Docker. Below are a few of the methods you can use to deploy the standalone Everything Presence Zone Configurator Docker. You can use the links below to jump to the instructions for whichever method suits you. - [**Deploy With Docker Compose**](#deploy-with-docker-compose) - [**Deploy With Portainer**](#deploy-with-portainer) - [**Deploy With Docker Run**](#deploy-with-docker-run) --- ### Deploy With Docker Compose **Resources** For more details on how to use Docker Compose, refer to the [official Docker Compose documentation][docker-compose-docs]. **Installation** 1. Go to the root directory of this project where the dockerfile is and run `docker compose up -d`. - **Note:** If you don't want to use a `.env` file just replace all sections that have a `${VARIABLE:-DEFAULT}` with your desired values. If you manually set the values then **make SURE the `38080:38080` section matches the `FIRMWARE_LAN_PORT` you set!** **For example if you set your `FIRMWARE_LAN_PORT` to `12345` then you must have a `- "12345:12345"` in the docker-compose.yaml** **Example `docker-compose.yaml` using `.env` file:** ```yaml services: zone-configurator: image: everythingsmarthome/everything-presence-mmwave-configurator:latest container_name: everything-presence-mmwave-configurator restart: unless-stopped ports: - "${APP_PORT:-42069}:42069" - "${FIRMWARE_LAN_PORT:-38080}:${FIRMWARE_LAN_PORT:-38080}" environment: HA_BASE_URL: "${HA_BASE_URL:-http://homeassistant.local:8123}" HA_LONG_LIVED_TOKEN: "${HA_LONG_LIVED_TOKEN}" FIRMWARE_LAN_PORT: "${FIRMWARE_LAN_PORT:-38080}" volumes: - ./config:/config ``` 1. If you don't want to store the config files in the root folder you can optionally mount a named volume by adding the following. ```yaml services: zone-configurator: # Everything from before... volumes: # Add the named volume here. - epzone-config:/config # Create a named volume. volumes: epzone-config: driver: local ``` --- ### Deploy With Portainer **Resources** For more details on how to use Portainer, refer to the [official Portainer documentation][portainer-docs]. **Instructions** 1. Log into your portainer instance. 1. Open the desired environment. 1. Create a new stack. 1. copy and paste the following into the editor. ```yaml services: zone-configurator: image: everythingsmarthome/everything-presence-mmwave-configurator:latest container_name: everything-presence-mmwave-configurator restart: unless-stopped ports: - "${APP_PORT:-42069}:42069" - "${FIRMWARE_LAN_PORT:-38080}:${FIRMWARE_LAN_PORT:-38080}" environment: HA_BASE_URL: "${HA_BASE_URL:-http://homeassistant.local:8123}" HA_LONG_LIVED_TOKEN: "${HA_LONG_LIVED_TOKEN}" FIRMWARE_LAN_PORT: "${FIRMWARE_LAN_PORT:-38080}" volumes: - epzone-config:/config volumes: epzone-config: driver: local ``` 1. Either import your `.env` or set each variable in the **Environment Variables** section. - **NOTE:** Unlike normal `docker compose`, you will have to specify **ALL** variables mentioned in the [**.env**](#2-create-an-env-file) section. Portainer currently does **NOT** understand defaults like `${VARIABLE:-DEFAULT}` so it will error out if you do not specify them. 1. Deploy the stack. --- ### Deploy With Docker Run **Resources** For more details on how to use `docker run`, refer to the [official Docker documentation][docker-run-docs]. **Instructions** 1. Navigate to the root directory. 1. Run one of the following commands. **For either command below, make sure your firmware lan port matches the port exposed!** **If you set your FIRMWARE_LAN_PORT to 12345 then you must have a `-p "12345:12345"` in the command!** - If you have created a `.env` then run the following command, otherwise skip to the next command in the list. ```bash docker run -d \ --name everything-presence-mmwave-configurator \ --restart unless-stopped \ --env-file .env \ -p 42069:42069 \ -p 38080:38080 \ -v "$(pwd)/config:/config" \ everythingsmarthome/everything-presence-mmwave-configurator:latest ``` - To use `docker run` without an `.env` file do the following. ```bash docker run -d \ --name everything-presence-mmwave-configurator \ --restart unless-stopped \ -p 42069:42069 \ -p 38080:38080 \ -e HA_BASE_URL="http://homeassistant.local:8123" \ -e HA_LONG_LIVED_TOKEN="YOUR_TOKEN_HERE" \ -e FIRMWARE_LAN_PORT="38080" \ -v "$(pwd)/config:/config" \ everythingsmarthome/everything-presence-mmwave-configurator:latest ``` ## Next Steps [**Setup Wizard**][za-setup-wizard] - Configure your first device. [stars-shield]: https://img.shields.io/github/stars/EverythingSmartHome/everything-presence-addons [repo]: https://github.com/EverythingSmartHome/everything-presence-addons [discord-shield]: https://img.shields.io/discord/719115387425521704.svg [discord]: https://discord.gg/Bgfvy2f [release-shield]: https://img.shields.io/github/v/release/EverythingSmartHome/everything-presence-addons.svg [release]: https://github.com/EverythingSmartHome/everything-presence-addons/releases [epzc-ha-addon-tag]: https://hub.docker.com/r/everythingsmarthome/everything-presence-mmwave-configurator/tags?name=addon [epzc-docker-latest]: https://hub.docker.com/r/everythingsmarthome/everything-presence-mmwave-configurator/tags?name=latest [epzc-install-docs]: https://docs.everythingsmart.io/s/products/doc/installation-cMmmVVeJce [za-setup-wizard]: https://docs.everythingsmart.io/s/products/doc/12eba20b-11c3-4451-a484-69636ea2b213 [ha-addons]: https://www.home-assistant.io/addons/ [ha-api-docs]: https://developers.home-assistant.io/docs/api/rest/ [ha-auth-docs]: https://www.home-assistant.io/docs/authentication/ [exposing-ports-docker]: https://docs.docker.com/get-started/docker-concepts/running-containers/publishing-ports/ [docker-compose-env-docs]: https://docs.docker.com/compose/how-tos/environment-variables/set-environment-variables/ [docker-compose-docs]: https://docs.docker.com/compose/ [portainer-docs]: https://docs.portainer.io/ [docker-run-docs]: https://docs.docker.com/