   int fillLevel = 10;           // cms below the level sensor: drain point
   bool filling = false;         // true when closed / on
   long lastFlip = -1;           // millis at last state change
+  int floodMins = 1; // TODO 10;
 
   Valve() { number = counter++; }
   void stateChange(bool newState) { // turn on or off

/////////////////////////////////////////////////////////////////////////////
// looooooooooooooooooooop //////////////////////////////////////////////////
void loop() {
  dnsServer.processNextRequest();
  webServer.handleClient();

  if(loopCounter == TICK_MONITOR) { // monitor levels, step valves, push data

  void off() { stateChange(false); } // drain time
  void step(monitor_t* now, char cycleMins) {   // check conditions and adjust
    dbg(valveDBG, "\nvalve[].step - number = "); dln(valveDBG, number);
    int t = millis();
    dbg(valveDBG, "t = "); dln(valveDBG, t);
    if(filling && ( lastFlip + (floodMins * 60 * 1000) ) <= t) { // flood over
      dbg(valveDBG, "t = "); dln(valveDBG, t);
      dbg(valveDBG, "lastFlip = "); dln(valveDBG, lastFlip);
      dbg(valveDBG, "floodMins = "); dln(valveDBG, floodMins);
      dbg(valveDBG, "floodMins * 60 * 1000 = ");
      dln(valveDBG, floodMins * 60 * 1000);
      off();
    } else if(!filling && ( startTime <= t )) { // time to start filling
      on();
      startTime += (cycleMins * 60 * 1000);
      dbg(valveDBG, "startTime = "); dln(valveDBG, startTime);
    }
    /* old version using level sensors:
    else if(filling && full(now)) {           // we're full
      off();
    } 
    */
  }
int averageLevel1 = 22; // TODO
int averageLevel2 = 22;
