From d039052e6b6ba8fa6306feba3ef0911e1da5e5f7 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 27 Oct 2016 15:42:24 +0200 Subject: [PATCH] Minor format changes --- source/_components/sensor.influxdb.markdown | 55 ++++++++++----------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/source/_components/sensor.influxdb.markdown b/source/_components/sensor.influxdb.markdown index ec6e47ff37b..4431528ab41 100644 --- a/source/_components/sensor.influxdb.markdown +++ b/source/_components/sensor.influxdb.markdown @@ -12,35 +12,12 @@ ha_category: Sensor ha_release: 0.32 --- -The `InfluxDB` sensor allows you to use values from an InfluxDB database to populate a sensor state. +The `InfluxDB` sensor allows you to use values from an [InfluxDB](https://influxdb.com/) database to populate a sensor state. -To configure this sensor, you need to define the sensor connection variables and a list of queries. A sensor will be created for each query. +To configure this sensor, you need to define the sensor connection variables and a list of queries to your `configuration.yaml` file. A sensor will be created for each query: -Configuration variables for the server: - -- **host** (*Optional*): IP address of your database host, eg. 192.168.1.10. Defaults to `localhost`. -- **port** (*Optional*): Port to use. Defaults to 8086. -- **username** (*Optional*): The username of the database user. -- **password** (*Optional*): The password for the database user account. -- **ssl** (*Optional*): Use https instead of http to connect. Defaults to false. -- **verify_ssl** (*Optional*): Verify SSL certificate for https request. Defaults to false. -- **queries** (*Required*): List of queries - -Configuration variables for the queries: -- **name** (*Required*): The name of the sensor, -- **unit_of_measurement** (*Required*): Defines the units of measurement of the sensor, -- **measurement** (*Required*): Defines the measurement name in InfluxDB (the from clause of the query), -- **where** (*Required*): Defines the data selection clause (the where clause of the query), -- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload. -- **database** (*Optional*): Name of the database to use. Defaults to `home_assistant`, -- **group_function** (*Optional*): The group function to be used, default to `mean` -- **field** (*Optional*): The field name to select, default to value. - -## {% linkable_title Examples %} -### {% linkable_title Minimal configuration %} -The example configuration below will create a request to influx db to the default database (`home_assistant`) to get the mean value of `foo` in measurement `°C` - ```yaml +# Example configuration.yaml entry sensor: - platform: influxdb queries: @@ -50,8 +27,30 @@ sensor: measurement: '"°C"' ``` + +Configuration variables for the server: + +- **host** (*Optional*): IP address of your database host, eg. 192.168.1.10. Defaults to `localhost`. +- **port** (*Optional*): Port to use. Defaults to 8086. +- **username** (*Optional*): The username of the database user. +- **password** (*Optional*): The password for the database user account. +- **ssl** (*Optional*): Use `https` instead of `http` to connect. Defaults to `false`. +- **verify_ssl** (*Optional*): Verify SSL certificate for `https` request. Defaults to `false`. +- **queries** array (*Required*): List of queries + - **name** (*Required*): The name of the sensor. + - **unit_of_measurement** (*Required*): Defines the units of measurement of the sensor. + - **measurement** (*Required*): Defines the measurement name in InfluxDB (the from clause of the query). + - **where** (*Required*): Defines the data selection clause (the where clause of the query). + - **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload. + - **database** (*Optional*): Name of the database to use. Defaults to `home_assistant`. + - **group_function** (*Optional*): The group function to be used. Defaults to `mean`. + - **field** (*Optional*): The field name to select. Defaults to value. + +## {% linkable_title Examples %} + ### {% linkable_title Full configuration %} -The example configuration entry bellow create two request to influx db, one to the database db1, the other to db2 : + +The example configuration entry bellow create two request to your local InfluxDB instance, one to the database `db1`, the other to `db2`: - `select last(value) as value from "°C" where "name" = "foo"` - `select min(tmp) as value from "%" where "entity_id" = ''salon'' and time > now() - 1h` @@ -79,4 +78,4 @@ sensor: measurement: '"%"' field: tmp database: db2 -``` \ No newline at end of file +```