Skip to content

Commit 66a907f

Browse files
committed
Fix liquid error, remove obsolete details, and other minôr updates
1 parent dda9520 commit 66a907f

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

source/_components/sensor.command_line.markdown

+18-17
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ There are several ways to get the temperature of your hard drive. A simple solut
4444
$ hddtemp -n /dev/sda
4545
```
4646

47-
To use those information, the entry for a sensor in the `configuration.yaml` file will look like this.
47+
To use those information, the entry for a command-line sensor in the `configuration.yaml` file will look like this.
4848

4949
```yaml
5050
# Example configuration.yaml entry
5151
sensor:
52-
platform: command_line
53-
name: HD Temperature
54-
command: "hddtemp -n /dev/sda"
55-
unit_of_measurement: "°C"
52+
- platform: command_line
53+
name: HD Temperature
54+
command: "hddtemp -n /dev/sda"
55+
unit_of_measurement: "°C"
5656
```
5757
5858
### {% linkable_title CPU temperature %}
@@ -68,21 +68,20 @@ Thanks to the [`proc`](https://en.wikipedia.org/wiki/Procfs) file system, variou
6868
value_template: '{% raw %}{{ value | multiply(0.001) }}{% endraw %}'
6969
```
7070

71-
The `correction_factor` will make sure that the value is shown in a useful format in the frontend.
72-
73-
### {% Monitoring the failed login attempt on HA %}
71+
### {% linkable_title Monitoring the failed login attempt on HA %}
7472

7573
If you want to get the fillowing in case you want to know if someone is hammering your server is open on the net
7674

7775

7876
```yaml
7977
# Example configuration.yaml entry
80-
sensor 6:
81-
platform: command_line
82-
name: badlogin
83-
command: grep -c 'Login attempt' /home/hass/.homeassistant/home-assistant.log
78+
sensor:
79+
- platform: command_line
80+
name: badlogin
81+
command: grep -c 'Login attempt' /home/hass/.homeassistant/home-assistant.log
8482
```
85-
*Make sure to configure the logger to monitor the proper component at the proper level*
83+
84+
Make sure to configure the logger to monitor the proper component at the proper level.
8685

8786
```yaml
8887
# Example working logger settings that works
@@ -97,6 +96,7 @@ logger:
9796
You can see directly in the frontend (**Developer tools** -> **About**) what release of Home Assistant you are running. The Home Assistant releases are available on the [Python Package Index](https://pypi.python.org/pypi). This makes it possible to get the current release.
9897

9998
```yaml
99+
sensor:
100100
- platform: command_line
101101
command: python3 -c "import requests; print(requests.get('https://pypi.python.org/pypi/homeassistant/json').json()['info']['version'])"
102102
name: HA release
@@ -107,6 +107,7 @@ You can see directly in the frontend (**Developer tools** -> **About**) what rel
107107
If you own a devices which are storing values in text files which are accessible over HTTP then you can use the same approach as shown in the previous section. Instead of looking at the JSON response we directly grab the sensor's value.
108108

109109
```yaml
110+
sensor:
110111
- platform: command_line
111112
command: python3 -c "import requests; print(requests.get('http://remote-host/sensor_data.txt').text)"
112113
name: File value
@@ -136,8 +137,8 @@ To use the script you need to add something like the following to your `configur
136137
```yaml
137138
# Example configuration.yaml entry
138139
sensor:
139-
platform: command_line
140-
name: Brightness
141-
command: "python3 /path/to/script/arest-value.py"
142-
unit_of_measurement: "°C"
140+
- platform: command_line
141+
name: Brightness
142+
command: "python3 /path/to/script/arest-value.py"
143+
unit_of_measurement: "°C"
143144
```

0 commit comments

Comments
 (0)