Site updated at 2016-06-09 05:10:48 UTC

This commit is contained in:
Travis CI 2016-06-09 05:10:48 +00:00
parent 2b9f32e996
commit 5ac15fb614
62 changed files with 1267 additions and 305 deletions

View file

@ -89,260 +89,8 @@
<hr class="divider">
<p><a href="http://www.z-wave.com/">Z-Wave</a> integration for Home Assistant allows you to observe and control connected Z-Wave devices. Z-Wave support requires a <a href="https://github.com/OpenZWave/open-zwave/wiki/Controller-Compatibility-List">supported Z-Wave USB stick</a> to be plugged into the host.</p>
<p>Please see the <a href="/getting-started/z-wave/">getting started section</a> for in-depth documentation on how to use the Z-Wave component.</p>
<p>There is currently support for switches, lights and sensors. All will be picked up automatically after configuring this platform.</p>
<h3><a class="title-link" name="installation" href="#installation"></a> Installation</h3>
<p>To allow Home Assistant to talk to your Z-Wave USB stick you will have to compile the OpenZWave library and install the related <a href="https://github.com/OpenZWave/python-openzwave">python-OpenZWave package</a>. This can be done as follows. <em>(Note: The Home Assistant docker image has support for Z-Wave built-in)</em></p>
<p>Make sure you have the correct dependencies installed before running the script:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>$ sudo apt-get install cython3 libudev-dev python3-sphinx python3-setuptools
</pre></div>
</div>
</div>
<p>Make sure you have at least version 0.23 of cython.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>$ sudo pip3 install --upgrade cython
</pre></div>
</div>
</div>
<p>Then get the OpenZWave files and switch to the <code>python3</code> branch:</p>
<p class="note warning">Do not use root to build python-openzwave as it will surely fail.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>$ 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
</pre></div>
</div>
</div>
<p class="note">
Instead of <code>make install</code>, you can alternatively build your own python-openzwave package which can be easily uninstalled:
<code>$ sudo PYTHON_EXEC=$(which python3) checkinstall --pkgname python-openzwave --pkgversion 1.0 --provides python-openzwave</code>
</p>
<p>With this installation, your <code>config_path</code> needed below will resemble:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>/usr/local/lib/python3.4/dist-packages/libopenzwave-0.3.0b8-py3.4-linux-x86_64.egg/config
</pre></div>
</div>
</div>
<h3><a class="title-link" name="configuration" href="#configuration"></a> Configuration</h3>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span>
<span class="key">zwave</span>:
<span class="key">usb_path</span>: <span class="string"><span class="content">/dev/ttyUSB0</span></span>
<span class="key">config_path</span>: <span class="string"><span class="content">/usr/local/share/python-openzwave/config</span></span>
<span class="key">polling_interval</span>: <span class="string"><span class="content">60000</span></span>
<span class="key">customize</span>:
<span class="key">sensor.greenwave_powernode_6_port_energy_10</span>:
<span class="key">polling_intensity</span>: <span class="string"><span class="content">1</span></span>
</pre></div>
</div>
</div>
<p>Configuration variables:</p>
<ul>
<li><strong>usb_path</strong> (<em>Required</em>): The port where your device is connected to your Home Assistant host.</li>
<li><strong>config_path</strong> (<em>Optional</em>): The path to the Python Open Z-Wave configuration files.</li>
<li><strong>autoheal</strong> (<em>Optional</em>): Allows disabling auto ZWave heal at midnight. Defaults to True.</li>
<li><strong>polling_interval</strong> (<em>Optional</em>): 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.</li>
<li><strong>customize</strong> (<em>Optional</em>): This attribute contains node-specific override values:
<ul>
<li><strong>polling_intensity</strong> (<em>Optional</em>): 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.</li>
</ul>
</li>
</ul>
<p>To find the path of your Z-Wave stick, run:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>$ ls /dev/ttyUSB*
</pre></div>
</div>
</div>
<p>Or, on some other systems (such as Raspberry Pi), use:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>$ ls /dev/ttyACM*
</pre></div>
</div>
</div>
<p class="note">
Depending on whats plugged into your USB ports, the name found above may change. You can lock in a name, such as <code>/dev/zwave</code>, by following <a href="http://hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices/">these instructions</a>.
</p>
<h4><a class="title-link" name="events" href="#events"></a> Events</h4>
<p>Some devices can also trigger scene activation events, which can be used in automation scripts (for example the press of a button on a wall switch):</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="comment"># Example configuration.yaml automation entry</span>
<span class="key">automation</span>:
- <span class="string"><span class="content">alias: Turn on Desk light</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">event</span></span>
<span class="key">event_type</span>: <span class="string"><span class="content">zwave.scene_activated</span></span>
<span class="key">event_data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">zwaveme_zme_wallcs_secure_wall_controller_8</span></span>
<span class="key">scene_id</span>: <span class="string"><span class="content">11</span></span>
</pre></div>
</div>
</div>
<p>The <em>entity_id</em> and <em>scene_id</em> of all triggered events can be seen in the console output.</p>
<h4><a class="title-link" name="services" href="#services"></a> Services</h4>
<p>The Z-Wave component exposes four services to help maintain the network.</p>
<table>
<thead>
<tr>
<th>Service</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>add_node</td>
<td>Put the zwave controller in inclusion mode. Allows one to add a new device to the zwave network.</td>
</tr>
<tr>
<td>remove_node</td>
<td>Put the zwave controller in exclusion mode. Allows one to remove a device from the zwave network.</td>
</tr>
<tr>
<td>heal_network</td>
<td>Tells the controller to “heal” the network. Bascially asks the nodes to tell the controller all of their neighbors so the controller can refigure out optimal routing.</td>
</tr>
<tr>
<td>soft_reset</td>
<td>Tells the controller to do a “soft reset”. This is not supposed to lose any data, but different controllers can behave differently to a “soft reset” command.</td>
</tr>
<tr>
<td>test_network</td>
<td>Tells the controller to send no-op commands to each node and measure the time for a response. In theory, this can also bring back nodes which have been marked “presumed dead”.</td>
</tr>
</tbody>
</table>
<p>The soft_reset and heal_network commands can be used as part of an automation script<br />
to help keep a zwave network running relliably. For example:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="comment"># Example configuration.yaml automation entry</span>
<span class="key">automation</span>:
- <span class="string"><span class="content">alias: soft reset at 2:30am</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">time</span></span>
<span class="key">after</span>: <span class="string"><span class="content">'2:30:00'</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">zwave.soft_reset</span></span>
- <span class="string"><span class="content">alias: heal at 2:31am</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">time</span></span>
<span class="key">after</span>: <span class="string"><span class="content">'2:31:00'</span></span>
<span class="key">action</span>:
<span class="key">service</span>: <span class="string"><span class="content">zwave.heal_network</span></span>
</pre></div>
</div>
</div>
<h4><a class="title-link" name="device-specific-notes--configuration" href="#device-specific-notes--configuration"></a> Device Specific Notes &amp; Configuration</h4>
<h5><a class="title-link" name="aeon-minimote" href="#aeon-minimote"></a> Aeon Minimote</h5>
<p>Heres a handy configuration for the Aeon Labs Minimote that defines all possible button presses. Put it into <code>automation.yaml</code>.</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre>- <span class="string"><span class="content">alias: Minimote Button 1 Pressed</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">event</span></span>
<span class="key">event_type</span>: <span class="string"><span class="content">zwave.scene_activated</span></span>
<span class="key">event_data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">aeon_labs_minimote_1</span></span>
<span class="key">scene_id</span>: <span class="string"><span class="content">1</span></span>
- <span class="string"><span class="content">alias: Minimote Button 1 Held</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">event</span></span>
<span class="key">event_type</span>: <span class="string"><span class="content">zwave.scene_activated</span></span>
<span class="key">event_data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">aeon_labs_minimote_1</span></span>
<span class="key">scene_id</span>: <span class="string"><span class="content">2</span></span>
- <span class="string"><span class="content">alias: Minimote Button 2 Pressed</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">event</span></span>
<span class="key">event_type</span>: <span class="string"><span class="content">zwave.scene_activated</span></span>
<span class="key">event_data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">aeon_labs_minimote_1</span></span>
<span class="key">scene_id</span>: <span class="string"><span class="content">3</span></span>
- <span class="string"><span class="content">alias: Minimote Button 2 Held</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">event</span></span>
<span class="key">event_type</span>: <span class="string"><span class="content">zwave.scene_activated</span></span>
<span class="key">event_data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">aeon_labs_minimote_1</span></span>
<span class="key">scene_id</span>: <span class="string"><span class="content">4</span></span>
- <span class="string"><span class="content">alias: Minimote Button 3 Pressed</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">event</span></span>
<span class="key">event_type</span>: <span class="string"><span class="content">zwave.scene_activated</span></span>
<span class="key">event_data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">aeon_labs_minimote_1</span></span>
<span class="key">scene_id</span>: <span class="string"><span class="content">5</span></span>
- <span class="string"><span class="content">alias: Minimote Button 3 Held</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">event</span></span>
<span class="key">event_type</span>: <span class="string"><span class="content">zwave.scene_activated</span></span>
<span class="key">event_data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">aeon_labs_minimote_1</span></span>
<span class="key">scene_id</span>: <span class="string"><span class="content">6</span></span>
- <span class="string"><span class="content">alias: Minimote Button 4 Pressed</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">event</span></span>
<span class="key">event_type</span>: <span class="string"><span class="content">zwave.scene_activated</span></span>
<span class="key">event_data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">aeon_labs_minimote_1</span></span>
<span class="key">scene_id</span>: <span class="string"><span class="content">7</span></span>
- <span class="string"><span class="content">alias: Minimote Button 4 Held</span></span>
<span class="key">trigger</span>:
<span class="key">platform</span>: <span class="string"><span class="content">event</span></span>
<span class="key">event_type</span>: <span class="string"><span class="content">zwave.scene_activated</span></span>
<span class="key">event_data</span>:
<span class="key">entity_id</span>: <span class="string"><span class="content">aeon_labs_minimote_1</span></span>
<span class="key">scene_id</span>: <span class="string"><span class="content">8</span></span>
</pre></div>
</div>
</div>
<h5><a class="title-link" name="aeotec-multisensor-6" href="#aeotec-multisensor-6"></a> Aeotec MultiSensor 6</h5>
<p>In order for Home Assistant to recognize well the motion sensor, you will need to change its configuration from <code>Basic Set (default)</code> to <code>Binary Sensor report</code>. Currently theres no way to do this in Home Assistant but you can use ozwcp (OpenZWave control panel), Domoticz or similar to do it</p>
</article>