mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-20 15:56:51 +00:00
Update integrations that are ManualTriggerEntity with template information (#35730)
This commit is contained in:
parent
2c567a87ae
commit
72d08b024b
21
source/_includes/integrations/using_templates.md
Normal file
21
source/_includes/integrations/using_templates.md
Normal file
@ -0,0 +1,21 @@
|
||||
### Using templates
|
||||
|
||||
For incoming data, a value template translates incoming JSON or raw data to a valid payload.
|
||||
Incoming payloads are rendered with possible JSON values, so when rendering, the `value_json` can be used to access the attributes in a JSON based payload, otherwise the `value` variable can be used for non-json based data.
|
||||
|
||||
Additional, the `this` can be used as variables in the template. The `this` attribute refers to the current [entity state](/docs/configuration/state_object) of the entity.
|
||||
Further information about `this` variable can be found in the [template documentation](/integrations/template/#template-and-action-variables)
|
||||
|
||||
{% note %}
|
||||
|
||||
**Example value template with json:**
|
||||
|
||||
With given payload:
|
||||
|
||||
```json
|
||||
{ "state": "ON", "temperature": 21.902 }
|
||||
```
|
||||
|
||||
Template {% raw %}`{{ value_json.temperature | round(1) }}`{% endraw %} renders to `21.9`.
|
||||
|
||||
{% endnote %}
|
@ -151,6 +151,8 @@ params:
|
||||
type: [list, template]
|
||||
{% endconfiguration %}
|
||||
|
||||
{% include integrations/using_templates.md %}
|
||||
|
||||
## Examples
|
||||
|
||||
In this section you find some real-life examples of how to use this sensor.
|
||||
|
@ -296,6 +296,8 @@ While `command` is accepting a template for `sensor` and `binary_sensor`, it's o
|
||||
|
||||
{% endnote %}
|
||||
|
||||
{% include integrations/using_templates.md %}
|
||||
|
||||
## Binary sensor
|
||||
|
||||
To use your Command binary sensor in your installation, add the following to your {% term "`configuration.yaml`" %} file:
|
||||
|
@ -80,3 +80,5 @@ data:
|
||||
{% endconfiguration %}
|
||||
|
||||
To use notifications, please see the [getting started with automation page](/getting-started/automation/).
|
||||
|
||||
{% include integrations/using_templates.md %}
|
||||
|
@ -189,3 +189,6 @@ binary_sensor:
|
||||
{% important %}
|
||||
Use either `resource` or `resource_template`.
|
||||
{% endimportant %}
|
||||
|
||||
|
||||
{% include integrations/using_templates.md %}
|
||||
|
@ -160,6 +160,8 @@ sensor:
|
||||
default: None
|
||||
{% endconfiguration %}
|
||||
|
||||
{% include integrations/using_templates.md %}
|
||||
|
||||
## Examples
|
||||
|
||||
In this section you find some real-life examples of how to use this sensor. There is also a [Jupyter notebook](https://nbviewer.jupyter.org/github/home-assistant/home-assistant-notebooks/blob/master/other/web-scraping.ipynb) available for this example to give you a bit more insight.
|
||||
|
@ -164,6 +164,8 @@ $ curl -X GET http://192.168.1.31/temperature/
|
||||
|
||||
The response is expected to be a dictionary or a list with a dictionary as its 0th element.
|
||||
|
||||
{% include integrations/using_templates.md %}
|
||||
|
||||
## Examples
|
||||
|
||||
In this section you find some real-life examples of how to use this sensor.
|
||||
|
@ -24,6 +24,9 @@ There is currently support for the following device types within Home Assistant:
|
||||
|
||||
- [Presence detection](#presence-detection)
|
||||
- [Sensor](#sensor)
|
||||
- [Finding OIDs](#finding-oids)
|
||||
- [Examples](#examples)
|
||||
- [Printer uptime minutes](#printer-uptime-minutes)
|
||||
- [Switch](#switch)
|
||||
|
||||
{% important %}
|
||||
@ -102,6 +105,8 @@ priv_key:
|
||||
|
||||
See the [device tracker integration page](/integrations/device_tracker/) for instructions how to configure the people to be tracked.
|
||||
|
||||
{% include integrations/using_templates.md %}
|
||||
|
||||
## Sensor
|
||||
|
||||
The `snmp` sensor platform displays information available through the [Simple Network Management Protocol (SNMP)](https://en.wikipedia.org/wiki/Simple_Network_Management_Protocol). SNMP uses a tree-like hierarchy where each node is an object, and is mainly supported by network-oriented devices such as routers, modems and printers.
|
||||
|
@ -130,6 +130,8 @@ There is no explicit configuration required for attributes. The integration will
|
||||
|
||||
Note that in all cases only the first row returned will be used.
|
||||
|
||||
{% include integrations/using_templates.md %}
|
||||
|
||||
## Examples
|
||||
|
||||
In this section, you find some real-life examples of how to use this sensor.
|
||||
|
@ -102,6 +102,8 @@ verify_ssl:
|
||||
Make sure that the URL matches exactly your endpoint or resource.
|
||||
{% endimportant %}
|
||||
|
||||
{% include integrations/using_templates.md %}
|
||||
|
||||
## Example
|
||||
|
||||
### Switch with templated value
|
||||
|
Loading…
x
Reference in New Issue
Block a user