ESP8266 Heating Controller with Blynk UI

Just thought iā€™d show off my ESP8266 Heating Controller/Thermostat with Blynk interface project.

HEATING PROJECT

4 Likes

Great project. Can you please help me what shuld I change in code if I have simple relay board controling my heater instead of 433mhz radio module.
I guess that only

void heatingControl(boolean onOff) 
{ 
 Serial.print(millis()); 
 Serial.println(" Transmitting " + String(onOff ? "ON signal" : "OFF signal")); 
 int on[]   = {0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1}; 
 int off[]  = {0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1}; 
 for (int repeat = 1; repeat <= 3; repeat++) 
 { 
   for (int i = 0; i < sizeof( onOff ? on : off  ) / sizeof( int ); i++) { 
 switch (onOff ? on[i] : off[i]) 
 { 
   case 0: 
     digitalWrite(dataPin, LOW); 
     delayMicroseconds(500); 
     digitalWrite(dataPin, HIGH); 
     delayMicroseconds(500); 
     break; 
   case 1: 
     digitalWrite(dataPin, HIGH); 
     delayMicroseconds(500); 
     digitalWrite(dataPin, LOW); 
     delayMicroseconds(500); 
     break; 
   case 2: 
     digitalWrite(dataPin, LOW); 
     delayMicroseconds(500); 
     break; 
 } 
   } 
   int waitTime = millis(); 
   if ((millis() - waitTime) < 1000) { 
 Blynk.run(); 
   } 
 } 
 Blynk.virtualWrite(V1, String(onOff ? "Heating ON" : "Heating OFF"));   
 Blynk.setProperty(V1, "color", String(onOff ? "#00FF00" : "#FF0000"));  
 lastTransmit = millis(); 
} 

should be changed with something like

BLYNK_WRITE(V1)
{
int buttonState = param.asInt();
if (param.asInt()==1)
{
digitalWrite(14, HIGH);
}
else
{
digitalWrite(14, LOW);
}
}

Yes, that is correct.