Skip to content

Commit de7c1d5

Browse files
authored
Minimizing of the configuration sample (home-assistant#1008)
1 parent a09ede5 commit de7c1d5

22 files changed

+143
-127
lines changed

source/_components/binary_sensor.apcupsd.markdown

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ footer: true
1010
logo: apcupsd.png
1111
ha_category: Binary Sensor
1212
ha_release: 0.13
13+
ha_iot_class: "Local Polling"
1314
---
1415

1516
In addition to the [APCUPSd Sensor](/components/sensor.apcupsd/) devices, you may also create a device which is simply "on" when the UPS status is online and "off" at all other times.
@@ -20,10 +21,8 @@ To enable this sensor, you first have to set up [apcupsd](/components/apcupsd/),
2021
# Example configuration.yaml entry
2122
binary_sensor:
2223
- platform: apcupsd
23-
name: UPS Online
2424
```
2525
2626
Configuration variables:
2727
28-
2928
- **name** (*Optional*): Name to use in the front end.

source/_components/binary_sensor.arest.markdown

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,35 @@ To use your aREST binary sensor in your installation, add the following to your
2121
```yaml
2222
# Example configuration.yaml entry
2323
binary_sensor:
24-
platform: arest
25-
resource: http://IP_ADDRESS
26-
name: Office Switch
27-
pin: 8
24+
- platform: arest
25+
resource: http://IP_ADDRESS
26+
pin: 8
2827
```
2928
3029
Configuration variables:
3130
3231
- **resource** (*Required*): IP address and schema of the device that is exposing an aREST API, e.g. http://192.168.1.10.
33-
- **name** (*Optional*): Let you overwrite the the name of the device. By default *name* from the device is used.
3432
- **pin** (*Required*): Number of the pin to monitor.
33+
- **name** (*Optional*): Let you overwrite the the name of the device. By default *name* from the device is used.
3534
3635
Accessing the URL http://IP_ADDRESS/digital/PIN_NUMBER should give you the state of the pin inside a JSON response as `return_value`.
3736

3837
```bash
39-
$ curl -X GET http://10.100.0.157/digital/9
38+
$ curl -X GET http://192.168.0.5/digital/9
4039
{"return_value": 0, "id": "office1", "name": "Office", "connected": true}
4140
```
4241

42+
An example for Pin 9 inspired by the command above could look like this:
43+
44+
```yaml
45+
# Example configuration.yaml entry
46+
binary_sensor:
47+
- platform: arest
48+
resource: http://192.168.0.5/digital/9
49+
pin: 9
50+
name: Office
51+
```
52+
4353
<p class='note'>
4454
This sensor is not suitable for fast state changes because there is a high possibility that the change took place between two update cycle.
4555
</p>

source/_components/binary_sensor.command_line.markdown

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,8 @@ To use your Command binary sensor in your installation, add the following to you
2121
```yaml
2222
# Example configuration.yaml entry
2323
binary_sensor:
24-
platform: command_line
25-
command: cat /proc/sys/net/ipv4/ip_forward
26-
name: 'IP4 forwarding'
27-
sensor_class: opening
28-
payload_on: "1"
29-
payload_off: "0"
30-
value_template: '{% raw %}{{ value.x }}{% endraw %}'
24+
- platform: command_line
25+
command: cat /proc/sys/net/ipv4/ip_forward
3126
```
3227
3328
Configuration variables:
@@ -50,11 +45,12 @@ Check the state of an [SickRage](https://github.com/sickragetv/sickrage) instanc
5045
```yaml
5146
# Example configuration.yaml entry
5247
binary_sensor:
53-
platform: command_line
54-
command: netstat -na | find "33322" | find /c "LISTENING" > nul && (echo "Running") || (echo "Not running")
55-
name: 'sickragerunning'
56-
payload_on: "Running"
57-
payload_off: "Not running"
48+
- platform: command_line
49+
command: netstat -na | find "33322" | find /c "LISTENING" > nul && (echo "Running") || (echo "Not running")
50+
name: 'sickragerunning'
51+
sensor_class: moving
52+
payload_on: "Running"
53+
payload_off: "Not running"
5854
```
5955
6056
### {% linkable_title Check RasPlex %}
@@ -63,11 +59,12 @@ Check if [RasPlex](http://www.rasplex.com/) is `online`.
6359

6460
```yaml
6561
binary_sensor:
66-
platform: command_line
67-
command: 'ping -c 1 rasplex.local | grep "1 received" | wc -l'
68-
name: 'is_rasplex_online'
69-
payload_on: 1
70-
payload_off: 0
62+
- platform: command_line
63+
command: 'ping -c 1 rasplex.local | grep "1 received" | wc -l'
64+
name: 'is_rasplex_online'
65+
sensor_class: connectivity
66+
payload_on: 1
67+
payload_off: 0
7168
```
7269

7370
An alternative solution could look like this:
@@ -77,6 +74,7 @@ binary_sensor:
7774
platform: command_line
7875
name: Printer
7976
command: ping -c 1 192.168.1.10 &> /dev/null && echo success || echo fail
77+
sensor_class: connectivity
8078
payload_on: "success"
8179
payload_off: "fail"
8280
```

source/_components/binary_sensor.ecobee.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ sharing: true
99
footer: true
1010
logo: ecobee.png
1111
ha_category: Sensor
12+
ha_release: 0.9
13+
ha_iot_class: "Local Push"
1214
---
1315

1416
To get your Ecobee binary sensors working with Home Assistant, follow the instructions for the general [Ecobee component](/components/ecobee/).

source/_components/binary_sensor.enocean.markdown

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ ha_release: 0.21
1313
ha_iot_class: "Local Push"
1414
---
1515

16-
This can typically be one of those batteryless wall switches. Currently only one type has been tested: Eltako FT55. Other devices will most likely not work without changing the Home-Asisstant code.
17-
16+
This can typically be one of those batteryless wall switches. Currently only one type has been tested: Eltako FT55. Other devices will most likely not work without changing the Home Asisstant code.
1817

1918
To use your EnOcean device, you first have to set up your [EnOcean hub](/components/enocean/) and then add the following to your `configuration.yaml` file:
2019

@@ -23,8 +22,6 @@ To use your EnOcean device, you first have to set up your [EnOcean hub](/compone
2322
binary_sensor:
2423
- platform: enocean
2524
id: [0x01,0x90,0x84,0x3C]
26-
name: Door
27-
sensor_class: opening
2825
```
2926
3027
Configuration variables:

source/_components/binary_sensor.ffmpeg.markdown

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ To enable your FFmpeg with noise detection in your installation, add the followi
2525
binary_sensor:
2626
- platform: ffmpeg
2727
tool: noise
28-
input: FFMPEG_SUPPORTED_INPUT
29-
name: FFmpeg Noise
30-
peak: -30
31-
duration: 1
32-
reset: 20
3328
```
3429
3530
Configuration variables:
@@ -61,13 +56,6 @@ binary_sensor:
6156
- platform: ffmpeg
6257
tool: motion
6358
input: FFMPEG_SUPPORTED_INPUT
64-
name: FFmpeg Motion
65-
changes: 10
66-
reset: 20
67-
# group feature / default not in use
68-
repeat: 0
69-
repeat_time: 0
70-
7159
```
7260

7361
Configuration variables:

source/_components/binary_sensor.isy994.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ footer: true
1010
logo: universal_devices.png
1111
ha_category: Binary Sensor
1212
ha_iot_class: "Local Push"
13+
ha_release: pre 0.7
1314
---
1415

1516
The `isy994` platform allows you to get data from your [ISY994](https://www.universal-devices.com/residential/isy994i-series/) binary sensors from within Home Assistant.

source/_components/binary_sensor.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ sharing: true
99
footer: true
1010
---
1111

12-
Binary sensors are gathering information about state of switches, contacts, pins, and alike. The return value of those sensors is usually digital (1/0). This means that those sensors knows only two states: **off/low/open** and **on/high/closed**.
12+
Binary sensors are gathering information about state of switches, contacts, pins, and alike. The return value of those sensors is usually digital (1/0). This means that those sensors knows only two states: **0/off/low/open/false** and **1/on/high/closed/true**.
1313

1414
Knowing that there are only two states allows Home Assistant to represent the sensor better in the frontend.
1515

16-
Most binary sensors support the `SENSOR_CLASSES` which let you specify the type of your sensor. The following types are supported:
16+
Most binary sensors support the `sensor_class:` which let you specify the type of your sensor. The following types are supported:
1717

1818
- **None**: Generic on/off
1919
- **cold**: On means cold (or too cold)

source/_components/binary_sensor.modbus.markdown

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ footer: true
1010
logo: modbus.png
1111
ha_category: Binary Sensor
1212
ha_release: 0.28
13+
ha_iot_class: "Local Push"
1314
---
1415

1516
The `modbus` binary sensor allows you to gather data from [Modbus](http://www.modbus.org/) coils.
@@ -19,14 +20,14 @@ To use your Modbus binary sensors in your installation, add the following to you
1920
```yaml
2021
# Example configuration.yml entry
2122
binary_sensor:
22-
platform: modbus
23-
coils:
24-
- name: Sensor1
25-
slave: 1
26-
coil: 100
27-
- name: Sensor2
28-
slave: 1
29-
coil: 110
23+
- platform: modbus
24+
coils:
25+
- name: Sensor1
26+
slave: 1
27+
coil: 100
28+
- name: Sensor2
29+
slave: 1
30+
coil: 110
3031
```
3132
3233
Configuration variables:

source/_components/binary_sensor.mqtt.markdown

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ footer: true
1010
logo: mqtt.png
1111
ha_category: Binary Sensor
1212
ha_release: 0.9
13+
ha_iot_class: "Depends"
1314
---
1415

1516

@@ -20,14 +21,8 @@ To use your MQTT binary sensor in your installation, add the following to your `
2021
```yaml
2122
# Example configuration.yml entry
2223
binary_sensor:
23-
platform: mqtt
24-
state_topic: "home-assistant/window/contact"
25-
name: "MQTT Sensor"
26-
qos: 0
27-
payload_on: "ON"
28-
payload_off: "OFF"
29-
sensor_class: opening
30-
value_template: '{% raw %}{{ value.x }}{% endraw %}'
24+
- platform: mqtt
25+
state_topic: "home-assistant/window/contact"
3126
```
3227
3328
Configuration variables:
@@ -40,9 +35,24 @@ Configuration variables:
4035
- **sensor_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend.
4136
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
4237
43-
For a quick check you can use the commandline tools shipped with `mosquitto` to send MQTT messages. Set the state of your sensor manually:
38+
For a quick check you can use the commandline tools shipped with `mosquitto` to send MQTT messages. Set the state of a sensor manually:
4439

4540
```bash
4641
$ mosquitto_pub -h 127.0.0.1 -t home-assistant/window/contact -m "OFF"
4742
```
4843

44+
An extended configuration for the same sensor could look like this if you want/need to be more specific.
45+
46+
```yaml
47+
# Example configuration.yml entry
48+
binary_sensor:
49+
platform: mqtt
50+
state_topic: "home-assistant/window/contact"
51+
name: "Windows contact"
52+
qos: 0
53+
payload_on: "1"
54+
payload_off: "0"
55+
sensor_class: opening
56+
value_template: '{% raw %}{{ value.x }}{% endraw %}'
57+
```
58+

0 commit comments

Comments
 (0)