Fix #126 (Use real templates)
This commit is contained in:
parent
a8f0d48b82
commit
9c6e176e4c
11 changed files with 18 additions and 17 deletions
|
@ -31,8 +31,7 @@ sensor:
|
|||
A0:
|
||||
name: Pin 0 analog
|
||||
unit_of_measurement: "ca"
|
||||
correction_factor: 0.01
|
||||
decimal_places: 1
|
||||
value_template: '{% raw %}{{ value_json.light }}{% endraw %}'
|
||||
3:
|
||||
name: Pin 3 digital
|
||||
```
|
||||
|
@ -47,8 +46,7 @@ Configuration variables:
|
|||
- **pins** array (*Optional*): List of pins to monitor. Analog pins need a leading **A** for the pin number.
|
||||
- **name** (*Optional*): The name of the variable you wish to monitor.
|
||||
- **unit_of_measurement** (*Optional*): Defines the unit of measurement of the sensor, if any.
|
||||
- **correction_factor** (*Optional*): A float value to do some basic calculations.
|
||||
- **decimal_places** (*Optional*): Number of decimal places of the value.
|
||||
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
|
||||
|
||||
The variables in the `monitored_variables` array must be available in the response of the device. As a starting point you could use the one of the example sketches (eg. [Ethernet](https://raw.githubusercontent.com/marcoschwartz/aREST/master/examples/Ethernet/Ethernet.ino) for an Arduino with Ethernet shield). In those sketches are two variables (`temperature` and `humidity`) available which will act as endpoints.
|
||||
|
||||
|
@ -78,4 +76,3 @@ The root will give you a JSON response that contains all variables and their cur
|
|||
{"return_value": 34, "id": "sensor02", "name": "livingroom", "connected": true}
|
||||
```
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue