At first, here is my configuration (as illustrative example, it a little complicated IRL):
- raspberry pi3 with influxdb and grafana as db and visualization tool
- nodeMCU 7 espeasy with DHT11 as datasource
- rasspi and nodeMCU at the same subnet, working communication
I used it in the past solution with MQTT communication, using rules in espeasy I was sending payloads to rasppi and there was script MQTT > influxdb. I found that I can use espeasy to write values to influxdb directly via HTTP POST.
So far so good, I can configure espeasy with HTTP Advaced controller to write single value to influxdb without any problems. But the problem starts in the moment when I need to write more values, in this example case temperature and humidity at the same time.
Here is my configuration:
Configuration of DHT11 device
Configuration of controller
log with successful communication
values are in db correctly written
This is perfect, BUT .. I'm now trying to write also humidity, for example. By wiki it shoud be easy to do: https://www.letscontrolit.com/wiki/inde ... dvanced.29 .
So I tried to add another line, influxdb allows to write multiple points: https://docs.influxdata.com/influxdb/v1 ... ple-points
So I tried to modify HTTP Body with many combinations:
HTTP Body
Code: Select all
%tskname%%vname1% value=%val1%
%tskname%%vname2% value=%val2%
Code: Select all
222613 : HTTP/1.1 400 Bad Request
222613 : Content-Type: application/json
222614 : Request-Id: 324a86d3-4f1e-11e8-ba7e-000000000000
222615 : X-Influxdb-Build: OSS
222618 : X-Influxdb-Error: partial write: unable to parse 'dht11Temperature value=23.00 ': invalid number dropped=0
HTTP Body
Code: Select all
%tskname%%vname1% value=%val1%%LF%%tskname%%vname2% value=%val2%
Code: Select all
383698 : HTTP/1.1 400 Bad Request
383699 : Content-Type: application/json
383700 : Request-Id: 92503c17-4f1e-11e8-ba8e-000000000000
383700 : X-Influxdb-Build: OSS
383704 : X-Influxdb-Error: unable to parse 'dht11Temperature value=23.00%0adht11Humidity value=33.00': invalid number
I also tried a lot of combinations with \n, \r\n, hex and dec values .. there is obviously problem with end of line/new line character. I tried to put values to quotas, also without success..
I found here on forum picture of working configuration: https://imgur.com/a/RyjzU , in my case without any success.
This problem is probably described on GITHub, but without solution: https://github.com/letscontrolit/ESPEasy/issues/1306
So here are my questions, do you know any solution how to write multiple values from sensor in one POST?
I found the only solution so far to configure 'separate' controller for each sensor value (in this case two HTTP Advanced controllers). But I need to use multiple sensors in my project and in this case it means A LOT of controllers ;] ..
Any help? Thank you! :]