From 52c53d7d01aee36e8f2198e72ccf8bb795cde411 Mon Sep 17 00:00:00 2001 From: Klaas Schoute Date: Sat, 17 Nov 2018 10:20:19 +0100 Subject: [PATCH] Update arest sensor component configuration (#7548) --- source/_components/sensor.arest.markdown | 75 ++++++++++++++++++------ 1 file changed, 57 insertions(+), 18 deletions(-) diff --git a/source/_components/sensor.arest.markdown b/source/_components/sensor.arest.markdown index 4bb0a11ad78..b2707483d6a 100644 --- a/source/_components/sensor.arest.markdown +++ b/source/_components/sensor.arest.markdown @@ -13,7 +13,6 @@ ha_iot_class: "Local Polling" ha_release: pre 0.7 --- - The `arest` sensor platform allows you to get all data from your devices (like Arduinos with a Ethernet/Wifi connection, the ESP8266, and the Raspberry Pi) running the [aREST](http://arest.io/) RESTful framework. ## {% linkable_title Configuration %} @@ -24,7 +23,7 @@ To use your aREST enabled device in your installation, add the following to your # Example configuration.yaml entry sensor: - platform: arest - resource: http://IP_ADDRESS + resource: https://IP_ADDRESS monitored_variables: temperature: name: temperature @@ -33,22 +32,63 @@ sensor: name: Pin 0 analog ``` -Configuration variables: +{% configuration %} +resource: + description: "IP address and schema of the device that is exposing an aREST API, e.g., https://192.168.1.10." + required: true + type: string +name: + description: Let you overwrite the name of the device. + required: false + default: aREST sensor + type: string +pins: + description: List of pins to monitor. Analog pins need a leading **A** for the pin number. + required: false + type: list + keys: + pin: + description: Pin number to use. + required: true + type: list + keys: + name: + description: The name of the variable you wish to monitor. + required: true + type: string + unit_of_measurement: + description: Defines the unit of measurement of the sensor, if any. + required: false + type: string + value_template: + description: Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload. + required: false + type: template +monitored_variables: + description: List of exposed variables. + required: false + type: list + keys: + variable: + description: Name of the variable to monitor. + required: true + type: list + keys: + name: + description: The name to use for the frontend. + required: false + type: string + unit_of_measurement: + description: Defines the units of measurement of the sensor, if any. + required: false + type: string + value_template: + description: Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload. + required: false + type: template +{% endconfiguration %} -- **resource** (*Required*): IP address and schema of the device that is exposing an aREST API, e.g., http://192.168.1.10. -- **name** (*Optional*): Let you overwrite the name of the device. By default *name* from the device is used. -- **monitored_variables** array (*Optional*): List of exposed variables. - - **[variable]** (*Required*): Name of the variable to monitor. - - **name** (*Optional*): The name to use for the frontend. - - **unit_of_measurement** (*Optional*): Defines the units of measurement of the sensor, if any. - - **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload. -- **pins** array (*Optional*): List of pins to monitor. Analog pins need a leading **A** for the pin number. - - **[pin]** (*Required*): Pin number to use. - - **name** (*Required*): The name of the variable you wish to monitor. - - **unit_of_measurement** (*Optional*): Defines the unit of measurement of the sensor, if any. - - **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) 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. +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. Accessing one of the endpoints (eg. http://192.168.1.10/temperature) will give you the value inside a JSON response. @@ -75,4 +115,3 @@ The root will give you a JSON response that contains all variables and their cur ```json {"return_value": 34, "id": "sensor02", "name": "livingroom", "connected": true} ``` -