From 49dcbcd90289f84305443081f8a06e0ac5cb7cd7 Mon Sep 17 00:00:00 2001 From: GamerBene19 Date: Sat, 29 Jan 2022 09:17:18 +0100 Subject: [PATCH 1/2] Switches readme to markdown --- readme => README.md | 139 +++++++++++++++++++++----------------------- 1 file changed, 67 insertions(+), 72 deletions(-) rename readme => README.md (68%) diff --git a/readme b/README.md similarity index 68% rename from readme rename to README.md index 653c1fb..54ae298 100644 --- a/readme +++ b/README.md @@ -2,46 +2,38 @@ influx - weewx extension that sends data to an influx data server Copyright 2016-2021 Matthew Wall Distributed under terms of the GPLv3 -=============================================================================== -Installation - -1) download - -wget -O weewx-influx.zip https://github.com/matthewwall/weewx-influx/archive/master.zip - -2) run the installer: - -wee_extension --install weewx-influx.zip - -3) enter parameters in weewx.conf: - -[StdRESTful] - [[Influx]] - host = HOSTNAME - database = DATABASE - -4) restart weewx: - -sudo /etc/init.d/weewx stop -sudo /etc/init.d/weewx start - - -=============================================================================== -Configuration - -A minimal configuration requires only a host and database. - -Use host and port, or server_url to specify the influx server. - -A username and password are required if authentication is enabled on the -influx server. - -When it starts up, this extension will attempt to create the influx database. -If credentials for a database administrator were provided, it will use those +# Installation + +1. Download: + `wget -O weewx-influx.zip https://github.com/matthewwall/weewx-influx/archive/master.zip` + +2. Run the installer: + `wee_extension --install weewx-influx.zip` + +3. Enter parameters in `weewx.conf`: + ``` + [StdRESTful] + [[Influx]] + host = HOSTNAME + database = DATABASE + ``` +45. Restart weewx: + ```bash + sudo /etc/init.d/weewx stop + sudo /etc/init.d/weewx start + ``` +# Configuration + +A minimal configuration requires only a host and database. +Use `host` and `port`, or `server_url` to specify the influx server. +A username and password are required if authentication is enabled on the influx server. + +When it starts up, this extension will attempt to create the influx database. If credentials for a database administrator were provided, it will use those credentials. Otherwise, it will use the username/password credentials. -Here is a complete enumeration of options. Specify only those that you need. +Here is a complete enumeration of options. Specify only those that you need. +``` [StdRESTful] [[Influx]] database = DATABASE @@ -69,50 +61,53 @@ Here is a complete enumeration of options. Specify only those that you need. units = degree_F # optional for each obs name = label # optional for each obs format = %.2f # optional for each obs +``` - -=============================================================================== -Line formats +# Line formats Influx defines two line formats, multi-line and single-line. This extension -defines the following formats: single-line, multi-line, and multi-line-dotted. -These correspond to the influx line formats. The 'measurement' parameter is +defines the following formats: `single-line`, `multi-line`, and `multi-line-dotted`. +These correspond to the influx line formats. The `measurement` parameter is used to identify the values sent to influx. +``` [StdRESTful] [[Influx]] measurement = weewx line_format = multi-line - -The single-line format results in the following: - - weewx[tags] name0=x,name1=y,name2=z ts - -The multi-line format results in the following: - - name0[tags] value=x ts - name1[tags] value=y ts - name2[tags] value=z ts - -The multi-line-dotted format results in the following: - - weewx.name0[tags] value=x ts - weewx.name1[tags] value=x ts - weewx.name2[tags] value=x ts - -Which format should you use? It depends on how you want the data to end up in -influx. For influx, think of measurement name as table, tags as column names, +``` +The `single-line` format results in the following: +``` +weewx[tags] name0=x,name1=y,name2=z ts +``` + +The `multi-line` format results in the following: +``` +name0[tags] value=x ts +name1[tags] value=y ts +name2[tags] value=z ts +``` +The `multi-line-dotted` format results in the following: +``` +weewx.name0[tags] value=x ts +weewx.name1[tags] value=x ts +weewx.name2[tags] value=x ts +``` +## Which format should you use? +It depends on how you want the data to end up in +influx. +For influx, think of measurement name as table, tags as column names, and fields as unindexed columns. For example, consider these data points: - +```json {'H19': 528, 'VPV': 63.68, 'I': 600, 'H21': 115, 'H20': 19, 'H23': 93, 'H22': 23, 'V': 13.41, 'CS': 5, 'PPV': 9} {'H19': 528, 'VPV': 63.68, 'I': 600, 'H21': 115, 'H20': 19, 'H23': 93, 'H22': 23, 'V': 14.43, 'CS': 5, 'PPV': 9} {'H19': 528, 'VPV': 63.71, 'I': 600, 'H21': 115, 'H20': 19, 'H23': 93, 'H22': 23, 'V': 13.43, 'CS': 5, 'PPV': 9} {'H19': 528, 'VPV': 63.74, 'I': 600, 'H21': 115, 'H20': 19, 'H23': 93, 'H22': 23, 'V': 13.43, 'CS': 5, 'PPV': 9} - +``` A single-line configuration results in this: - +``` > select * from value name: value time CS H19 H20 H21 H22 H23 I PPV V VPV binding @@ -121,9 +116,9 @@ time CS H19 H20 H21 H22 H23 I PPV V VPV binding 1536086337000000000 5 528 19 115 23 93 0.6 9 13.43 63.68 loop 1536086339000000000 5 528 19 115 23 93 0.6 9 13.43 63.71 loop 1536086341000000000 5 528 19 115 23 93 0.6 9 13.43 63.74 loop - +``` A multi-line configuration results in this: - +``` > select * from VPV name: value time VPV @@ -132,15 +127,14 @@ time VPV 1536086337000000000 63.68 1536086339000000000 63.71 1536086341000000000 63.74 +``` -=============================================================================== -Input map - -When an input map is specified, only variables in that map will be uploaded. -The 'units' parameter can be used to specify which units should be used for -the input, independent of the local weewx units. +# Input map +When an input map is specified, only variables in that map will be uploaded. +The `units` parameter can be used to specify which units should be used for the input, independent of the local weewx units. +``` [StdRESTful] [[Influx]] database = DATABASE @@ -165,3 +159,4 @@ the input, independent of the local weewx units. format = %.2f [[[[windDir]]]] format = %03.0f +``` From 09abab9e8740a726be64b2687cdff98dfd549d80 Mon Sep 17 00:00:00 2001 From: GamerBene19 Date: Sat, 29 Jan 2022 10:13:56 +0100 Subject: [PATCH 2/2] Formats Markdown --- README.md | 67 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 54ae298..77f0143 100644 --- a/README.md +++ b/README.md @@ -5,31 +5,32 @@ Distributed under terms of the GPLv3 # Installation 1. Download: - `wget -O weewx-influx.zip https://github.com/matthewwall/weewx-influx/archive/master.zip` + `wget -O weewx-influx.zip https://github.com/matthewwall/weewx-influx/archive/master.zip` 2. Run the installer: - `wee_extension --install weewx-influx.zip` - -3. Enter parameters in `weewx.conf`: - ``` - [StdRESTful] - [[Influx]] - host = HOSTNAME - database = DATABASE - ``` -45. Restart weewx: - ```bash - sudo /etc/init.d/weewx stop - sudo /etc/init.d/weewx start - ``` + `wee_extension --install weewx-influx.zip` + +3. Enter parameters in `weewx.conf`: + ``` + [StdRESTful] + [[Influx]] + host = HOSTNAME + database = DATABASE + ``` +4. Restart weewx: + ```bash + sudo /etc/init.d/weewx stop + sudo /etc/init.d/weewx start + ``` + # Configuration A minimal configuration requires only a host and database. Use `host` and `port`, or `server_url` to specify the influx server. A username and password are required if authentication is enabled on the influx server. -When it starts up, this extension will attempt to create the influx database. If credentials for a database administrator were provided, it will use those -credentials. Otherwise, it will use the username/password credentials. +When it starts up, this extension will attempt to create the influx database. If credentials for a database administrator were provided, it will use those credentials. +Otherwise, it will use the username/password credentials. Here is a complete enumeration of options. Specify only those that you need. @@ -65,10 +66,10 @@ Here is a complete enumeration of options. Specify only those that you need. # Line formats -Influx defines two line formats, multi-line and single-line. This extension -defines the following formats: `single-line`, `multi-line`, and `multi-line-dotted`. -These correspond to the influx line formats. The `measurement` parameter is -used to identify the values sent to influx. +Influx defines two line formats, multi-line and single-line. +This extension defines the following formats: `single-line`, `multi-line`, and `multi-line-dotted`. +These correspond to the influx line formats. +The `measurement` parameter is used to identify the values sent to influx. ``` [StdRESTful] @@ -76,48 +77,60 @@ used to identify the values sent to influx. measurement = weewx line_format = multi-line ``` + The `single-line` format results in the following: + ``` weewx[tags] name0=x,name1=y,name2=z ts ``` The `multi-line` format results in the following: + ``` name0[tags] value=x ts name1[tags] value=y ts name2[tags] value=z ts ``` + The `multi-line-dotted` format results in the following: + ``` weewx.name0[tags] value=x ts weewx.name1[tags] value=x ts weewx.name2[tags] value=x ts ``` -## Which format should you use? + +## Which format should you use? + It depends on how you want the data to end up in influx. For influx, think of measurement name as table, tags as column names, and fields as unindexed columns. For example, consider these data points: + ```json {'H19': 528, 'VPV': 63.68, 'I': 600, 'H21': 115, 'H20': 19, 'H23': 93, 'H22': 23, 'V': 13.41, 'CS': 5, 'PPV': 9} {'H19': 528, 'VPV': 63.68, 'I': 600, 'H21': 115, 'H20': 19, 'H23': 93, 'H22': 23, 'V': 14.43, 'CS': 5, 'PPV': 9} {'H19': 528, 'VPV': 63.71, 'I': 600, 'H21': 115, 'H20': 19, 'H23': 93, 'H22': 23, 'V': 13.43, 'CS': 5, 'PPV': 9} {'H19': 528, 'VPV': 63.74, 'I': 600, 'H21': 115, 'H20': 19, 'H23': 93, 'H22': 23, 'V': 13.43, 'CS': 5, 'PPV': 9} ``` + A single-line configuration results in this: + ``` > select * from value name: value time CS H19 H20 H21 H22 H23 I PPV V VPV binding ---- -- --- --- --- --- --- - --- - --- ------- -1536086335000000000 5 528 19 115 23 93 0.6 9 13.41 63.68 loop -1536086337000000000 5 528 19 115 23 93 0.6 9 13.43 63.68 loop -1536086339000000000 5 528 19 115 23 93 0.6 9 13.43 63.71 loop -1536086341000000000 5 528 19 115 23 93 0.6 9 13.43 63.74 loop +1536086335000000000 5 528 19 115 23 93 0.6 9 13.41 63.68 loop +1536086337000000000 5 528 19 115 23 93 0.6 9 13.43 63.68 loop +1536086339000000000 5 528 19 115 23 93 0.6 9 13.43 63.71 loop +1536086341000000000 5 528 19 115 23 93 0.6 9 13.43 63.74 loop ``` + A multi-line configuration results in this: + ``` > select * from VPV name: value @@ -129,11 +142,11 @@ time VPV 1536086341000000000 63.74 ``` - # Input map When an input map is specified, only variables in that map will be uploaded. The `units` parameter can be used to specify which units should be used for the input, independent of the local weewx units. + ``` [StdRESTful] [[Influx]]