Site updated at 2017-10-24 19:21:09 UTC

This commit is contained in:
Travis CI 2017-10-24 19:21:09 +00:00
parent a0c29a34a4
commit 882302d13b
26 changed files with 82 additions and 80 deletions

View file

@ -74,13 +74,13 @@
</h1>
</header>
<hr class="divider">
<p>The <code class="highlighter-rouge">rflink</code> component support devices that use <a href="http://www.nemcon.nl/blog2/">RFLink gateway firmware</a>, for example the <a href="https://www.nodo-shop.nl/nl/21-rflink-gateway">Nodo RFLink Gateway</a>. RFLink gateway is an Arduino Mega firmware that allows two-way communication with a multitude of RF wireless devices using cheap hardware (Arduino + transceiver).</p>
<p>The <code class="highlighter-rouge">rflink</code> component supports devices that use <a href="http://www.nemcon.nl/blog2/">RFLink gateway firmware</a>, for example the <a href="https://www.nodo-shop.nl/nl/21-rflink-gateway">Nodo RFLink Gateway</a>. RFLink Gateway is an Arduino Mega firmware that allows two-way communication with a multitude of RF wireless devices using cheap hardware (Arduino + transceiver).</p>
<p>The 433 MHz spectrum is used by many manufacturers mostly using their own protocol/standard and includes devices like: light switches, blinds, weather stations, alarms and various other sensors.</p>
<p>RFLink Gateway supports a number of RF frequencies, using a wide range of low-cost hardware. Their website provides details for various RF transmitter, receiver and transceiver modules for 433MHz, 868MHz and 2.4 GHz <a href="http://www.nemcon.nl/blog2/wiring">here.</a></p>
<p>RFLink Gateway supports a number of RF frequencies, using a wide range of low-cost hardware. <a href="http://www.rflink.nl/blog2/">Their website</a> provides details for various RF transmitters, receivers and transceiver modules for 433MHz, 868MHz and 2.4 GHz.</p>
<p class="note">
Note: Versions later than R44 adds support for Ikea Ansluta, Philips Living Colors Gen1, MySensors devices.
Note: Versions later than R44 add support for Ikea Ansluta, Philips Living Colors Gen1 and MySensors devices.
</p>
<p>A complete list of devices supported by RFLink can be found <a href="http://www.nemcon.nl/blog2/devlist">here</a></p>
<p>A complete list of devices supported by RFLink can be found <a href="http://www.rflink.nl/blog2/devlist">here</a>.</p>
<p>This component is tested with the following hardware/software:</p>
<ul>
<li>Nodo RFLink Gateway V1.4/RFLink R46</li>
@ -96,7 +96,7 @@
<li><strong>port</strong> (<em>Required</em>): The path to RFLink USB/serial device or TCP port in TCP mode.</li>
<li><strong>host</strong> (<em>Optional</em>): Switches to TCP mode, connects to host instead of to USB/serial.</li>
<li><strong>wait_for_ack</strong> (<em>Optional</em>): Wait for RFLink to acknowledge commands sent before sending new command (slower but more reliable). Defaults to <code class="highlighter-rouge">True</code></li>
<li><strong>ignore_devices</strong> (<em>Optional</em>): List of devices ids to ignore. Supports wildcards (*) at the end.</li>
<li><strong>ignore_devices</strong> (<em>Optional</em>): List of device ids to ignore. Supports wildcards (*) at the end.</li>
<li><strong>reconnect_interval</strong> (<em>Optional</em>): Time in seconds between reconnect attempts.</li>
</ul>
<p>Complete example:</p>
@ -110,7 +110,7 @@
</code></pre>
</div>
<h3><a class="title-link" name="tcp-mode" href="#tcp-mode"></a> TCP mode</h3>
<p>TCP mode allows connect to a RFLink device over TCP/IP network. This is for example useful if placing the RFLink device next to the HA server is not optimal or desired (eg: bad reception).</p>
<p>TCP mode allows you to connect to an RFLink device over a TCP/IP network. This is useful if placing the RFLink device next to the HA server is not optimal or desired (eg: bad reception).</p>
<p>To expose the USB/serial interface over TCP on a different host (Linux) the following command can be used:</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>socat /dev/ttyACM0,b57600 TCP-LISTEN:1234,reuseaddr
</code></pre>
@ -118,7 +118,7 @@
<p>Other methods of exposing the serial interface over TCP are possible (eg: ESP8266 or using Arduino Wifi shield). Essentially the serial stream should be directly mapped to the TCP stream.</p>
<p>Tested with Wifi serial bridge <a href="https://github.com/jeelabs/esp-link/releases/tag/v2.2.3">esp-link V2.2.3</a> running on a NodeMCU (ESP8266 Wifi module) with ESP8266 TXD0 (pin D10) and RXD0 (pin D9) connected to Arduino MEGA 2560 RX (Pin 2) and TX (Pin 3) respectively.</p>
<p class="note warning">
Due to different logic levels, a voltage level shifter is required between the 3.3V NodeMCU and 5V Arduino MEGA 2560 pins. The BSS138 bidirectional logic level converter has been tested for serial pins and the <a href="https://www.aliexpress.com/item/8CH-IIC-I2C-Logic-Level-Converter-Bi-Directional-Module-DC-DC-5V-to-3-3V-Setp/32238089139.html">link</a> is recommended for the CC2500 transceiver (used for Ikea Ansluta and Living Colors)
Due to different logic levels, a voltage level shifter is required between the 3.3V NodeMCU and 5V Arduino MEGA 2560 pins. The BSS138 bidirectional logic level converter has been tested for serial pins and the <a href="https://www.aliexpress.com/item/8CH-IIC-I2C-Logic-Level-Converter-Bi-Directional-Module-DC-DC-5V-to-3-3V-Setp/32238089139.html">link</a> is recommended for the CC2500 transceiver (used for Ikea Ansluta and Philips Living Colors)
</p>
<p class="note">
When re-flashing the Arduino MEGA, disconnect the ESP8266 to avoid programming difficulties.
@ -130,7 +130,7 @@ When re-flashing the Arduino MEGA, disconnect the ESP8266 to avoid programming d
</code></pre>
</div>
<h3><a class="title-link" name="adding-devices-automatically" href="#adding-devices-automatically"></a> Adding devices Automatically</h3>
<p>In order to have your devices being detected and added automatically, you need to add the following to the configuration.
<p>In order to have your devices discovered automatically, you need to add the following to the configuration.
When pressing the button on the physical remote, RFLink detects the signal and the device should be added automatically to Home Assistant.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">light</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">rflink</span>
@ -144,7 +144,7 @@ When pressing the button on the physical remote, RFLink detects the signal and t
</code></pre>
</div>
<h3><a class="title-link" name="ignoring-devices" href="#ignoring-devices"></a> Ignoring devices</h3>
<p>RFLink platform can be configured to completely ignore a device on a platform level. This is useful when you have neighbors which also use 433 MHz technology.</p>
<p>The RFLink platform can be configured to completely ignore a device on a platform level. This is useful when you have neighbors which also use 433 MHz technology.</p>
<p>For example:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<span class="s">rflink</span><span class="pi">:</span>
@ -157,19 +157,21 @@ When pressing the button on the physical remote, RFLink detects the signal and t
</code></pre>
</div>
<p>This configuration will ignore the button <code class="highlighter-rouge">1</code> of the <code class="highlighter-rouge">newkaku</code> device with ID <code class="highlighter-rouge">000001</code>, all devices of the <code class="highlighter-rouge">digitech</code> protocol and all switches of the <code class="highlighter-rouge">kaku</code> protocol device with codewheel ID <code class="highlighter-rouge">1</code>.</p>
<p>Wildcards only work at the end of the ID, not in the middle of front!</p>
<p class="note">
Wildcards only work at the end of the ID, not in the middle or front!
</p>
<h3><a class="title-link" name="device-support" href="#device-support"></a> Device support</h3>
<p>Even though a lot of devices are supported by RFLink, not all have been tested/implemented. If you have a device supported by RFLink but not by this component please consider testing and adding support yourself or <a href="https://github.com/home-assistant/home-assistant/issues/new">create an issue</a> and mention <code class="highlighter-rouge">@aequitas</code> in the description.</p>
<h3><a class="title-link" name="device-incorrectly-identified" href="#device-incorrectly-identified"></a> Device Incorrectly Identified</h3>
<p>If you find a device is recognized differently, with different protocols or the ON OFF is swapped or detected as two ON commands, it can be overcome with the RFLink RF Signal Learning mechanism from RFLink Rev 46 (11 March 2017). <a href="http://www.nemcon.nl/blog2/faq#RFFind">Link to further detail.</a></p>
<h3><a class="title-link" name="technical-overview" href="#technical-overview"></a> Technical overview</h3>
<p>If you find a device is recognized differently, with different protocols or the ON OFF is swapped or detected as two ON commands, it can be overcome with the RFLink RF Signal Learning mechanism from RFLink Rev 46 (11 March 2017). <a href="http://www.rflink.nl/blog2/faq#RFFind">Link to further detail.</a></p>
<h3><a class="title-link" name="technical-overview" href="#technical-overview"></a> Technical Overview</h3>
<ul>
<li>The<code class="highlighter-rouge">rflink</code> Python module a asyncio transport/protocol is setup that fires an callback for every (valid/supported) packet received by the RFLink gateway.</li>
<li>This component uses this callback to distribute rflink packet events over Home Assistants bus which can be subscribed to by entities/platform implementations.</li>
<li>The platform implementation takes care of creating new devices (if enabled) for unseen incoming packet ids.</li>
<li>The<code class="highlighter-rouge">rflink</code> Python module is a asyncio transport/protocol which is setup to fire a callback for every (valid/supported) packet received by the RFLink gateway.</li>
<li>This component uses this callback to distribute rflink packet events over <a href="https://home-assistant.io/docs/configuration/events/">Home Assistants event bus</a> which can be subscribed to by entities/platform implementations.</li>
<li>The platform implementation takes care of creating new devices (if enabled) for unseen incoming packet IDs.</li>
<li>Device entities take care of matching to the packet ID, interpreting and performing actions based on the packet contents. Common entity logic is maintained in this main component.</li>
</ul>
<h3><a class="title-link" name="debug-logging" href="#debug-logging"></a> Debug logging</h3>
<h3><a class="title-link" name="debug-logging" href="#debug-logging"></a> Debug Logging</h3>
<p>For debugging purposes or context when investigating issues you can enable debug logging for Rflink with the following config snippet:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">logger</span><span class="pi">:</span>
<span class="s">default</span><span class="pi">:</span> <span class="s">error</span>