Update integrations that are ManualTriggerEntity with template information (#35730)

This commit is contained in:
G Johansson 2024-11-21 20:46:30 +01:00 committed by GitHub
parent 2c567a87ae
commit 72d08b024b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 43 additions and 0 deletions

View 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 %}

View File

@ -151,6 +151,8 @@ params:
type: [list, template] type: [list, template]
{% endconfiguration %} {% endconfiguration %}
{% include integrations/using_templates.md %}
## Examples ## Examples
In this section you find some real-life examples of how to use this sensor. In this section you find some real-life examples of how to use this sensor.

View File

@ -296,6 +296,8 @@ While `command` is accepting a template for `sensor` and `binary_sensor`, it's o
{% endnote %} {% endnote %}
{% include integrations/using_templates.md %}
## Binary sensor ## Binary sensor
To use your Command binary sensor in your installation, add the following to your {% term "`configuration.yaml`" %} file: To use your Command binary sensor in your installation, add the following to your {% term "`configuration.yaml`" %} file:

View File

@ -80,3 +80,5 @@ data:
{% endconfiguration %} {% endconfiguration %}
To use notifications, please see the [getting started with automation page](/getting-started/automation/). To use notifications, please see the [getting started with automation page](/getting-started/automation/).
{% include integrations/using_templates.md %}

View File

@ -189,3 +189,6 @@ binary_sensor:
{% important %} {% important %}
Use either `resource` or `resource_template`. Use either `resource` or `resource_template`.
{% endimportant %} {% endimportant %}
{% include integrations/using_templates.md %}

View File

@ -160,6 +160,8 @@ sensor:
default: None default: None
{% endconfiguration %} {% endconfiguration %}
{% include integrations/using_templates.md %}
## Examples ## 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. 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.

View File

@ -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. The response is expected to be a dictionary or a list with a dictionary as its 0th element.
{% include integrations/using_templates.md %}
## Examples ## Examples
In this section you find some real-life examples of how to use this sensor. In this section you find some real-life examples of how to use this sensor.

View File

@ -24,6 +24,9 @@ There is currently support for the following device types within Home Assistant:
- [Presence detection](#presence-detection) - [Presence detection](#presence-detection)
- [Sensor](#sensor) - [Sensor](#sensor)
- [Finding OIDs](#finding-oids)
- [Examples](#examples)
- [Printer uptime minutes](#printer-uptime-minutes)
- [Switch](#switch) - [Switch](#switch)
{% important %} {% 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. 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 ## 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. 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.

View File

@ -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. Note that in all cases only the first row returned will be used.
{% include integrations/using_templates.md %}
## Examples ## Examples
In this section, you find some real-life examples of how to use this sensor. In this section, you find some real-life examples of how to use this sensor.

View File

@ -102,6 +102,8 @@ verify_ssl:
Make sure that the URL matches exactly your endpoint or resource. Make sure that the URL matches exactly your endpoint or resource.
{% endimportant %} {% endimportant %}
{% include integrations/using_templates.md %}
## Example ## Example
### Switch with templated value ### Switch with templated value