Minimizing of the configuration sample (#1008)
This commit is contained in:
parent
a09ede5b63
commit
de7c1d5ac9
22 changed files with 143 additions and 127 deletions
|
@ -9,6 +9,7 @@ sharing: true
|
|||
footer: true
|
||||
ha_category: Binary Sensor
|
||||
ha_release: "0.10"
|
||||
ha_iot_class: "Local Polling"
|
||||
---
|
||||
|
||||
|
||||
|
@ -31,13 +32,8 @@ To enable this sensor, add the following lines to your `configuration.yaml` file
|
|||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
binary_sensor:
|
||||
platform: rest
|
||||
resource: http://IP_ADDRESS/ENDPOINT
|
||||
method: GET
|
||||
name: REST GET binary sensor
|
||||
sensor_class: opening
|
||||
value_template: '{% raw %}{{ value_json.state }}{% endraw %}'
|
||||
verify_ssl: False
|
||||
- platform: rest
|
||||
resource: http://IP_ADDRESS/ENDPOINT
|
||||
```
|
||||
|
||||
or for a POST request:
|
||||
|
@ -45,13 +41,9 @@ or for a POST request:
|
|||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
binary_sensor:
|
||||
platform: rest
|
||||
resource: http://IP_ADDRESS/ENDPOINT
|
||||
method: POST
|
||||
name: REST POST binary sensor
|
||||
sensor_class: opening
|
||||
value_template: '{% raw %}{{ value_json.state }}{% endraw %}'
|
||||
payload: '{ "device" : "door" }'
|
||||
- platform: rest
|
||||
resource: http://IP_ADDRESS/ENDPOINT
|
||||
method: POST
|
||||
```
|
||||
|
||||
Configuration variables:
|
||||
|
@ -68,3 +60,22 @@ Configuration variables:
|
|||
Make sure that the URL matches exactly your endpoint or resource.
|
||||
</p>
|
||||
|
||||
|
||||
## {% linkable_title Examples %}
|
||||
|
||||
In this section you find some real life examples of how to use this sensor.
|
||||
|
||||
### {% linkable_title aREST sensor %}
|
||||
|
||||
Instead of using an [aREST](/components/binary_sensor.arest/) binary sensor could the value of a device supporting aREST directly retrieved with a REST binary sensor.
|
||||
|
||||
```yaml
|
||||
binary_sensor:
|
||||
- platform: rest
|
||||
resource: http://192.168.0.5/digital/9
|
||||
method: GET
|
||||
name: Light
|
||||
sensor_class: light
|
||||
value_template: '{{ value_json.return_value }}'
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue