Site updated at 2017-11-20 19:38:21 UTC

This commit is contained in:
Travis CI 2017-11-20 19:38:22 +00:00
parent b71eea47ee
commit 64387822f3
29 changed files with 176 additions and 124 deletions

View file

@ -94,10 +94,8 @@
<span class="pi">-</span> <span class="s">left</span>
<span class="pi">-</span> <span class="s">menu</span>
<span class="pi">-</span> <span class="s">select</span>
<span class="s">device</span><span class="pi">:</span> <span class="s1">'</span><span class="s">'</span>
</code></pre>
</div>
<p>Please note that <code class="highlighter-rouge">device</code> must be specified (because of validation) but is not used by this platform. So you may specify any value.</p>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">

View file

@ -106,7 +106,7 @@ set for your Hub so the platform knows what Hub you are trying to configure.</p>
<li><strong>name</strong> (<em>Required</em>): The hubs name to display in the frontend.</li>
<li><strong>host</strong> (<em>Optional</em>): The Harmony devices IP address. Leave empty for the IP to be discovered automatically.</li>
<li><strong>port</strong> (<em>Optional</em>): The Harmony devices port. Defaults to 5222.</li>
<li><strong>activity</strong> (<em>Optional</em>): Activity to use when turnon service is called without any data.</li>
<li><strong>activity</strong> (<em>Optional</em>): Activity to use when <code class="highlighter-rouge">turn_on</code> service is called without any data.</li>
<li><strong>delay_secs</strong> (<em>Optional</em>): Default duration in seconds between sending commands to a device.</li>
</ul>
<p>Configuration file:</p>
@ -116,28 +116,115 @@ set for your Hub so the platform knows what Hub you are trying to configure.</p>
<li>List of all programmed device names and ID numbers</li>
<li>List of all available commands per programmed device</li>
</ul>
<p>Supported services:</p>
<ul>
<li><strong>Turn Off</strong>: Turn off all devices that were switched on from the start of the current activity.s</li>
<li><strong>Turn On</strong>: Start an activity, will start the default activity from configuration.yaml if no activity is specified. The specified activity can either be the activity name or the activity ID from the configuration file written to your <a href="/docs/configuration/">Home Assistant configuration directory</a>.</li>
<li><strong>Send Command</strong>: Send a single command or a set of commands to one device, device ID and available commands are written to the configuration file at startup. You can optionally specify the number of times you wish to repeat the command(s) and delay you want between repeated command(s).</li>
<li><strong>Sync</strong>: Synchronizes the Harmony device with the Harmony web service if any changes are made from the web portal or app.</li>
</ul>
<h3><a class="title-link" name="examples" href="#examples"></a> Examples</h3>
<p>A template switch can be used to display and control the state of an activity in the frontend.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">switch</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">template</span>
<span class="s">switches</span><span class="pi">:</span>
<span class="s">tv</span><span class="pi">:</span>
<span class="s">value_template</span><span class="pi">:</span> <span class="s2">"</span><span class="s">{%</span><span class="nv"> </span><span class="s">if</span><span class="nv"> </span><span class="s">is_state('remote.family_room',</span><span class="nv"> </span><span class="s">'on')</span><span class="nv"> </span><span class="s">%}on{%</span><span class="nv"> </span><span class="s">else</span><span class="nv"> </span><span class="s">%}off{%</span><span class="nv"> </span><span class="s">endif</span><span class="nv"> </span><span class="s">%}"</span>
<span class="s">turn_on</span><span class="pi">:</span>
<span class="s">service</span><span class="pi">:</span> <span class="s">remote.turn_on</span>
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">remote.family_room</span>
<span class="s">turn_off</span><span class="pi">:</span>
<span class="s">service</span><span class="pi">:</span> <span class="s">remote.turn_off</span>
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">remote.family_room</span>
<h3><a class="title-link" name="service-remoteturn_off" href="#service-remoteturn_off"></a> Service <code class="highlighter-rouge">remote.turn_off</code></h3>
<p>Turn off all devices that were switched on from the start of the current activity.</p>
<table>
<thead>
<tr>
<th>Service data attribute</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge">entity_id</code></td>
<td>yes</td>
<td>Only act on a specific remote, else target all.</td>
</tr>
</tbody>
</table>
<h3><a class="title-link" name="service-remoteturn_on" href="#service-remoteturn_on"></a> Service <code class="highlighter-rouge">remote.turn_on</code></h3>
<p>Start an activity. Will start the default <code class="highlighter-rouge">activity</code> from configuration.yaml if no activity is specified. The specified activity can either be the activity name or the activity ID from the configuration file written to your <a href="/docs/configuration/">Home Assistant configuration directory</a>.</p>
<table>
<thead>
<tr>
<th>Service data attribute</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge">entity_id</code></td>
<td>yes</td>
<td>Only act on a specific remote, else target all.</td>
</tr>
<tr>
<td><code class="highlighter-rouge">activity</code></td>
<td>yes</td>
<td>Activity ID or Activity Name to start.</td>
</tr>
</tbody>
</table>
<h3><a class="title-link" name="service-remotesend_command" href="#service-remotesend_command"></a> Service <code class="highlighter-rouge">remote.send_command</code></h3>
<p>Send a single command or a set of commands to one device, device ID and available commands are written to the configuration file at startup. You can optionally specify the number of times you wish to repeat the command(s) and delay you want between repeated command(s).</p>
<table>
<thead>
<tr>
<th>Service data attribute</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge">entity_id</code></td>
<td>yes</td>
<td>Only act on a specific remote, else target all.</td>
</tr>
<tr>
<td><code class="highlighter-rouge">device</code></td>
<td>no</td>
<td>Device ID to send the command to.</td>
</tr>
<tr>
<td><code class="highlighter-rouge">command</code></td>
<td>no</td>
<td>A single command or a list of commands to send.</td>
</tr>
<tr>
<td><code class="highlighter-rouge">num_repeats</code></td>
<td>yes</td>
<td>The number of times to repeat the command(s).</td>
</tr>
<tr>
<td><code class="highlighter-rouge">delay_secs</code></td>
<td>yes</td>
<td>The number of seconds between sending each command.</td>
</tr>
</tbody>
</table>
<p>A typical service call for sending several button presses looks like this:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">service</span><span class="pi">:</span> <span class="s">remote.send_command</span>
<span class="s">data</span><span class="pi">:</span>
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">remote.tv_room</span>
<span class="s">command</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">home</span>
<span class="pi">-</span> <span class="s">1</span>
<span class="pi">-</span> <span class="s">2</span>
<span class="s">delay_secs</span><span class="pi">:</span> <span class="s">0.6</span>
</code></pre>
</div>
<h3><a class="title-link" name="service-remoteharmony_sync" href="#service-remoteharmony_sync"></a> Service <code class="highlighter-rouge">remote.harmony_sync</code></h3>
<p>Synchronize the Harmony device with the Harmony web service if any changes are made from the web portal or app.</p>
<table>
<thead>
<tr>
<th>Service data attribute</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge">entity_id</code></td>
<td>yes</td>
<td>Only act on a specific remote, else target all.</td>
</tr>
</tbody>
</table>
<h3><a class="title-link" name="examples" href="#examples"></a> Examples</h3>
<p>Template sensors can be utilized to display current activity in the frontend.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">sensor</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">template</span>
@ -174,40 +261,6 @@ set for your Hub so the platform knows what Hub you are trying to configure.</p>
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">input_boolean.notify</span>
</code></pre>
</div>
<p>The automation example below shows how to send a command via the harmony remote using the <code class="highlighter-rouge">send_command</code> service to send the Pause command to the hub, which is already defined as an IR code for each device to be used via the Harmony app. It is checking for the activity name as exposed through the sensor in the harmony remote component using Jinja if statements to set the device_id, sending the correct Pause command for the given activity. This requires checking your activity list and device_id from the <code class="highlighter-rouge">harmony_REMOTENAME.conf</code> file created when you start the component. In this example, the harmony hub is named bedroom.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">automation</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Harmony Pause contextual for activity</span>
<span class="s">trigger</span><span class="pi">:</span>
<span class="c1"># trigger happens to be from a flic button - could be any valid event</span>
<span class="s">platform</span><span class="pi">:</span> <span class="s">event</span>
<span class="s">event_type</span><span class="pi">:</span> <span class="s">flic_click</span>
<span class="s">event_data</span><span class="pi">:</span>
<span class="s">button_name</span><span class="pi">:</span> <span class="s">flic_80e4da70bbb1</span>
<span class="s">click_type</span><span class="pi">:</span> <span class="s">double</span>
<span class="s">action</span><span class="pi">:</span>
<span class="s">service</span><span class="pi">:</span> <span class="s">remote.send_command</span>
<span class="s">data_template</span><span class="pi">:</span>
<span class="c1"># using a data template to have if brances for relevant device</span>
<span class="c1"># Always the same entity_id - the harmony hub</span>
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">remote.bedroom</span>
<span class="c1"># Always the same command - the Pause key</span>
<span class="s">command</span><span class="pi">:</span> <span class="s">Pause</span>
<span class="c1"># select device based upon the activity being undertaken.</span>
<span class="s">device</span><span class="pi">:</span> <span class="pi">&gt;</span>
<span class="no"># when in WATCH TV activity, the pause key relates to a TiVo, which is device 22987101</span>
<span class="no">{% if is_state("sensor.bedroom", "WATCH TV") %}{% raw %}</span>
<span class="no">22987101</span>
<span class="no"># when in WATCH APPLE TV activity, the pause key relates to an Apple TV, which is device 23002316</span>
<span class="no">{% raw %}{% elif is_state("sensor.bedroom", "WATCH APPLE TV") %}</span>
<span class="no">23002316</span>
<span class="no">{% elif is_state("sensor.bedroom", "PLEX") %}</span>
<span class="no">23048786</span>
<span class="no">{% elif is_state("sensor.bedroom", "WATCH BLU RAY") %}</span>
<span class="no">23043122</span>
<span class="no">{% endif %}</span>
</code></pre>
</div>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">

