mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-18 23:06:58 +00:00
Add example with the sun
This commit is contained in:
parent
40d60227f2
commit
c919bfc277
@ -58,7 +58,18 @@ sensor:
|
||||
|
||||
### {% linkable_title Renaming sensor output %}
|
||||
|
||||
If you don't like the wording of a sensor output then the template sensor can help too. Processes monitored by the [System Monitor sensor](/components/sensor.systemmonitor/) show `on` or `off` if they are running or not. This example shows how the output of a monitored `glances` process can be renamed.
|
||||
If you don't like the wording of a sensor output then the template sensor can help too. Let's rename the output of the [Sun component](/components/sun/) as a simple example:
|
||||
|
||||
```yaml
|
||||
sensor:
|
||||
platform: template
|
||||
sensors:
|
||||
sun_state:
|
||||
value_template: "{% if is_state('sun.sun', 'above_horizon') %}up{% else %}down{% endif %}"
|
||||
friendly_name: 'Sun state'
|
||||
```
|
||||
|
||||
Processes monitored by the [System Monitor sensor](/components/sensor.systemmonitor/) show `on` or `off` if they are running or not. This example shows how the output of a monitored `glances` process can be renamed.
|
||||
|
||||
```yaml
|
||||
sensor:
|
||||
|
Loading…
x
Reference in New Issue
Block a user