thank you again!
so here is my proposed logic section:
////cooling scenario----------------------------------------------------------
//roof air is cooler than set temp
if ((setCooling == 1) && (livingTemp > roofTemp) && (roofTemp < setTemp) && (houseTemp > roofTemp) && (externTemp > roofTemp))
{
digitalWrite(roofVent, HIGH); // roof vent OPEN
digitalWrite(houseVent, LOW); // house vent closed
digitalWrite(externVent, LOW); // external vent closed
digitalWrite(upstairsFan, LOW); // ventilation fan is ON
Serial.println(F("system = ROOF air inlet selected based on roof temp being lowest temp"));
Serial.println(F("------------"));
Blynk.virtualWrite(7, 0); //hse LED on Blynk app
Blynk.run();
Blynk.virtualWrite(8, 1023); //rof LED on Blynk app
Blynk.run();
Blynk.virtualWrite(9, 0); //ext LED on Blynk app
Blynk.run();
Blynk.virtualWrite(10, 0); //nil LED on Blynk app
Blynk.run();
Blynk.email("name@hackermail.com", "Subject: Upstairs Ventilation fan on - ROOF VENT: cooling", "The ventilation fan was activated...");
Blynk.tweet((String("Upstairs: ROOF Vent selected - R:") + roofTemp + ("H:") + houseTemp + ("E:") + externTemp + ("L:") + livingTemp) + ("'C"));
}
//house air is cooler than set temp
if ((setCooling == 1) && (livingTemp > houseTemp) && (houseTemp < setTemp) && (externTemp > houseTemp) && (roofTemp > houseTemp))
{
digitalWrite(roofVent, LOW); // roof vent closed
digitalWrite(houseVent, HIGH); // house vent OPEN
digitalWrite(externVent, LOW); // external vent closed
digitalWrite(upstairsFan, LOW); // ventilation fan is ON
Serial.println(F("system = HOUSE air inlet selected based on roof temp being lowest temp"));
Serial.println(F("------------"));
Blynk.virtualWrite(7, 1023); //hse LED on Blynk app
Blynk.run();
Blynk.virtualWrite(8, 0); //rof LED on Blynk app
Blynk.run();
Blynk.virtualWrite(9, 0); //ext LED on Blynk app
Blynk.run();
Blynk.virtualWrite(10, 0); //nil LED on Blynk app
Blynk.run();
Blynk.email("name@hackermail.com", "Subject: Upstairs Ventilation fan on - HOUSE VENT: cooling", "The ventilation fan was activated...");
Blynk.tweet((String("Upstairs: HOUSE Vent selected - R:") + roofTemp + ("H:") + houseTemp + ("E:") + externTemp + ("L:") + livingTemp) + ("'C"));
}
//external air is cooler than set temp
if ((setCooling == 1) && (livingTemp > externTemp) && (externTemp < setTemp) && (houseTemp > externTemp) && (roofTemp > externTemp))
{
digitalWrite(roofVent, LOW); // roof vent closed
digitalWrite(houseVent, LOW); // house vent closed
digitalWrite(externVent, HIGH); // external vent OPEN
digitalWrite(upstairsFan, LOW); // ventilation fan is ON
Serial.println(F("system = EXTERNAL air inlet selected based on external temp being lowest temp"));
Serial.println(F("------------"));
Blynk.virtualWrite(7, 0); //hse LED on Blynk app
Blynk.run();
Blynk.virtualWrite(8, 0); //rof LED on Blynk app
Blynk.run();
Blynk.virtualWrite(9, 1023); //ext LED on Blynk app
Blynk.run();
Blynk.virtualWrite(10, 0); //nil LED on Blynk app
Blynk.run();
Blynk.email("name@hackermail.com", "Subject: Upstairs Ventilation fan on - EXTERNAL VENT: cooling", "The ventilation fan was activated...");
Blynk.tweet((String("Upstairs: EXTERNAL Vent selected - R:") + roofTemp + ("H:") + houseTemp + ("E:") + externTemp + ("L:") + livingTemp) + ("'C"));
}
////warming scenario----------------------------------------------------------
//roof air is warmer than set temp
if ((setWarming == 1) && (livingTemp < roofTemp) && (roofTemp > setTemp) && (houseTemp < roofTemp) && (externTemp < roofTemp))
{
digitalWrite(roofVent, HIGH); // roof vent OPEN
digitalWrite(houseVent, LOW); // house vent closed
digitalWrite(externVent, LOW); // external vent closed
digitalWrite(upstairsFan, LOW); // ventilation fan is ON
Serial.println(F("system = ROOF air inlet selected based on roof temp being highest temp"));
Serial.println(F("------------"));
Blynk.virtualWrite(7, 0); //hse LED on Blynk app
Blynk.run();
Blynk.virtualWrite(8, 1023); //rof LED on Blynk app
Blynk.run();
Blynk.virtualWrite(9, 0); //ext LED on Blynk app
Blynk.run();
Blynk.virtualWrite(10, 0); //nil LED on Blynk app
Blynk.run();
Blynk.email("name@hackermail.com", "Subject: Upstairs Ventilation fan on - ROOF VENT: warming", "The ventilation fan was activated...");
Blynk.tweet((String("Upstairs: ROOF Vent selected - R:") + roofTemp + ("H:") + houseTemp + ("E:") + externTemp + ("L:") + livingTemp) + ("'C"));
}
//house air is warmer than set temp
if ((setWarming == 1) && (livingTemp < houseTemp) && (houseTemp > setTemp) && (roofTemp < houseTemp) && (externTemp < houseTemp))
{
digitalWrite(roofVent, LOW); // roof vent closed
digitalWrite(houseVent, HIGH); // house vent OPEN
digitalWrite(externVent, LOW); // external vent closed
digitalWrite(upstairsFan, LOW); // ventilation fan is ON
Serial.println(F("system = HOUSE air inlet selected based on house temp being highest temp"));
Serial.println(F("------------"));
Blynk.virtualWrite(7, 1023); //hse LED on Blynk app
Blynk.run();
Blynk.virtualWrite(8, 0); //rof LED on Blynk app
Blynk.run();
Blynk.virtualWrite(9, 0); //ext LED on Blynk app
Blynk.run();
Blynk.virtualWrite(10, 0); //nil LED on Blynk app
Blynk.run();
Blynk.email("name@hackermail.com", "Subject: Upstairs Ventilation fan on - HOUSE VENT: warming", "The ventilation fan was activated...");
Blynk.tweet((String("Upstairs: HOUSE Vent selected - R:") + roofTemp + ("H:") + houseTemp + ("E:") + externTemp + ("L:") + livingTemp) + ("'C"));
}
//external is warmer than set temp
if (setWarming == 1 && livingTemp < externTemp && externTemp > setTemp && houseTemp < externTemp && roofTemp < externTemp)
{
digitalWrite(roofVent, LOW); // roof vent closed
digitalWrite(houseVent, LOW); // house vent closed
digitalWrite(externVent, HIGH); // external vent OPEN
digitalWrite(upstairsFan, LOW); // ventilation fan is ON
Serial.println(F("system = EXTERN air inlet selected based on external temp being highest temp"));
Serial.println(F("------------"));
Blynk.virtualWrite(7, 0); //hse LED on Blynk app
Blynk.run();
Blynk.virtualWrite(8, 0); //rof LED on Blynk app
Blynk.run();
Blynk.virtualWrite(9, 1023); //ext LED on Blynk app
Blynk.run();
Blynk.virtualWrite(10, 0); //nil LED on Blynk app
Blynk.run();
Blynk.email("name@hackermail.com", "Subject: Upstairs Ventilation fan on - EXTERN VENT: warming", "The ventilation fan was activated...");
Blynk.tweet((String("Upstairs: EXTERN Vent selected - R:") + roofTemp + ("H:") + houseTemp + ("E:") + externTemp + ("L:") + livingTemp) + ("'C"));
}
i have not field tested it as i am awaiting arrival of more DHT22 sensors…
will this logic mean that i can set a temperature using slider, e.g. 23, and then select the warming button and the code will determine which intake has the warmest air and turn the fan on on the condition that the selected vent air is warmer than the living room air AND warmer than the set temperature?
also - will that blynk.tweet string work?
also - if i have the two buttons, is there a way of Blynk “unpressing” the warming button if i change from warming to cooling - or do i have to unpress the button in the app myself after i press the cooling button?