Site updated at 2016-07-14 13:35:51 UTC
This commit is contained in:
parent
030ba6f0e9
commit
94524d7954
23 changed files with 52 additions and 38 deletions
|
@ -91,7 +91,7 @@
|
|||
|
||||
<p>The <code>template</code> platform supports sensors which breaks out the state and <code>state_attributes</code> from other entities.</p>
|
||||
|
||||
<p>To enable Template sensors in your installation, add the following to your <code>configuration.yaml</code> file:</p>
|
||||
<p>To enable Template binary sensors in your installation, add the following to your <code>configuration.yaml</code> file:</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span>
|
||||
|
@ -131,10 +131,10 @@
|
|||
<div class="code"><pre><span class="key">sensor</span>:
|
||||
<span class="key">platform</span>: <span class="string"><span class="content">template</span></span>
|
||||
<span class="key">sensors</span>:
|
||||
<span class="key">furnace_on</span>:
|
||||
<span class="key">value_template</span>: <span class="string"><span class="content">{{ states.sensor.furnace.state > 2.5 }}</span></span>
|
||||
<span class="key">friendly_name</span>: <span class="string"><span class="content">'Furnace Running</span></span>
|
||||
<span class="key">sensor_class</span>: <span class="string"><span class="content">heat</span></span>
|
||||
<span class="key">furnace_on</span>:
|
||||
<span class="key">value_template</span>: <span class="string"><span class="content">{{ states.sensor.furnace.state > 2.5 }}</span></span>
|
||||
<span class="key">friendly_name</span>: <span class="string"><span class="content">'Furnace Running</span></span>
|
||||
<span class="key">sensor_class</span>: <span class="string"><span class="content">heat</span></span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -124,12 +124,16 @@
|
|||
<li><strong>file_path</strong> (<em>Optional</em>): Save the picture in a custom file path (default: camera components folder)</li>
|
||||
</ul>
|
||||
|
||||
<p>The given <strong>file_path</strong> must be an existing file because the camera platform setup make a writeable check on it.<br />
|
||||
Ensure that the Home Assistant user is in the video group.<br />
|
||||
eg.<br />
|
||||
<code>
|
||||
sudo usermod -a -G video hass
|
||||
</code></p>
|
||||
<p>The given <strong>file_path</strong> must be an existing file because the camera platform setup make a writeable check on it.</p>
|
||||
|
||||
<p>Ensure that the user who is running Home Assistant is in the video group. Eg. for the user <code>hass</code>:</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ sudo usermod -a -G video hass
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
|
|
@ -157,6 +157,16 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<p>By comparing the details published on the <a href="/topics/templating/">template</a> page the same can be archived with a different approach:</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="key">value_template</span>: <span class="string"><span class="delimiter">"</span><span class="content">{%if states.sensor.ENTITY_ID.state == 'on' %}running{%elif states.switch.ENTITY_ID.state == 'off' %}not running{% endif %}</span><span class="delimiter">"</span></span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>The <a href="/components/binary_sensor.template/">Binary template sensor</a> is the one in similar cases if you prefer to see an icon instead of text.</p>
|
||||
|
||||
<h3><a class="title-link" name="multiline-example-with-an-if-test-and-warnings-disabled" href="#multiline-example-with-an-if-test-and-warnings-disabled"></a> Multiline example with an if test (and warnings disabled)</h3>
|
||||
|
||||
<p>This example shows a multiple line template with and if test. It looks at a sensing switch and shows on/off in the frontend. It disables warnings to avoid log messages where the switch it depends on isn’t loaded yet.</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue