weatherstation/firmware/influxdb.ino
2017-12-09 18:08:37 +01:00

11 lines
632 B
C++
Executable file

void pushToInfluxDB(String device, float sensorValues[]) {
influxdb.write("weather,device=" + device + " temperature=" + String(sensorValues[SENSOR_TEMPERATURE]));
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]));
int tmp = influxdb.write("weather,device=" + device + " pressure=" + String(sensorValues[SENSOR_PRESSURE]));
Serial.println("Opendb status: " + String(tmp));
}