mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 09:17:06 +00:00
Updated the templates (#5558)
* Updated the templates Added device class to the templates, and simplified them * Add raw * Add period
This commit is contained in:
parent
5391dadfbb
commit
141adba52c
@ -10,7 +10,7 @@ footer: true
|
|||||||
---
|
---
|
||||||
|
|
||||||
<p class='note'>
|
<p class='note'>
|
||||||
This is a work in progress, based upon reports in the forum, the author's own devices, and reading of various documentation. It will be incomplete, so if you have a device that isn't reported here, or have a device that reports a different value, please provide a report in the [Z-Wave section](https://community.home-assistant.io/c/configuration/zwave) of the forum or the #zwave channel on [Discord](https://discord.gg/RkajcgS).
|
This is a work in progress, based upon reports in the forum, the author's own devices and reading of various documentation. It will be incomplete, so if you have a device that isn't reported here or have a device that reports a different value, please provide a report in the [Z-Wave section](https://community.home-assistant.io/c/configuration/zwave) of the forum or the #zwave channel on [Discord](https://discord.gg/RkajcgS).
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## {% linkable_title Binary Sensor %}
|
## {% linkable_title Binary Sensor %}
|
||||||
@ -54,7 +54,7 @@ Devices (usually sensors) that support the Alarm command class will create entit
|
|||||||
|
|
||||||
### {% linkable_title Alarm Level Entity %}
|
### {% linkable_title Alarm Level Entity %}
|
||||||
|
|
||||||
The meaning of the `alarm_level` entity depends on the nature of the alarm sensor
|
The meaning of the `alarm_level` entity depends on the nature of the alarm sensor.
|
||||||
|
|
||||||
#### {% linkable_title Smoke, CO, and CO2 %}
|
#### {% linkable_title Smoke, CO, and CO2 %}
|
||||||
|
|
||||||
@ -135,21 +135,19 @@ The meaning of the `alarm_level` entity depends on the nature of the alarm senso
|
|||||||
- **254**: Deep sleep
|
- **254**: Deep sleep
|
||||||
- **255**: Case open
|
- **255**: Case open
|
||||||
|
|
||||||
If your device has an `access_control` entity, but not a `binary_sensor` equivalent, you can use a [template binary sensor](/components/binary_sensor.template/) to create one:
|
If your device has an `access_control` entity, but not a `binary_sensor` equivalent, you can use a [template binary sensor](/components/binary_sensor.template/) to create one (here we've defined it as a door, but you can use [any relevant device class](/components/binary_sensor/#device-class):
|
||||||
|
|
||||||
```
|
{% raw %}
|
||||||
|
```yaml
|
||||||
binary_sensor:
|
binary_sensor:
|
||||||
- platform: template
|
- platform: template
|
||||||
sensors:
|
sensors:
|
||||||
YOUR_SENSOR:
|
YOUR_SENSOR:
|
||||||
friendly_name: "Friendly name here"
|
friendly_name: "Friendly name here"
|
||||||
value_template: >-
|
device_class: door
|
||||||
{% raw %}{%- if is_state('sensor.YOUR_ORIGINAL_SENSOR_access_control', '22') -%}
|
value_template: {{ is_state('sensor.YOUR_ORIGINAL_SENSOR_access_control', '22') }}
|
||||||
true
|
|
||||||
{%- else -%}
|
|
||||||
false
|
|
||||||
{%- endif -%}{% endraw %}
|
|
||||||
```
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
### {% linkable_title Burglar Entity %}
|
### {% linkable_title Burglar Entity %}
|
||||||
|
|
||||||
@ -163,21 +161,19 @@ binary_sensor:
|
|||||||
- **254**: Deep sleep
|
- **254**: Deep sleep
|
||||||
- **255**: Case open
|
- **255**: Case open
|
||||||
|
|
||||||
If your device has a `burglar` entity, but not a `binary_sensor` equivalent, you can use a [template binary sensor](/components/binary_sensor.template/) to create one:
|
If your device has a `burglar` entity, but not a `binary_sensor` equivalent, you can use a [template binary sensor](/components/binary_sensor.template/) to create one (here we've defined it as a motion sensor, but you can use [any relevant device class](/components/binary_sensor/#device-class:
|
||||||
|
|
||||||
```
|
{% raw %}
|
||||||
|
```yaml
|
||||||
binary_sensor:
|
binary_sensor:
|
||||||
- platform: template
|
- platform: template
|
||||||
sensors:
|
sensors:
|
||||||
YOUR_SENSOR:
|
YOUR_SENSOR:
|
||||||
friendly_name: "Friendly name here"
|
friendly_name: "Friendly name here"
|
||||||
value_template: >-
|
device_class: motion
|
||||||
{% raw %}{%- if is_state('sensor.YOUR_SENSOR_burglar', '8') -%}
|
value_template: {{ is_state('sensor.YOUR_SENSOR_burglar', '8') }}
|
||||||
true
|
|
||||||
{%- else -%}
|
|
||||||
false
|
|
||||||
{%- endif -%}{% endraw %}
|
|
||||||
```
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
### {% linkable_title Source Node ID Entity %}
|
### {% linkable_title Source Node ID Entity %}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user