 unsigned long previousTime;
 
 // Flowmeter variables
-volatile int  flowmeterCounter;     // Measures flow meter pulses
-unsigned int  flowmeterResult;      // Calculated litres/hour
-unsigned long beginFlowmeterDate;   // Begin date
+volatile int  flowmeterInCounter;     // Measures flow meter pulses
+unsigned int  flowmeterInResult;      // Calculated litres/hour
+volatile int  flowmeterOutCounter;     // Measures flow meter pulses
+unsigned int  flowmeterOutResult;      // Calculated litres/hour
 
 void setup() {
   Serial.begin(9600);

    digitalWrite(pump, HIGH);
  } else if (command.startsWith("URBAN_NETWORK=0")) {
    Serial.println("URBAN_NETWORK=0");
    digitalWrite(urbanNetwork, LOW);
  } else if (command.startsWith("URBAN_NETWORK=1")) {
    Serial.println("URBAN_NETWORK=1");
    digitalWrite(urbanNetwork, HIGH);
  }
}


  // Pump
  setupPump();

  // Electrovanne
  setupElectrovanne();

  setupUrbanNetwork();
}

void loop() {
  // Send values
  if (checkSending()) {
    readFlowmeterIn();
    readFlowmeterOut();
    readWaterDistance();
  }

