void JSstringK()
{ delay(0);
String id2="2";
    board2["id"] =id2;
  board2["tkom1"] = tkom1;
    board2["hkom1"] = hkom1;
     board2["batkom1"] = batkom1;
     board2["timekom1"] = timekom1;
      board2["tkom2"] = tkom2;
    board2["hkom2"] = hkom2;
     board2["batkom2"] = batkom2;
     board2["timekom2"] = timekom2;
      board2["tkor"] = tkor;
    board2["hkor"] = hkor;
     board2["batkor"] = batkor;
     board2["timekor"] = timekor;
      board2["tbal"] = tbal;
    board2["hbal"] = hbal;
     board2["batbal"] = batbal;
     board2["timebal"] = timebal;
        board2["tul1"] = tul1;
    board2["hul1"] = hul1;
     board2["osv1"] = osv1;
     board2["timeul1"] = timeul1;
jsonString2 = JSON.stringify(board2); 
   Serial.println (jsonString2); 
}


void JSstringU()
{delay(0);
String id0="0";
    board["id"] =id0;

if(flread==0)
{
 board["temperature"] =ts;
//   t1 = incomingReadings.temp;
  board["humidity"] =hs; //значение считаное с SD
  board["tim2"] = tim2;
      
}
 else
 {//float t1=12.456787;
  board["temperature"] =t1;
 // board["temperature"] =incomingReadings.temp;
//float h1=77.456787;
 board["humidity"] =h1;//принятое значение
//  board["humidity"] =incomingReadings.hum;
   if(min1<10)
  {
   board["tim2"] = String(hour1)+":0"+String(min1); 
  }
  else
  {
    board["tim2"] =String(hour1)+":"+String(min1); 
  }
 }
  //********************
  board["batz"] = batz;
   board["tim3"] = tim3;
  //*****************
    board["dataserv"] = dataserv;
     board["timeserv"] = timeserv;
     Serial.println("timeJS");
      Serial.println(EpochTime);

     board["munthserv"] = munthserv;
     board["weekserv"] = weekserv;
     board["timev"] = timev;
      board["EpochTime"] = EpochTime;
  
 // jsonString = JSON.stringify(board);
  jsonString = JSON.stringify(board);//{"id":"2","temperature":9.6733450317382812,"humidity":50.41815185546875,"tim2":"12:02","dataserv":"12","timeserv":"15:30","munthserv":"январь",weekserv:"среда"}
 // events.send(jsonString.c_str(), "new_readings", millis());//обновление веба текущая температура
  Serial.println (jsonString);
}

void JSstringAkva()// 0-выкл  1-вкл gpio[3]={0,0,0}
{if(akva==1)
{  String id="akva";
 board5["id"] =id;
  board5["tempakv1"] =takva1;
  board5["light1"] =String(lightakv);
    board5["timakv1"] =timeakva;
    if(fanak1==0)
    {fan1="OFF";
    }
    else
    {
      fan1="ON";
    }
     board5["fan1"] =fan1;
      board5["tempakv2"] =takva2;
   board5["light2"] =String(lightakv);
    board5["timakv2"] =timeakva;
     if(fanak2==0)
    {fan2="OFF";
    }
    else
    {
      fan2="ON";
    }
     board5["fan2"] =fan2;
      board5["tempakv3"] =takva3;
   board5["light3"] =String(lightakv);
    board5["timakv3"] =timeakva;
     if(fanak3==0)
    {fan3="OFF";
    }
    else
    {
      fan3="ON";
    }
     board5["fan3"] =fan3;

 jsonStringakva = JSON.stringify(board5);
}
 //jsonStringakva="{\"id\":\"akva\",\"tempakv1\":\"20,1\",\"light1\":\"80 %\",\"timakv1\":\"12.31\",\"fan1\":\"OFF\",\"tempakv2\":\"20,2\",\"light2\":\"82 %\",\"timakv2\":\"12.32\",\"fan2\":\"OFF\",\"tempakv3\":\"20,3\",\"light3\":\"83 %\",\"timakv3\":\"12.33\",\"fan3\":\"OFF\"}";
   Serial.println(jsonStringakva);
}
void JSstringOut()// 0-выкл  1-вкл gpio[3]={0,0,0}
{String id="out";
   board4["id"] =id;
  board4["out1"] = String(gpio[0])+String(gpio[1])+String(gpio[2])+String(gpio[3]);
   jsonStringout = JSON.stringify(board4);//jsonStringout= "{"id":"out","out1":"1011"}";
   Serial.println(jsonStringout);
}
