├── .travis.yml ├── repository.json ├── zigbee2mqtt ├── run.sh ├── Dockerfile ├── config.json └── set_config.py ├── zigbee2mqtt-edge ├── Dockerfile └── config.json ├── CHANGELOG.md ├── .gitignore ├── distribute.sh ├── README.md └── LICENSE /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | services: 3 | - docker 4 | script: 5 | - $TRAVIS_BUILD_DIR/build.sh 6 | after_success: 7 | - $TRAVIS_BUILD_DIR/distribute.sh 8 | -------------------------------------------------------------------------------- /repository.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Zigbee2mqtt Hass.io Add-on Zen fork", 3 | "url": "https://github.com/zen/hassio-zigbee2mqtt", 4 | "maintainer": "Tomasz 'Zen' Napierala " 5 | } 6 | -------------------------------------------------------------------------------- /zigbee2mqtt/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CONFIG_PATH=/data/options.json 4 | 5 | DATA_PATH=$(jq --raw-output ".data_path" $CONFIG_PATH) 6 | DEBUG_ZIGBEE2MQTT=$(jq --raw-output ".debug // empty" $CONFIG_PATH) 7 | ERR_LOG=$(jq --raw-output ".err // empty" $CONFIG_PATH) 8 | 9 | python3 set_config.py "$CONFIG_PATH" "$DATA_PATH" 10 | 11 | if [[ ! -z "$DEBUG_ZIGBEE2MQTT" ]]; then 12 | export DEBUG=* 13 | fi 14 | 15 | 16 | if [[ ! -z "$ERR_LOG" ]]; then 17 | ZIGBEE2MQTT_DATA="$DATA_PATH" npm start 1> "$DATA_PATH"/out.log 2> "$DATA_PATH"/err.log 18 | else 19 | ZIGBEE2MQTT_DATA="$DATA_PATH" pm2-runtime start npm -- start 20 | fi 21 | -------------------------------------------------------------------------------- /zigbee2mqtt-edge/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BUILD_FROM 2 | FROM $BUILD_FROM 3 | 4 | # Add env 5 | ENV LANG C.UTF-8 6 | 7 | RUN apk add --update --no-cache jq nodejs nodejs-npm python3 python3-dev \ 8 | python2 make gcc g++ linux-headers udev git && \ 9 | pip3 install PyYAML==3.12 && \ 10 | git clone -b dev --single-branch --depth 1 https://github.com/Koenkk/zigbee2mqtt.git /app 11 | 12 | COPY run.sh /app/run.sh 13 | COPY set_config.py /app/set_config.py 14 | 15 | WORKDIR /app 16 | 17 | RUN ["chmod", "a+x", "/app/run.sh"] 18 | RUN ["npm", "install", "--unsafe-perm", "-g", "pm2"] 19 | RUN ["npm", "install", "--unsafe-perm"] 20 | RUN apk del make gcc g++ python2 linux-headers udev 21 | 22 | CMD [ "/app/run.sh" ] 23 | -------------------------------------------------------------------------------- /zigbee2mqtt/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BUILD_FROM 2 | FROM $BUILD_FROM 3 | 4 | # Add env 5 | ENV LANG C.UTF-8 6 | 7 | ENV ZIGBEE2MQTT_VERSION=0.1.5 8 | ENV ARCHIVE=zigbee2mqtt-$ZIGBEE2MQTT_VERSION 9 | 10 | RUN apk add --update --no-cache curl jq nodejs nodejs-npm python3 python3-dev \ 11 | python2 make gcc g++ linux-headers udev git && \ 12 | pip3 install PyYAML 13 | 14 | RUN curl -sL -o "/$ARCHIVE.tar.gz" \ 15 | "https://github.com/Koenkk/zigbee2mqtt/archive/$ZIGBEE2MQTT_VERSION.tar.gz" && \ 16 | tar xzvf "/$ARCHIVE.tar.gz" -C / 17 | 18 | COPY run.sh /$ARCHIVE/run.sh 19 | COPY set_config.py /$ARCHIVE/set_config.py 20 | 21 | WORKDIR /$ARCHIVE 22 | 23 | RUN ["chmod", "a+x", "./run.sh"] 24 | RUN ["npm", "install", "--unsafe-perm", "-g", "pm2"] 25 | RUN ["npm", "install", "--unsafe-perm"] 26 | RUN apk del make gcc g++ python2 linux-headers udev 27 | 28 | CMD [ "./run.sh" ] 29 | -------------------------------------------------------------------------------- /zigbee2mqtt/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "zigbee2mqtt", 3 | "version": "0.1.5", 4 | "slug": "zigbee2mqtt", 5 | "description": "Zigbee to MQTT Bridge", 6 | "auto_uart": true, 7 | "url": "https://github.com/zen/hassio-zigbee2mqtt", 8 | "startup": "before", 9 | "boot": "auto", 10 | "map": ["share:rw"], 11 | "options": { 12 | "data_path": "/share/zigbee2mqtt", 13 | "homeassistant": true, 14 | "permit_join": false, 15 | "mqtt_base_topic": "zigbee2mqtt", 16 | "mqtt_server": "mqtt://homeassistant", 17 | "serial_port": "/dev/ttyACM0" 18 | }, 19 | "schema": { 20 | "data_path": "str", 21 | "homeassistant": "bool", 22 | "permit_join": "bool", 23 | "mqtt_base_topic": "str", 24 | "mqtt_server": "str", 25 | "serial_port": "str", 26 | "serial_disable_led": "bool?", 27 | "mqtt_user": "str?", 28 | "mqtt_pass": "str?", 29 | "debug": "bool?", 30 | "err": "bool?" 31 | }, 32 | "image": "zen/zigbee2mqtt-{arch}" 33 | } 34 | -------------------------------------------------------------------------------- /zigbee2mqtt-edge/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "zigbee2mqtt-edge", 3 | "version": "test", 4 | "slug": "zigbee2mqtt-edge", 5 | "description": "Development build of the zigbee2mqtt add-on.", 6 | "auto_uart": true, 7 | "url": "https://github.com/zen/hassio-zigbee2mqtt", 8 | "startup": "before", 9 | "boot": "auto", 10 | "map": ["share:rw"], 11 | "options": { 12 | "data_path": "/share/zigbee2mqtt", 13 | "homeassistant": true, 14 | "permit_join": false, 15 | "mqtt_base_topic": "zigbee2mqtt", 16 | "mqtt_server": "mqtt://homeassistant", 17 | "serial_port": "/dev/ttyACM0" 18 | }, 19 | "schema": { 20 | "data_path": "str", 21 | "homeassistant": "bool", 22 | "permit_join": "bool", 23 | "mqtt_base_topic": "str", 24 | "mqtt_server": "str", 25 | "serial_port": "str", 26 | "serial_disable_led": "bool?", 27 | "mqtt_user": "str?", 28 | "mqtt_pass": "str?", 29 | "debug": "bool?", 30 | "err": "bool?" 31 | }, 32 | "image": "dwelch2101/zigbee2mqtt-edge-{arch}" 33 | } 34 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) 5 | and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). 6 | 7 | ## [0.1.2](https://github.com/danielwelch/hassio-zigbee2mqtt/releases/tag/v0.1.2) - 2018-07-31 8 | ### Changed 9 | - Upgrade to version 0.1.2 of `zigbee2mqtt` 10 | 11 | ## [0.1.1](https://github.com/danielwelch/hassio-zigbee2mqtt/releases/tag/v0.1.1) - 2018-07-29 12 | ### Changed 13 | - Switch the edge and non-edge dockerfiles so they're actually correct. Sigh. This is why you don't write code after 28 hour shifts. 14 | - Download release archives instead of git cloning the specific branch 15 | - Upgrade to version 0.1.1 of `zigbee2mqtt` 16 | 17 | ## [0.1.0](https://github.com/danielwelch/hassio-zigbee2mqtt/releases/tag/v0.1.0) - 2018-07-16 18 | ### Changed 19 | Version 0.1.0 is the first versioned release of the add-on. The repository actually establishes two add-ons: 20 | - `zigbee2mqtt` add-on, which will use the first released version of the `zigbee2mqtt` library and will update as new versions of that library are released 21 | - `zigbee2mqtt-edge` add-on, which will build with the latest commit to the `zigbee2mqtt` master branch. Each update to the library will trigger a new add-on image to be built. In effect, this add-on will function the same way that the pre-release version of this add-on did. 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | .DS_Store 7 | 8 | # C extensions 9 | *.so 10 | 11 | # Distribution / packaging 12 | .Python 13 | build/ 14 | develop-eggs/ 15 | dist/ 16 | downloads/ 17 | eggs/ 18 | .eggs/ 19 | lib/ 20 | lib64/ 21 | parts/ 22 | sdist/ 23 | var/ 24 | wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | .hypothesis/ 50 | .pytest_cache/ 51 | 52 | # Translations 53 | *.mo 54 | *.pot 55 | 56 | # Django stuff: 57 | *.log 58 | .static_storage/ 59 | .media/ 60 | local_settings.py 61 | 62 | # Flask stuff: 63 | instance/ 64 | .webassets-cache 65 | 66 | # Scrapy stuff: 67 | .scrapy 68 | 69 | # Sphinx documentation 70 | docs/_build/ 71 | 72 | # PyBuilder 73 | target/ 74 | 75 | # Jupyter Notebook 76 | .ipynb_checkpoints 77 | 78 | # pyenv 79 | .python-version 80 | 81 | # celery beat schedule file 82 | celerybeat-schedule 83 | 84 | # SageMath parsed files 85 | *.sage.py 86 | 87 | # Environments 88 | .env 89 | .venv 90 | env/ 91 | venv/ 92 | ENV/ 93 | env.bak/ 94 | venv.bak/ 95 | 96 | # Spyder project settings 97 | .spyderproject 98 | .spyproject 99 | 100 | # Rope project settings 101 | .ropeproject 102 | 103 | # mkdocs documentation 104 | /site 105 | 106 | # mypy 107 | .mypy_cache/ 108 | 109 | secrets.json 110 | 111 | -------------------------------------------------------------------------------- /zigbee2mqtt/set_config.py: -------------------------------------------------------------------------------- 1 | import json 2 | import argparse 3 | from pathlib import Path 4 | import yaml 5 | 6 | 7 | def main(options_path, data_path): 8 | 9 | config = dict() 10 | config_path = Path(data_path).joinpath('configuration.yaml') 11 | if config_path.is_file(): # check if config file exists in data path 12 | print("[Info] Configuration file found. Will overwrite configurable \ 13 | fields with values from add-on configuration") 14 | with open(config_path) as f: 15 | config = yaml.safe_load(f) 16 | else: # make sure the data_path folder exists; if not, create it 17 | if not Path(data_path).is_dir(): 18 | Path(data_path).mkdir() 19 | 20 | with open(options_path) as f: 21 | options = json.load(f) 22 | 23 | config['homeassistant'] = options["homeassistant"] 24 | config['permit_join'] = options["permit_join"] 25 | if config.get('mqtt', None) is None: 26 | config['mqtt'] = dict() 27 | config['mqtt']['base_topic'] = options["mqtt_base_topic"] 28 | config['mqtt']['server'] = options["mqtt_server"] 29 | 30 | if options.get("mqtt_user", None) or options.get("mqtt_pass", None): 31 | config['mqtt']['user'] = options["mqtt_user"] 32 | config['mqtt']['password'] = options["mqtt_pass"] 33 | 34 | if config.get('serial', None) is None: 35 | config['serial'] = dict() 36 | config['serial']['port'] = options["serial_port"] 37 | if options.get("serial_disable_led", None): 38 | config['serial']['disable_led'] = options["serial_disable_led"] 39 | 40 | with open(config_path, 'w') as f: 41 | yaml.safe_dump(config, f, default_flow_style=False) 42 | 43 | print('[Info] Configuration written to {}'.format(config_path)) 44 | 45 | 46 | if __name__ == "__main__": 47 | parser = argparse.ArgumentParser( 48 | description='Construct an appropriate yaml configuration file.') 49 | parser.add_argument('options_path', type=str) 50 | parser.add_argument('data_path', type=str) 51 | parser.set_defaults(mqtt_user=None, mqtt_pass=None) 52 | args = parser.parse_args() 53 | main(args.options_path, args.data_path) 54 | -------------------------------------------------------------------------------- /distribute.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | 4 | cp "${TRAVIS_BUILD_DIR}"/zigbee2mqtt/run.sh "${TRAVIS_BUILD_DIR}"/zigbee2mqtt-edge/run.sh 5 | cp "${TRAVIS_BUILD_DIR}"/zigbee2mqtt/set_config.py "${TRAVIS_BUILD_DIR}"/zigbee2mqtt-edge/set_config.py 6 | 7 | if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then 8 | echo "This build is a pull request, aborting distribution script." 9 | exit 0 10 | fi 11 | 12 | if [ ! -z "$TRAVIS_TAG" ]; then 13 | echo "Tagged build found. Pushing zigbee2mqtt image to Docker with tag 'latest'." 14 | 15 | docker run -it --rm --privileged --name "${ADDON_NAME}" \ 16 | -v ~/.docker:/root/.docker \ 17 | -v "$(pwd)":/docker \ 18 | hassioaddons/build-env:latest \ 19 | --target "${ADDON_NAME}" \ 20 | --tag-latest \ 21 | --push \ 22 | --all \ 23 | --from "homeassistant/{arch}-base" \ 24 | --author "Tomasz 'Zen' Napierala " \ 25 | --doc-url "${GITHUB_URL}" \ 26 | --login "${DOCKER_USERNAME}" \ 27 | --password "${DOCKER_PASSWORD}" \ 28 | --parallel 29 | else 30 | echo "No tag found. Pushing zigbee2mqtt and zigbee2mqtt-edge images to Docker with tag 'test'." 31 | 32 | # distribute zigbee2mqtt with tag test 33 | docker run -it --rm --privileged --name "${ADDON_NAME}" \ 34 | -v ~/.docker:/root/.docker \ 35 | -v "$(pwd)":/docker \ 36 | hassioaddons/build-env:latest \ 37 | --target "${ADDON_NAME}" \ 38 | --tag-latest \ 39 | --push \ 40 | --all \ 41 | --from "homeassistant/{arch}-base" \ 42 | --author "Tomasz 'Zen' Napierala " \ 43 | --doc-url "${GITHUB_URL}" \ 44 | --login "${DOCKER_USERNAME}" \ 45 | --password "${DOCKER_PASSWORD}" \ 46 | --parallel 47 | 48 | # distribute zigbee2mqtt-edge with tag test 49 | docker run -it --rm --privileged --name "${ADDON_NAME_EDGE}" \ 50 | -v ~/.docker:/root/.docker \ 51 | -v "$(pwd)":/docker \ 52 | hassioaddons/build-env:latest \ 53 | --target "${ADDON_NAME_EDGE}" \ 54 | --tag-test \ 55 | --push \ 56 | --all \ 57 | --from "homeassistant/{arch}-base" \ 58 | --author "Tomasz 'Zen' Napierala " \ 59 | --doc-url "${GITHUB_URL}" \ 60 | --login "${DOCKER_USERNAME}" \ 61 | --password "${DOCKER_PASSWORD}" \ 62 | --parallel 63 | fi 64 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hass.io Add-on: zigbee2mqtt 2 | 3 | Add-on for running [zigbee2mqtt](https://github.com/Koenkk/zigbee2mqtt) in [Hass.io](https://github.com/home-assistant/hassio). 4 | 5 | ## Usage 6 | 7 | ### Installation 8 | 9 | - Add the [repository URL](https://github.com/danielwelch/hassio-zigbee2mqtt) in your **Hass.io > Add-on Store** 10 | 11 | The repository includes two add-ons: zigbee2mqtt and zigbee2mqtt-edge. For a stable release that tracks the released versions of zigbee2mqtt, install zigbee2mqtt. zigbee2mqtt-edge tracks the dev branch of zigbee2mqtt, so you can install the edge version if there are features or fixes in the dev branch that are not yet released. 12 | 13 | ### Configuration 14 | 15 | To configure this add-on, you must set the following parameters via the Hass.io user interface. See the [zigbee2mqtt docs](https://github.com/Koenkk/zigbee2mqtt/wiki/Running-the-bridge) and the [default configuration file](https://github.com/Koenkk/zigbee2mqtt/blob/master/data/configuration.yaml) for more information. 16 | 17 | |Parameter|Type|Required|Description| 18 | |---------|----|--------|-----------| 19 | |`data_path`|string|Yes|Set this to the path you'd like the add-on to persist data. Must be within the `/share` directory. Defaults to `/share/zigbee2mqtt`.| 20 | |`homeassistant`|bool|yes|Set this to `true` if you want MQTT autodiscovery. See [Integrating with Home Assistant](https://github.com/Koenkk/zigbee2mqtt/wiki/Integrating-with-Home-Assistant) for details.| 21 | |`permit_join`|bool|yes|Recommended to leave this to `false` and use [runtime pairing](https://github.com/danielwelch/hassio-zigbee2mqtt#pairing). Set this to `true` when you setup new devices - make sure you set it back to `false` when done.| 22 | |`mqtt_server`|string|yes|The MQTT server address. Make sure you include the protocol. Example: `mqtt://homeassistant`| 23 | |`mqtt_base_topic`|string|yes|Prefix for your MQTT topic| 24 | |`serial_port`|string|yes|Serial port for your CC2531 stick.| 25 | |`serial_disable_led`|bool|no|Disable the LED of your CC2531 stick.| 26 | |`mqtt_user`|string|no|Your MQTT username, if set.| 27 | |`mqtt_pass`|string|no|Your MQTT Password, if set.| 28 | |`debug`|bool|no|Set to true to enable debug mode for zigbee-shepherd and zigbee2mqtt. See [the wiki](https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-debug) for more information.| 29 | |`err`|bool|no|Set to true to redirect zigbee2mqtt `stdout` to `out.log` and `stderr` to `err.log`. Both `out.log` and `err.log` will be located within `data_path` above.| 30 | 31 | Notes: 32 | - Depending on your configuration, the MQTT server URL will need to include the port, typically `1883` or `8883` for SSL communications. For example, `mqtt://homeassistant:1883`. 33 | - To find out which serial ports you have exposed go to **Hass.io > System > Host system > Show Hardware** 34 | 35 | ##### Modifying zigbee2mqtt's `configuration.yaml` 36 | In some cases, you may wish to modify zigbee2mqtt's `configuration.yaml` file directly (for example, to add or modify device specific configuration](https://github.com/Koenkk/zigbee2mqtt/wiki/Device-specific-configuration)). The `configuration.yaml` file used by this add-on can be modified within the data directory specified via the add-on configuration (see above). By default, therefore, the configuration file is saved to `/share/zigbee2mqtt/configuration.yaml` on your Hass.io host. Suggested ways to edit your `configuration.yaml` file include the official [Samba share](https://www.home-assistant.io/addons/samba/) add-on and the [official](https://www.home-assistant.io/addons/ssh/) or [community SSH add-ons](https://github.com/hassio-addons/addon-ssh). 37 | 38 | ### Pairing 39 | 40 | The suggested way to pair your devices is to enable zigbee2mqtt's `permit_join` option from within Home Assistant using MQTT rather than through the add-on's User Interface. Below is an example configuration that will allow you to enable and disable device pairing from the Home Assistant front end: 41 | 42 | screen shot 2018-06-02 at 14 41 42 43 | 44 | ```yaml 45 | mqtt: 46 | broker: homeassistant # This will have to be your mqtt broker 47 | discovery: true 48 | 49 | input_boolean: 50 | zigbee_permit_join: 51 | name: Allow devices to join 52 | initial: off 53 | icon: mdi:cellphone-wireless 54 | 55 | timer: 56 | zigbee_permit_join: 57 | name: Time remaining 58 | duration: 600 # Updated this to the number of seconds you wish 59 | 60 | sensor: 61 | - platform: mqtt 62 | name: Bridge state 63 | state_topic: "zigbee2mqtt/bridge/state" 64 | icon: mdi:router-wireless 65 | 66 | group: 67 | zigbee_group: 68 | name: Zigbee 69 | entities: 70 | - input_boolean.zigbee_permit_join 71 | - timer.zigbee_permit_join 72 | - sensor.bridge_state 73 | 74 | automation: 75 | - id: enable_zigbee_join 76 | alias: Enable Zigbee joining 77 | hide_entity: true 78 | trigger: 79 | platform: state 80 | entity_id: input_boolean.zigbee_permit_join 81 | to: 'on' 82 | action: 83 | - service: mqtt.publish 84 | data: 85 | topic: zigbee2mqtt/bridge/config/permit_join 86 | payload: 'true' 87 | - service: timer.start 88 | data: 89 | entity_id: timer.zigbee_permit_join 90 | - id: disable_zigbee_join 91 | alias: Disable Zigbee joining 92 | trigger: 93 | - entity_id: input_boolean.zigbee_permit_join 94 | platform: state 95 | to: 'off' 96 | action: 97 | - data: 98 | payload: 'false' 99 | topic: zigbee2mqtt/bridge/config/permit_join 100 | service: mqtt.publish 101 | - data: 102 | entity_id: timer.zigbee_permit_join 103 | service: timer.cancel 104 | hide_entity: true 105 | - id: disable_zigbee_join_timer 106 | alias: Disable Zigbee joining by timer 107 | hide_entity: true 108 | trigger: 109 | - platform: event 110 | event_type: timer.finished 111 | event_data: 112 | entity_id: timer.zigbee_permit_join 113 | action: 114 | - service: mqtt.publish 115 | data: 116 | topic: zigbee2mqtt/bridge/config/permit_join 117 | payload: 'false' 118 | - service: input_boolean.turn_off 119 | data: 120 | entity_id: input_boolean.zigbee_permit_join 121 | ``` 122 | Notes: 123 | - There is a [gist](https://gist.github.com/ciotlosm/59d160ad49c695a801d9a940a2a387d2) with the above code 124 | - `permit_join` will be enabled for 10 minutes (based on code automation) 125 | 126 | 127 | ### Updating the Add-on and `zigbee2mqtt` Library 128 | 129 | The stable, versioned zigbee2mqtt can be updated using the standard Hass.io update functionality within the user interface. This add-on will be updated with bug fixes and as the underlying `zigbee2mqtt` library is updated. 130 | 131 | To update the edge version of the add-on, you will need to uninstall and re-install the add-on. If you have reinstalled the add-on and believe that the latest version has not been installed, try removing the repository before reinstalling. 132 | 133 | ### Issues 134 | 135 | If you find any issues with the addon, please check first the [issue tracker](https://github.com/danielwelch/hassio-zigbee2mqtt/issues). 136 | 137 | Feel free to create a PR for fixes and enhancements. 138 | 139 | ## Credits 140 | - [danielwelch](https://github.com/danielwelch) 141 | - [ciotlosm](https://github.com/ciotlosm) 142 | - [Koenkk](https://github.com/Koenkk) for [zigbee2mqtt](https://github.com/Koenkk/zigbee2mqtt) 143 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "{}" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright {yyyy} {name of copyright owner} 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | --------------------------------------------------------------------------------