Site updated at 2017-10-15 20:54:25 UTC

This commit is contained in:
Travis CI 2017-10-15 20:54:25 +00:00
parent f4836a65ba
commit 8d71b901ea
220 changed files with 1794 additions and 1679 deletions

View file

@ -119,8 +119,16 @@ The frontend has a template editor developer tool to help develop and debug temp
<li><code class="highlighter-rouge">states('device_tracker.paulus')</code> will return the state string (not the object) of the given entity or <code class="highlighter-rouge">unknown</code> if it doesnt exist.</li>
<li><code class="highlighter-rouge">is_state('device_tracker.paulus', 'home')</code> will test if the given entity is specified state.</li>
<li><code class="highlighter-rouge">is_state_attr('device_tracker.paulus', 'battery', 40)</code> will test if the given entity is specified state.</li>
<li><code class="highlighter-rouge">now()</code> will be rendered as current time in your time zone.</li>
<li><code class="highlighter-rouge">utcnow()</code> will be rendered as UTC time.</li>
<li><code class="highlighter-rouge">now()</code> will be rendered as current time in your time zone.
<ul>
<li>For specific values: <code class="highlighter-rouge">now().second</code>, <code class="highlighter-rouge">now().minute</code>, <code class="highlighter-rouge">now().hour</code>, <code class="highlighter-rouge">now().day</code>, <code class="highlighter-rouge">now().month</code>, <code class="highlighter-rouge">now().year</code>, <code class="highlighter-rouge">now().weekday()</code> and <code class="highlighter-rouge">now().isoweekday()</code></li>
</ul>
</li>
<li><code class="highlighter-rouge">utcnow()</code> will be rendered as UTC time.
<ul>
<li>For specific values: <code class="highlighter-rouge">utcnow().second</code>, <code class="highlighter-rouge">utcnow().minute</code>, <code class="highlighter-rouge">utcnow().hour</code>, <code class="highlighter-rouge">utcnow().day</code>, <code class="highlighter-rouge">utcnow().month</code>, <code class="highlighter-rouge">utcnow().year</code>, <code class="highlighter-rouge">utcnow().weekday()</code> and <code class="highlighter-rouge">utcnow().isoweekday()</code>.</li>
</ul>
</li>
<li><code class="highlighter-rouge">as_timestamp()</code> will convert datetime object or string to UNIX timestamp</li>
<li><code class="highlighter-rouge">distance()</code> will measure the distance in meters between home, entity, coordinates.</li>
<li><code class="highlighter-rouge">closest()</code> will find the closest entity.</li>
@ -137,6 +145,9 @@ The frontend has a template editor developer tool to help develop and debug temp
<p class="note">
If your template uses an <code class="highlighter-rouge">entity_id</code> that begins with a number (example: <code class="highlighter-rouge">states.device_tracker.2008_gmc</code>) you must use a bracket syntax to avoid errors caused by rendering the <code class="highlighter-rouge">entity_id</code> improperly. In the example given, the correct syntax for the device tracker would be: <code class="highlighter-rouge">states.device_tracker['2008_gmc']</code>
</p>
<p class="note warning">
Rendering templates with time is dangerous as updates only trigger templates in sensors based on entity state changes.
</p>
<h2><a class="title-link" name="home-assistant-template-extensions" href="#home-assistant-template-extensions"></a> Home Assistant template extensions</h2>
<p>In templates, besides the normal <a href="/topics/state_object/">state object methods and properties</a>, there are also some extra things available:</p>
<ul>