   int response;
   bool timeout=false;
   time_t ts;
+  boolean sendingad=false;
 
   ts=now();
   buildTime(ts,chbuf);

    }
  }
  else if (timeout) {
    iotName(cntArr[0].name);
    iotAddValue(cntArr[0].measured.analog,chbuf);
    iotNext();
    cntPrepareForNext(0,ts);
  }

// in future this table shall be stored mainly in eeprom.
// and so is it's size
struct ad adArr[]= {          //prev   dif    min       max         meas    delta
  {2,"boiler",       0,0,     0,0.0, 0,0.5, 174,21.0, 935, 100.0,  0,0.0,  0,0.0},
  {3,"ambient",      0,0,     0,0.0, 0,0.3, 372,2.2,  964,  36.5,  0,0.0,  0,0.0},
  {4,"hothousewater",0,0,     0,0.0, 0,0.5, 7,  21.0, 1023,100.0,  0,0.0,  0,0.0},
  {5,"radiator",     0,0,     0,0.0, 0,0.3, 7,  21.0, 539,  36.5,  0,0.0,  0,0.0}
};


// counters are kept in array, this for preparing to have more of them.

struct cnt cntArr[] = {         //prev prevsnd    diff   factor  scale  measured
  {0,"electricity",  0,0,0,0,     0,0.0, 0,0.0,   0,0.1, 0,0.55, 50,1.0,  0,0.0}
};

Timer sched;
