mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 05:46:52 +00:00
Move templates to new topics section
This commit is contained in:
parent
cead30cb23
commit
6dc004875c
@ -79,6 +79,8 @@ collections:
|
||||
output: true
|
||||
cookbook:
|
||||
output: true
|
||||
topics:
|
||||
output: true
|
||||
|
||||
# ----------------------- #
|
||||
# 3rd Party Settings #
|
||||
|
@ -80,7 +80,7 @@ Out of the box, the component will do nothing. You have to teach it about all in
|
||||
|
||||
You can use [templates] for the values of `speech/text`, `card/title` and `card/content`.
|
||||
|
||||
[templates]: /getting-started/templating/
|
||||
[templates]: /topics/templating/
|
||||
|
||||
Configuring the Alexa component for the above intents would look like this:
|
||||
|
||||
|
@ -363,4 +363,4 @@ The Logbook component will show a line entry when an automation is triggered. Y
|
||||
|
||||

|
||||
|
||||
[template]: /getting-started/templating/
|
||||
[template]: /topics/templating/
|
||||
|
@ -33,7 +33,7 @@ Configuration variables:
|
||||
- **name** (*Optional*): Let you overwrite the the name of the device. By default *name* from the device is used.
|
||||
- **payload_on** (*Optional*): The payload that represents enabled state. Default is "ON".
|
||||
- **payload_off** (*Optional*): The payload that represents disabled state. Default is "OFF".
|
||||
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
|
||||
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
|
||||
|
||||
## {% linkable_title Examples %}
|
||||
|
||||
|
@ -35,7 +35,7 @@ Configuration variables:
|
||||
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0.
|
||||
- **payload_on** (*Optional*): The payload that represents on state. Default is "ON".
|
||||
- **payload_off** (*Optional*): The payload that represents state. Default is "OFF".
|
||||
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
|
||||
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
|
||||
|
||||
For a quick check you can use the commandline tools shipped with `mosquitto` to send MQTT messages. Set the state of your sensor manually:
|
||||
|
||||
|
@ -42,7 +42,7 @@ Configuration variables:
|
||||
|
||||
- **resource** (*Required*): The resource or endpoint that contains the value.
|
||||
- **method** (*Optional*): The method of the request. Default is GET.
|
||||
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract the value.
|
||||
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the value.
|
||||
- **payload** (*Optional*): The payload to send with a POST request. Usualy formed as a dictionary.
|
||||
- **name** (*Optional*): Name of the REST binary sensor.
|
||||
|
||||
|
@ -37,7 +37,7 @@ Configuration options for the a TCP Sensor:
|
||||
- **payload** (*Required*): What to send to the host in order to get the response we're interested in.
|
||||
- **value_on** (*Required*): The value returned when the device is "on".
|
||||
- **timeout** (*Optional*): How long in seconds to wait for a response from the service before giving up and disconnecting. Defaults to 10.
|
||||
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract the value. By default it's assumed that the entire response is the value.
|
||||
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the value. By default it's assumed that the entire response is the value.
|
||||
- **unit** (*Optional*): The unit of measurement to use for the value.
|
||||
- **buffer_size** (*Optional*): The size of the receive buffer in bytes. Set this to a larger value if you expect to receive a response larger than the default. Defaults to 1024.
|
||||
|
||||
|
@ -29,7 +29,7 @@ Configuration variables:
|
||||
- **sensors** array (*Required*): List of your sensors.
|
||||
- **friendly_name** (*Optional*): Name to use in the Frontend.
|
||||
- **sensor_class** (*Optional*): Defines the class of the sensor (motion, heat, moisture, etc)
|
||||
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
|
||||
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
|
||||
|
||||
|
||||
## {% linkable_title Examples %}
|
||||
|
@ -66,9 +66,9 @@ Configuration variables:
|
||||
- **brightness_command_topic** (*Optional*): The MQTT topic to publish commands to change the light's brightness.
|
||||
- **rgb_state_topic** (*Optional*): The MQTT topic subscribed to receive RGB state updates.
|
||||
- **rgb_command_topic** (*Optional*): The MQTT topic to publish commands to change the light's RGB state.
|
||||
- **state_value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract the state value.
|
||||
- **brightness_value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract the brightness value.
|
||||
- **rgb_value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract the RGB value.
|
||||
- **state_value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the state value.
|
||||
- **brightness_value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the brightness value.
|
||||
- **rgb_value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the RGB value.
|
||||
- **brightness_scale** (*Optional*): Defines the maximum brightness value (i.e. 100%) of the MQTT device (defaults to 255).
|
||||
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages.
|
||||
- **payload_on** (*Optional*): The payload that represents enabled state. Default is "ON".
|
||||
|
@ -46,7 +46,7 @@ Configuration variables:
|
||||
- **optimistic** (*Optional*): Flag that defines if lock works in optimistic mode. Default is true if no state topic defined, else false.
|
||||
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages.
|
||||
- **retain** (*Optional*): If the published message should have the retain flag on or not.
|
||||
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
|
||||
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
|
||||
|
||||
<p class='note warning'>
|
||||
Make sure that your topic match exact. `some-topic/` and `some-topic` are different topics.
|
||||
|
@ -122,7 +122,7 @@ Home Assistant will automatically load the correct certificate if you connect to
|
||||
|
||||
### {% linkable_title Publish service %}
|
||||
|
||||
The MQTT component will register the service `publish` which allows publishing messages to MQTT topics. There are two ways of specifiying your payload. You can either use `payload` to hard-code a payload or use `payload_template` to specify a [template](/getting-started/templating/) that will be rendered to generate the payload.
|
||||
The MQTT component will register the service `publish` which allows publishing messages to MQTT topics. There are two ways of specifiying your payload. You can either use `payload` to hard-code a payload or use `payload_template` to specify a [template](/topics/templating/) that will be rendered to generate the payload.
|
||||
|
||||
```json
|
||||
{
|
||||
|
@ -37,7 +37,7 @@ Once loaded, the `notify` platform will expose a service that can be called to s
|
||||
|
||||
The notification component supports specifying [templates] for both the `message` and the `title`. This will allow you to use the current state of Home Assistant in your notifications.
|
||||
|
||||
[templates]: /getting-started/templating/
|
||||
[templates]: /topics/templating/
|
||||
|
||||
### {% linkable_title Test if it works %}
|
||||
|
||||
|
@ -42,4 +42,4 @@ Configuration variables:
|
||||
- **payload_up** (*Optional*): The payload to open the rollershutter. Default is "OPEN".
|
||||
- **payload_down** (*Optional*): The payload to close the rollershutter. Default is "CLOSE".
|
||||
- **payload_stop** (*Optional*): The payload to stop the rollershutter. Default is "STOP".
|
||||
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
|
||||
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
|
||||
|
@ -45,11 +45,11 @@ Configuration variables:
|
||||
- **monitored_variables** array (*Optional*): List of exposed variables.
|
||||
- **name** (*Required*): The name of the variable you wish to monitor.
|
||||
- **unit** (*Optional*): Defines the units of measurement of the sensor, if any.
|
||||
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
|
||||
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
|
||||
- **pins** array (*Optional*): List of pins to monitor. Analog pins need a leading **A** for the pin number.
|
||||
- **name** (*Optional*): The name of the variable you wish to monitor.
|
||||
- **unit_of_measurement** (*Optional*): Defines the unit of measurement of the sensor, if any.
|
||||
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
|
||||
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
|
||||
|
||||
The variables in the `monitored_variables` array must be available in the response of the device. As a starting point you could use the one of the example sketches (eg. [Ethernet](https://raw.githubusercontent.com/marcoschwartz/aREST/master/examples/Ethernet/Ethernet.ino) for an Arduino with Ethernet shield). In those sketches are two variables (`temperature` and `humidity`) available which will act as endpoints.
|
||||
|
||||
|
@ -31,7 +31,7 @@ Configuration variables:
|
||||
- **command** (*Required*): The action to take to get the value.
|
||||
- **name** (*Optional*): Name of the command sensor.
|
||||
- **unit_of_measurement** (*Optional*): Defines the unit of measurement of the sensor, if any.
|
||||
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
|
||||
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
|
||||
|
||||
## {% linkable_title Examples %}
|
||||
|
||||
|
@ -33,7 +33,7 @@ Configuration variables:
|
||||
- **name** (*Optional*): The name of the sensor. Default is 'MQTT Sensor'.
|
||||
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0.
|
||||
- **unit_of_measurement** (*Optional*): Defines the units of measurement of the sensor, if any.
|
||||
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
|
||||
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
|
||||
|
||||
## {% linkable_title Examples %}
|
||||
|
||||
|
@ -44,7 +44,7 @@ Configuration variables:
|
||||
|
||||
- **resource** (*Required*): The resource or endpoint that contains the value.
|
||||
- **method** (*Optional*): The method of the request. Default is GET.
|
||||
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract the value.
|
||||
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the value.
|
||||
- **payload** (*Optional*): The payload to send with a POST request. Usualy formed as a dictionary.
|
||||
- **name** (*Optional*): Name of the REST sensor.
|
||||
- **unit_of_measurement** (*Optional*): Defines the unit of measurement of the sensor, if any.
|
||||
|
@ -34,7 +34,7 @@ Configuration options for the a TCP Sensor:
|
||||
- **port** (*Required*): The port to connect to the host on.
|
||||
- **payload** (*Required*): What to send to the host in order to get the response we're interested in.
|
||||
- **timeout** (*Optional*): How long in seconds to wait for a response from the service before giving up and disconnecting. Defaults to `10`
|
||||
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract the value. By default it's assumed that the entire response is the value.
|
||||
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the value. By default it's assumed that the entire response is the value.
|
||||
- **unit** (*Optional*): The unit of measurement to use for the value.
|
||||
- **buffer_size** (*Optional*): The size of the receive buffer in bytes. Set this to a larger value if you expect to receive a response larger than the default. Defaults to `1024`.
|
||||
|
||||
|
@ -32,7 +32,7 @@ Configuration variables:
|
||||
- **sensors** array (*Required*): List of your sensors.
|
||||
- **friendly_name** (*Optional*): Name to use in the Frontend.
|
||||
- **unit_of_measurement** (*Optional*): Defines the units of measurement of the sensor, if any.
|
||||
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
|
||||
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
|
||||
|
||||
|
||||
## {% linkable_title Examples %}
|
||||
|
@ -46,7 +46,7 @@ Configuration variables:
|
||||
- **optimistic** (*Optional*): Flag that defines if switch works in optimistic mode. Default is true if no state topic defined, else false.
|
||||
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages.
|
||||
- **retain** (*Optional*): If the published message should have the retain flag on or not.
|
||||
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
|
||||
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
|
||||
|
||||
<p class='note warning'>
|
||||
Make sure that your topic match exact. `some-topic/` and `some-topic` are different topics.
|
||||
|
@ -38,7 +38,7 @@ Configuration variables:
|
||||
|
||||
- **switches** array (*Required*): List of your switches.
|
||||
- **friendly_name** (*Optional*): Name to use in the Frontend.
|
||||
- **value_template** (*Required*): Defines a [template](/getting-started/templating/) to set the state of the switch.
|
||||
- **value_template** (*Required*): Defines a [template](/topics/templating/) to set the state of the switch.
|
||||
- **turn_on** (*Required*): Defines an [action](/getting-started/automation/) to run when the switch is turned on.
|
||||
- **turn_off** (*Required*): Defines an [action](/getting-started/automation/) to run when the switch is turned off.
|
||||
|
||||
|
@ -3,11 +3,11 @@
|
||||
<a>Getting started <i class="icon icon-caret-down"></i></a>
|
||||
<ul>
|
||||
<li><a href='/getting-started/'>Installing Home Assistant</a></li>
|
||||
<li><a href='/getting-started/configuration/'>Configuration basics</a></li>
|
||||
<li><a href='/getting-started/configuration/'>Configuration Basics</a></li>
|
||||
<li><a href='/getting-started/devices/'>Adding devices</a></li>
|
||||
<li><a href='/getting-started/presence-detection/'>Presence detection</a></li>
|
||||
<li><a href='/getting-started/presence-detection/'>Presence Detection</a></li>
|
||||
<li><a href='/getting-started/automation/'>Automation</a></li>
|
||||
<li><a href='/getting-started/templating/'>Templating</a></li>
|
||||
<li><a href='/topics/'>Advanced Topics</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href='/components/'>Components</a></li>
|
||||
@ -17,12 +17,12 @@
|
||||
<ul>
|
||||
<li><a href="/developers/">Setup Development</a></li>
|
||||
<li><a href="/developers/architecture/">Architecture</a></li>
|
||||
<li><a href="/developers/frontend/">Frontend development</a></li>
|
||||
<li><a href="/developers/frontend/">Frontend Development</a></li>
|
||||
<li><a href="/developers/creating_components/">
|
||||
Creating components
|
||||
Creating Components
|
||||
</a></li>
|
||||
<li><a href="/developers/add_new_platform/">
|
||||
Adding platform support
|
||||
Adding Platform Support
|
||||
</a></li>
|
||||
<li><a href="/developers/api/">API</a></li>
|
||||
<li><a href="/developers/credits/">Credits</a></li>
|
||||
|
@ -34,7 +34,7 @@ Alrighty, it's time for Home Assistant 0.10. A lot amazing things have changed a
|
||||
|
||||
[iCloud]: /components/device_tracker.icloud/
|
||||
[Twitch]: /components/sensor.twitch/
|
||||
[Template]: /getting-started/templating/
|
||||
[Template]: /topics/templating/
|
||||
[Heatmiser]: /components/thermostat.heatmiser/
|
||||
[Dweet.io]: /components/sensor.dweet/
|
||||
[Alexa/Amazon echo]: /components/alexa/
|
||||
|
@ -47,7 +47,7 @@ First release of 2016 and we are on 🔥! The [main repository][github-ha] has p
|
||||
[wemo]: /components/switch.wemo/
|
||||
[Telldus Live]: /components/tellduslive/
|
||||
[Vera]: /components/vera/
|
||||
[template helper method]: /getting-started/templating/#home-assistant-template-extensions
|
||||
[template helper method]: /topics/templating/#home-assistant-template-extensions
|
||||
[OwnTracks]: /components/device_tracker.owntracks/
|
||||
[Philips Hue]: /components/light.hue/
|
||||
[Free Mobile]: /components/notify.free_mobile/
|
||||
|
@ -5581,7 +5581,7 @@ case"touchend":return this.addPointerListenerEnd(t,e,i,n);case"touchmove":return
|
||||
|
||||
.rendered.error {
|
||||
color: red;
|
||||
}</style><template><partial-base narrow="[[narrow]]" show-menu="[[showMenu]]"><span header-title="">Template Editor</span><div class$="[[computeFormClasses(narrow)]]"><div class="edit-pane"><p>Templates are rendered using the Jinja2 template engine with some Home Assistant specific extensions.</p><ul><li><a href="http://jinja.pocoo.org/docs/dev/templates/" target="_blank">Jinja2 tempate documentation</a></li><li><a href="https://home-assistant.io/getting-started/templating/" target="_blank">Home Assistant template extensions</a></li></ul><p></p><paper-textarea label="Template" value="{{template}}"></paper-textarea></div><div class="render-pane"><paper-spinner class="render-spinner" active="[[rendering]]"></paper-spinner><pre class$="[[computeRenderedClasses(error)]]">[[processed]]</pre></div></div></partial-base></template></dom-module><dom-module id="partial-dev-info" assetpath="layouts/"><style>.content {
|
||||
}</style><template><partial-base narrow="[[narrow]]" show-menu="[[showMenu]]"><span header-title="">Template Editor</span><div class$="[[computeFormClasses(narrow)]]"><div class="edit-pane"><p>Templates are rendered using the Jinja2 template engine with some Home Assistant specific extensions.</p><ul><li><a href="http://jinja.pocoo.org/docs/dev/templates/" target="_blank">Jinja2 tempate documentation</a></li><li><a href="https://home-assistant.io/topics/templating/" target="_blank">Home Assistant template extensions</a></li></ul><p></p><paper-textarea label="Template" value="{{template}}"></paper-textarea></div><div class="render-pane"><paper-spinner class="render-spinner" active="[[rendering]]"></paper-spinner><pre class$="[[computeRenderedClasses(error)]]">[[processed]]</pre></div></div></partial-base></template></dom-module><dom-module id="partial-dev-info" assetpath="layouts/"><style>.content {
|
||||
margin-top: 64px;
|
||||
padding: 24px;
|
||||
background-color: white;
|
||||
|
@ -375,7 +375,7 @@ The result will include any changed states that changed while the service was be
|
||||
</p>
|
||||
|
||||
#### {% linkable_title POST /api/template %}
|
||||
Render a Home Assistant template. [See template docs for more information.](/getting-started/templating/)
|
||||
Render a Home Assistant template. [See template docs for more information.](/topics/templating/)
|
||||
|
||||
```json
|
||||
{
|
||||
|
1
source/getting-started/templating.html
Normal file
1
source/getting-started/templating.html
Normal file
@ -0,0 +1 @@
|
||||
<script>document.location = '/topics/templating/';</script>
|
20
source/topics/index.markdown
Normal file
20
source/topics/index.markdown
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
layout: page
|
||||
title: "Advanced Topics"
|
||||
description: "Documentation about the more advanced features in Home Assistant."
|
||||
date: 2016-03-12 12:00 -0800
|
||||
sidebar: false
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
regenerate: true
|
||||
hide_github_edit: true
|
||||
---
|
||||
|
||||
Home Assistant is built from many small building blocks that together offer a powerful and customizable system. This page is a collection of the more advanced topics.
|
||||
|
||||
{% assign topics = site.topics | sort: 'title' %}
|
||||
|
||||
{% for topic in topics %}
|
||||
* [{{topic.title}}]({{topic.url}})
|
||||
{% endfor %}
|
Loading…
x
Reference in New Issue
Block a user