diff --git a/README.md b/README.md index dfbee3f1d..0ab4d5e8b 100644 --- a/README.md +++ b/README.md @@ -25,32 +25,35 @@ ## Installation + 1. If you don't have an MQTT broker yet; in Home Assistant go to **[Settings → Add-ons → Add-on store](https://my.home-assistant.io/redirect/supervisor_store/)** and install the **[Mosquitto broker](https://my.home-assistant.io/redirect/supervisor_addon/?addon=core_mosquitto)** addon, then start it. -1. Go back to the **Add-on store**, click **⋮ → Repositories**, fill in
`https://github.com/zigbee2mqtt/hassio-zigbee2mqtt` and click **Add → Close** or click the **Add repository** button below, click **Add → Close** (You might need to enter the **internal IP address** of your Home Assistant instance first). -[![Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.](https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg)](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Fzigbee2mqtt%2Fhassio-zigbee2mqtt) -3. The repository includes two add-ons: - - **Zigbee2MQTT** is the stable release that tracks the released versions of Zigbee2MQTT. (**recommended for most users**) - - **Zigbee2MQTT Edge** tracks the `dev` branch of Zigbee2MQTT such that you can install the edge version if there are features or fixes in the Zigbee2MQTT dev branch that are not yet released. -4. Click on the addon and press **Install** and wait till the addon is installed. -5. Click on **Configuration** - - If you are **not** using the Mosquitto broker addon fill in your MQTT details (leave empty when using the Mosquitto broker addon). Format can be found [here](https://www.zigbee2mqtt.io/guide/configuration/mqtt.html#server-connection), but skip the initial `mqtt:` indent. e.g.:
- ```yaml - server: mqtt://localhost:1883 - user: my_user - password: "my_password" - ``` - Note: If the `password` includes certain special characters (reserved by yaml specification), the enclosing quotes are required. So it is recommended to always quote it when in doubt. - - Fill in the serial details (e.g. port of your USB coordinator). Format can be found [here](https://www.zigbee2mqtt.io/guide/configuration/adapter-settings.html#adapter-settings), but skip the initial `serial:` indent. e.g.:
- ```yaml - port: /dev/ttyUSB0 - ``` - - If you don't know the port and you have just one USB device connected to your machine try `/dev/ttyUSB0`. Else use the [Home Assistant CLI](https://www.home-assistant.io/common-tasks/os#home-assistant-via-the-command-line) and execute `ha hardware info` to find out. - - Click **Save** - - **Tip:** it is possible to refer to variables in the Home Assistant `secrets.yaml` file (not the Zigbee2MQTT one!) by using e.g. `password: '!secret mqtt_pass'` +1. Go back to the **Add-on store**, click **⋮ → Repositories**, fill in
`https://github.com/zigbee2mqtt/hassio-zigbee2mqtt` and click **Add → Close** or click the **Add repository** button below, click **Add → Close** (You might need to enter the **internal IP address** of your Home Assistant instance first). + [![Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.](https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg)](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Fzigbee2mqtt%2Fhassio-zigbee2mqtt) +1. The repository includes two add-ons: + - **Zigbee2MQTT** is the stable release that tracks the released versions of Zigbee2MQTT. (**recommended for most users**) + - **Zigbee2MQTT Edge** tracks the `dev` branch of Zigbee2MQTT such that you can install the edge version if there are features or fixes in the Zigbee2MQTT dev branch that are not yet released. +1. Click on the addon and press **Install** and wait till the addon is installed. +1. Click on **Configuration** + - If you are **not** using the Mosquitto broker addon fill in your MQTT details (leave empty when using the Mosquitto broker addon) under the `mqtt` section. Format can be found [here](https://www.zigbee2mqtt.io/guide/configuration/mqtt.html#server-connection), but skip the initial `mqtt:` indent. e.g.:
+ ```yaml + server: mqtt://localhost:1883 + user: my_user + password: "my_password" + ``` + Note: If the `password` includes certain special characters (reserved by yaml specification), the enclosing quotes are required. So it is recommended to always quote it when in doubt. + - Since Zigbee2MQTT automatically attempts to detect the adapter, you can leave the `serial` section empty for now; we may need it later in step 7. + - Click **Save** + - **Tip:** it is possible to refer to variables in the Home Assistant `secrets.yaml` file (not the Zigbee2MQTT one!) by using e.g. `password: '!secret mqtt_pass'` 1. Start the addon by going to **Info** and click **Start** 1. Wait till Zigbee2MQTT starts and press **OPEN WEB UI** to verify Zigbee2MQTT started correctly. - - If it shows `502: Bad Gateway` wait a bit more and refresh the page. - - If this takes too long (e.g. 2 minutes +) check the **Log** tab to see what went wrong. + - If it shows `502: Bad Gateway` wait a bit more and refresh the page. + - If this takes too long (e.g. 2 minutes +) check the **Log** tab to see what went wrong. + - In case the addon fails to start with the following error: `Error: No path provided and failed to auto detect path`, we need to fill in the `serial` section (which we skipped in step 5). Format can be found [here](https://www.zigbee2mqtt.io/guide/configuration/adapter-settings.html#adapter-settings), but skip the initial `serial:` indent. e.g.:
+ ```yaml + port: /dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B0018ED3DDF-if00 + adapter: zstack + ``` + If you don't know the port and you have just one USB device connected to your machine try `/dev/ttyUSB0` or `/dev/ttyAMA0`. Else use the [Home Assistant CLI](https://www.home-assistant.io/common-tasks/os#home-assistant-via-the-command-line) and execute `ha hardware info` to find out. For more information see [the documentation](https://github.com/zigbee2mqtt/hassio-zigbee2mqtt/blob/master/zigbee2mqtt/DOCS.md). @@ -63,11 +66,12 @@ For more information see [the documentation](https://github.com/zigbee2mqtt/hass 1. Restore your `data` folder contents into `/mnt/data/supervisor/homeassistant/zigbee2mqtt`, e.g. via `scp -O -P 22222 -i PATHTOUSEDSSHKEY ./data/* root@hass:/mnt/data/supervisor/homeassistant/zigbee2mqtt/` 1. Configure your serial port and MQTT settings using the HA addon configuration UI 1. Edit the `/usr/share/hassio/homeassistant/zigbee2mqtt/configuration.yaml` file: - - Ensure that the serial port section matches the one configured with the UI - - Remove any irrelevant sections from the config (e.g. `mqtt` (if not needed), `advanced/log_syslog`, `frontend`) + - Ensure that the serial port section matches the one configured with the UI + - Remove any irrelevant sections from the config (e.g. `mqtt` (if not needed), `advanced/log_syslog`, `frontend`) 1. Start the add-on ## Changelog + The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). All notable changes to this project will be documented in the [CHANGELOG.md](zigbee2mqtt/CHANGELOG.md) file. @@ -79,32 +83,42 @@ Any changes on the addon that do not require a new version of Zigbee2MQTT will u Edge version will not maintain a CHANGELOG and doesn't have a version. ## Issues + If you find any issues with the add-on, please check the [issue tracker](https://github.com/zigbee2mqtt/hassio-zigbee2mqtt/issues) for similar issues before creating one. If your issue is regarding specific devices or, more generally, an issue that arises after Zigbee2MQTT has successfully started, it should likely be reported in the [Zigbee2MQTT issue tracker](https://github.com/Koenkk/zigbee2mqtt/issues). -Feel free to create a PR for fixes and enhancements. +Feel free to create a PR for fixes and enhancements. ### Testing changes locally If you're submitting a PR and wish to test it locally: + - Gain root access to your Home Assistant installation - In the Add-on Settings, Ensure "Watchdog" is turned off so the container isn't automatically restarted when it's stopped via the CLI ![image](https://user-images.githubusercontent.com/1923186/198087147-7ab2ba1e-1a68-41b8-9a84-76b25b329786.png) + - Enter the `zigbee2mqtt` container interactively. + ``` docker exec -it $(docker ps | grep zigbee2mqtt | cut -d" " -f 1) /bin/sh ``` -- Edit the file you'd like to test & save. + +- Edit the file you'd like to test & save. + ``` vi node_modules/zigbee-herdsman-converters/converters/toZigbee.js ``` + - Back on the Home Assistant installation, restart the `zigbee2mqtt` container + ``` docker restart $(docker ps | grep zigbee2mqtt | cut -d" " -f 1) ``` + - Refresh the web UI and perform your testing. ## Credits + - [danielwelch](https://github.com/danielwelch) - [ciotlosm](https://github.com/ciotlosm) - [Koenkk](https://github.com/Koenkk) diff --git a/common/Dockerfile b/common/Dockerfile index c99900d6e..2b356c262 100644 --- a/common/Dockerfile +++ b/common/Dockerfile @@ -4,7 +4,7 @@ FROM $BUILD_FROM as base ENV LANG C.UTF-8 ARG BUILD_VERSION -RUN apk add --no-cache socat tini nodejs +RUN apk add --no-cache socat tini nodejs eudev # Dependencies and build FROM base as dependencies_and_build diff --git a/zigbee2mqtt-edge/config.json b/zigbee2mqtt-edge/config.json index 323a08880..ab291a3e2 100644 --- a/zigbee2mqtt-edge/config.json +++ b/zigbee2mqtt-edge/config.json @@ -4,6 +4,7 @@ "slug": "zigbee2mqtt_edge", "description": "Development build of the Zigbee2MQTT add-on", "uart": true, + "udev": true, "url": "https://github.com/zigbee2mqtt/hassio-zigbee2mqtt/tree/master/zigbee2mqtt-edge", "startup": "application", "services": [ diff --git a/zigbee2mqtt/config.json b/zigbee2mqtt/config.json index 1181e08a3..23aab47ab 100644 --- a/zigbee2mqtt/config.json +++ b/zigbee2mqtt/config.json @@ -4,6 +4,7 @@ "slug": "zigbee2mqtt", "description": "Use your ZigBee devices without the vendor's bridge or gateway", "uart": true, + "udev": true, "url": "https://github.com/zigbee2mqtt/hassio-zigbee2mqtt/tree/master/zigbee2mqtt", "startup": "application", "services": [