2018-06-23 20:13:33 +02:00
|
|
|
|
2017-11-20 20:15:14 +01:00
|
|
|
void pushToInfluxDB(String device, float sensorValues[]) {
|
2018-06-23 20:13:33 +02:00
|
|
|
|
2018-07-12 22:30:30 +02:00
|
|
|
/*influxdb.write("weather,device=" + device + " temperature=" + String(sensorValues[SENSOR_TEMPERATURE]));
|
2017-11-20 20:15:14 +01:00
|
|
|
influxdb.write("weather,device=" + device + " humidity=" + String(sensorValues[SENSOR_HUMIDITY]));
|
|
|
|
influxdb.write("weather,device=" + device + " light=" + String(sensorValues[SENSOR_LIGHT]));
|
|
|
|
influxdb.write("weather,device=" + device + " windspeed=" + String(sensorValues[SENSOR_WINDSPEED]));
|
2018-07-11 11:12:53 +02:00
|
|
|
influxdb.write("weather,device=" + device + " pressure=" + String(sensorValues[SENSOR_PRESSURE]));
|
2018-07-12 22:30:30 +02:00
|
|
|
influxdb.write("weather,device=" + device + " batvoltage=" + String(sensorValues[SENSOR_BAT_VOLTAGE]));*/
|
|
|
|
|
|
|
|
String msg = "weather,device=" + device + " temperature=" + String(sensorValues[SENSOR_TEMPERATURE])
|
|
|
|
+ ",humidity=" + String(sensorValues[SENSOR_HUMIDITY])
|
|
|
|
+ ",light=" + String(sensorValues[SENSOR_LIGHT])
|
|
|
|
+ ",windspeed=" + String(sensorValues[SENSOR_WINDSPEED])
|
|
|
|
+ ",pressure=" + String(sensorValues[SENSOR_PRESSURE])
|
|
|
|
+ ",batvoltage=" + String(sensorValues[SENSOR_BAT_VOLTAGE]);
|
|
|
|
|
|
|
|
uint8_t tries = 0;
|
|
|
|
do {
|
|
|
|
tries++;
|
|
|
|
influxdb.write(msg);
|
|
|
|
} while (influxdb.response() != DB_SUCCESS and tries < 5);
|
|
|
|
|
2017-12-09 18:08:37 +01:00
|
|
|
|
2018-06-23 20:13:33 +02:00
|
|
|
}
|
|
|
|
|