- if ( WiFi.status() == WL_CONNECTED ) {
- Serial.println("DEBUG");
- sensors_event_t event;
-
- dht.temperature().getEvent(&event);
- if (isnan(event.temperature)) {
- // Error
- } else {
- sendToInfluxDB("temperature,city="+city+",location="+location, "value", String(event.temperature));
- }
- dht.humidity().getEvent(&event);
- if (isnan(event.relative_humidity)) {
- // Error
- } else {
- sendToInfluxDB("humidity,city="+city+",location="+location, "value", String(event.relative_humidity));
- }
- if ( TinfoSerial.available() ) {
- Serial.println("DEBUG: process tinfo");
- tinfo.process(TinfoSerial.read());
- }
+ if ( WiFi.status() == WL_CONNECTED ) {
+ Serial.println("DEBUG wifi connected, start temp measure");
+ sensors_event_t event;
+
+ dht.temperature().getEvent(&event);
+ if (isnan(event.temperature)) {
+ // Error
+ } else {
+ sendToInfluxDB("temperature,city="+city+",location="+location, "value", String(event.temperature));
+ }
+ dht.humidity().getEvent(&event);
+ if (isnan(event.relative_humidity)) {
+ // Error
+ } else {
+ sendToInfluxDB("humidity,city="+city+",location="+location, "value", String(event.relative_humidity));
+ }
+ sendToInfluxDB("teleinfo,city="+city+",location="+location, "SINSTS", tinfo_SINSTS);
+ sendToInfluxDB("teleinfo,city="+city+",location="+location, "SINSTS1", tinfo_SINSTS1);
+ sendToInfluxDB("teleinfo,city="+city+",location="+location, "SINSTS2", tinfo_SINSTS2);
+ sendToInfluxDB("teleinfo,city="+city+",location="+location, "SINSTS3", tinfo_SINSTS3);
+ sendToInfluxDB("teleinfo,city="+city+",location="+location, "IRMS1", tinfo_IRMS1);
+ sendToInfluxDB("teleinfo,city="+city+",location="+location, "IRMS2", tinfo_IRMS2);
+ sendToInfluxDB("teleinfo,city="+city+",location="+location, "IRMS3", tinfo_IRMS3);
+ sendToInfluxDB("teleinfo,city="+city+",location="+location, "URMS1", tinfo_URMS1);
+ sendToInfluxDB("teleinfo,city="+city+",location="+location, "URMS2", tinfo_URMS2);
+ sendToInfluxDB("teleinfo,city="+city+",location="+location, "URMS3", tinfo_URMS3);
+ sendToInfluxDB("teleinfo,city="+city+",location="+location, "EAST", tinfo_EAST);
+ }
+ }
+ if ( TinfoSerial.available() ) {
+ tinfo.process(TinfoSerial.read());