diff --git a/docs/source/Controller/C011.rst b/docs/source/Controller/C011.rst index d37662a46e..79d78022a3 100644 --- a/docs/source/Controller/C011.rst +++ b/docs/source/Controller/C011.rst @@ -62,6 +62,11 @@ You can use this placeholders in http header and in the http body: * ``%vname4%`` will be replaced with Valuename 4 * ``%val1%`` will be replaced with the value 1 of the device which is sending data to this controller * ``%val2%`` will be replaced with the value 2 of the device which is sending data to this controller +* ``%val3%`` will be replaced with the value 3 of the device which is sending data to this controller +* ``%val4%`` will be replaced with the value 4 of the device which is sending data to this controller +* ``%unixtime%`` will be replaced with the Unix time (seconds since epoch) + +See also System variables You can also write things like this: @@ -71,8 +76,8 @@ You can also write things like this: Examples -------- -InfluxDB HTTP Api -^^^^^^^^^^^^^^^^^ +InfluxDB v1 HTTP API +^^^^^^^^^^^^^^^^^^^^ * HTTP Method: ``POST`` * HTTP URI: ``write?db=testdb`` @@ -89,9 +94,33 @@ InfluxDB HTTP Api See also `InfluxDB API description `_ +InfluxDB v2 HTTP API +^^^^^^^^^^^^^^^^^^^^ + +* HTTP Method: ``POST`` +* HTTP URI: ``api/v2/write?bucket=yourbucket&org=yourorg`` + +* HTTP Header: + +.. code-block:: none + + Content-Type: application/x-www-form-urlencoded + Authorization: Token yourtoken + +* HTTP Body: + +.. code-block:: none + + esp,unit=%sysname%,device=%tskname%,sensor=%vname1% value=%val1% %unixtime%%LF%%2%esp,unit=%sysname%,device=%tskname%,sensor=%vname2% value=%val2% %unixtime%%/2%%LF%%3%esp,unit=%sysname%,device=%tskname%,sensor=%vname3% value=%val3% %unixtime%%/3%%LF%%4%esp,unit=%sysname%,device=%tskname%,sensor=%vname4% value=%val4% %unixtime%%/4%%LF% + +Make sure the body is all ONE single line, InfluxDB seems to be very picky about newlines. + +Response should be 204 on success. + + Nettemp HTTP Api ^^^^^^^^^^^^^^^^ untested but should work with something like this: -``/receiver.php?device=ip&type=%1%%vname1%%/1%%2%;%vname2%%/2%%3%;%vname3%%/3%%4%;%vname4%%/4%&value=%1%%val1%%/1%%2%;%val2%%/2%%3%;%val3%%/3%%4%;%val4%%/4%`` \ No newline at end of file +``/receiver.php?device=ip&type=%1%%vname1%%/1%%2%;%vname2%%/2%%3%;%vname3%%/3%%4%;%vname4%%/4%&value=%1%%val1%%/1%%2%;%val2%%/2%%3%;%val3%%/3%%4%;%val4%%/4%``