--- layout: page title: "Z-Wave" description: "Instructions how to integrate your existing Z-Wave within Home Assistant." date: 2016-02-27 19:59 sidebar: true comments: false sharing: true footer: true --- [Z-Wave](http://www.z-wave.com/) integration for Home Assistant allows you to observe and control connected Z-Wave devices. Z-Wave support requires a [supported Z-Wave USB stick or module](https://github.com/OpenZWave/open-zwave/wiki/Controller-Compatibility-List) to be plugged into the host. There is currently support for climate, covers, lights, locks, sensors, switches and thermostats. All will be picked up automatically after configuring this platform. ### {% linkable_title Installation %} To allow Home Assistant to talk to your Z-Wave USB stick you will have to compile the OpenZWave library and install the related [python-OpenZWave package](https://github.com/OpenZWave/python-openzwave). This can be done as follows. _(Note: The Home Assistant docker image and the All In One installer have support for Z-Wave already built-in!)_ Make sure you have the correct dependencies installed before running the script: ```bash $ sudo apt-get install cython3 libudev-dev python3-sphinx python3-setuptools git ``` Make sure you have at least version 0.23 and at the most 0.24.1 of cython. ```bash $ sudo pip3 install --upgrade cython==0.24.1 ``` Then get the OpenZWave files and switch to the `python3` branch:

Do not use root to build python-openzwave as it will surely fail.

```bash $ git clone https://github.com/OpenZWave/python-openzwave.git $ cd python-openzwave $ git checkout python3 $ PYTHON_EXEC=$(which python3) make build $ sudo PYTHON_EXEC=$(which python3) make install ```

Instead of `make install`, you can alternatively build your own python-openzwave package which can be easily uninstalled:

```bash $ sudo apt-get install -y checkinstall $ sudo PYTHON_EXEC=$(which python3) checkinstall --pkgname python-openzwave --pkgversion 1.0 --provides python-openzwave ``` With this installation, your `config_path` needed below will resemble: ```bash /usr/local/lib/python3.4/dist-packages/libopenzwave-0.3.0b8-py3.4-linux-x86_64.egg/config ``` If you followed along with setting up a virtual environment, your path will be: ```bash /srv/hass/python-openzwave/openzwave/config ``` ### {% linkable_title Configuration %} ```yaml # Example configuration.yaml entry zwave: usb_path: /dev/ttyUSB0 ``` Configuration variables: - **usb_path** (*Optional*): The port where your device is connected to your Home Assistant host. - **config_path** (*Optional*): The path to the Python OpenZWave configuration files. Defaults to the folder `config` in your Python OpenZWave install directory. - **autoheal** (*Optional*): Allows disabling auto Z-Wave heal at midnight. Defaults to True. - **polling_interval** (*Optional*): The time period in milliseconds between polls of a nodes value. Be careful about using polling values below 30000 (30 seconds) as polling can flood the zwave network and cause problems. - **customize** (*Optional*): This attribute contains node-specific override values: - **polling_intensity** (*Optional*): Enables polling of a value and sets the frequency of polling (0=none, 1=every time through the list, 2=every other time, etc). If not specified then your device will not be polled. - **ignored** (*Optional*): Ignore this entitiy completely. It won't be shown in the Web Interface and no events are generated for it. - **refresh_value** (*Optional*): Enable refreshing of the node value. Only the light component uses this. Defaults to False. - **delay** (*Optional*): Specify the delay for refreshing of node value. Only the light component uses this. Defaults to 2 seconds. - **debug** (*Optional*): Print verbose z-wave info to log. Defaults to False. To find the path of your Z-Wave USB stick or module, run: ```bash $ ls /dev/ttyUSB* ``` Or, on some other systems (such as Raspberry Pi), use: ```bash $ ls /dev/ttyACM* # If `hass` runs with another user (e.g. *homeassistant* on Hassbian) give access to the stick with: $ sudo usermod -a -G dialout homeassistant ``` Or, on some other systems (such as Pine 64), use: ```bash $ ls /dev/ttyS* ``` Or, on macOS, use: ```bash $ ls /dev/cu.usbmodem* ```

Depending on what's plugged into your USB ports, the name found above may change. You can lock in a name, such as `/dev/zwave`, by following [these instructions](http://hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices/).

### {% linkable_title Adding Devices %} To add a Z-Wave device to your system, go to the Services menu and select the `zwave` domain, and select the `add-node` service. Then find your device's add button and press that as well. ### {% linkable_title Adding Security Devices %} Security Z-Wave devices require a network key before being added to the network using the `zwave.add_node_secure` service. You must edit the `options.xml` file, located in your `python-openzwave config_path` to use a network key before adding these devices. Edit your `options.xml` file: ```bash ``` Uncomment the line: ```bash