Documentation additions (#3654)
This commit is contained in:
parent
0582ebc39e
commit
257dea75e6
4 changed files with 212 additions and 0 deletions
|
@ -61,6 +61,10 @@ sensor:
|
|||
description: Defines a template for the icon of the sensor.
|
||||
required: false
|
||||
type: template
|
||||
icon_template:
|
||||
description: Defines a template for the entity picture of the sensor.
|
||||
required: false
|
||||
type: template
|
||||
{% endconfiguration %}
|
||||
|
||||
## {% linkable_title Considerations %}
|
||||
|
@ -215,3 +219,29 @@ sensor:
|
|||
{% endif %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### {% linkable_title Change The Entity Picture %}
|
||||
|
||||
This example shows how to change the entity picture based on the day/night cycle.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
sensor:
|
||||
- platform: template
|
||||
sensors:
|
||||
day_night:
|
||||
friendly_name: "Day/Night"
|
||||
value_template: >-
|
||||
{% if is_state('sun.sun', 'above_horizon') %}
|
||||
Day
|
||||
{% else %}
|
||||
Night
|
||||
{% endif %}
|
||||
entity_picture_template: >-
|
||||
{% if is_state('sun.sun', 'above_horizon') %}
|
||||
/local/daytime.png
|
||||
{% else %}
|
||||
/local/nighttime.png
|
||||
{% endif %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue