You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sensor.command_line: Round example CPU temperature value (home-assistant#5032)
* sensor.command_line: Round example CPU temperature value
multiply returns a float, which is inexact and sometimes gets rendered
with a lot of decimal places. Round additionally to get cleaner result.
* Move raw
Copy file name to clipboardExpand all lines: source/_components/sensor.command_line.markdown
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,7 @@ sensor:
61
61
62
62
Thanks to the [`proc`](https://en.wikipedia.org/wiki/Procfs) file system, various details about a system can be retrieved. Here the CPU temperature is of interest. Add something similar to your `configuration.yaml` file:
value_template: '{% raw %}{{ value | multiply(0.001) }}{% endraw %}'
73
+
value_template: '{{ value | multiply(0.001) | round(1) }}'
73
74
```
75
+
{% endraw %}
74
76
75
77
### {% linkable_title Monitoring failed login attempts on Home Assistant %}
76
78
@@ -149,11 +151,13 @@ sensor:
149
151
150
152
[Templates](/docs/configuration/templating/) are supported in the `command:` configuration variable. This could be used if you want to include the state of a specific sensor as an argument to your external script.
151
153
154
+
{% raw %}
152
155
```yaml
153
156
# Example configuration.yaml entry
154
157
sensor:
155
158
- platform: command_line
156
159
name: wind direction
157
-
command: 'sh /home/pi/.homeassistant/scripts/wind_direction.sh {% raw %}{{ states.sensor.wind_direction.state }}{% endraw %}'
0 commit comments