View file

@ -111,7 +111,7 @@
</ul>
</li>
</ul>
<p>An example to call the component from developer tools using the remote, send_command service <code class="highlighter-rouge"><span class="p">{</span><span class="w"> </span><span class="nt">"entity_id"</span><span class="p">:</span><span class="s2">"remote.tv"</span><span class="p">,</span><span class="w"> </span><span class="nt">"device"</span><span class="p">:</span><span class="s2">"0"</span><span class="p">,</span><span class="w"> </span><span class="nt">"command"</span><span class="p">:</span><span class="s2">"menu"</span><span class="w"> </span><span class="p">}</span></code></p>
<p>An example to call the component from developer tools using the <code class="highlighter-rouge">remote.send_command</code> service: <code class="highlighter-rouge"><span class="p">{</span><span class="w"> </span><span class="nt">"entity_id"</span><span class="p">:</span><span class="s2">"remote.tv"</span><span class="p">,</span><span class="w"> </span><span class="nt">"command"</span><span class="p">:</span><span class="s2">"menu"</span><span class="w"> </span><span class="p">}</span></code></p>
<p>Note: Global Cache devices expect data in their own format of “sendir…”. This component converts hex code to Global Cache IR form.</p>
<p>API Docs:</p>
<ul>

View file

@ -77,7 +77,7 @@
<p>Keeps track which remotes are in your environment, their state and allows you to control them.</p>
<ul>
<li>Maintains a state per remote and a combined state <code class="highlighter-rouge">all_remotes</code>.</li>
<li>Registers services <code class="highlighter-rouge">remote/turn_on</code>, <code class="highlighter-rouge">remote/turn_off</code>, <code class="highlighter-rouge">remote/toggle</code>, <code class="highlighter-rouge">remote/sync</code>, and <code class="highlighter-rouge">remote/send_command</code> to control remotes.</li>
<li>Registers services <code class="highlighter-rouge">remote/turn_on</code>, <code class="highlighter-rouge">remote/turn_off</code>, <code class="highlighter-rouge">remote/toggle</code>, and <code class="highlighter-rouge">remote/send_command</code> to control remotes.</li>
</ul>
<h3><a class="title-link" name="use-the-services" href="#use-the-services"></a> Use the services</h3>
<p>Go to the <strong>Developer Tools</strong>, then to <strong>Call Service</strong> in the frontend, and choose <code class="highlighter-rouge">remote/turn_on</code>, <code class="highlighter-rouge">remote/turn_off</code>, or <code class="highlighter-rouge">remote/toggle</code> from the list of available services (<strong>Available services:</strong> on the left). Enter something like the sample below into the <strong>Service Data</strong> field and hit <strong>Call Service</strong>.</p>
@ -96,10 +96,11 @@
<tr>
<td><code class="highlighter-rouge">entity_id</code></td>
<td>yes</td>
<td>Only act on specific remote. Else targets all.</td>
<td>Only act on a specific remote, else target all.</td>
</tr>
</tbody>
</table>
<p>See the platform documentation for each type of remote for more detailed examples.</p>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">