fix turn on/off of fan and switch to humidity mode
This commit is contained in:
parent
ffb62b9297
commit
5943ffc97b
@ -38,7 +38,7 @@ void Heating::init(Temperature *tempsensor, unsigned mode) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case HUMIDITY:
|
case HUMIDITY:
|
||||||
mFanWaiting = false;
|
mHeatingStatus = false;
|
||||||
|
|
||||||
mHeizungTicker.attach(10, [&tempsensor, this]() {
|
mHeizungTicker.attach(10, [&tempsensor, this]() {
|
||||||
// shedule this function because tempread is blocking
|
// shedule this function because tempread is blocking
|
||||||
@ -58,24 +58,21 @@ void Heating::init(Temperature *tempsensor, unsigned mode) {
|
|||||||
// turn on heating and fan
|
// turn on heating and fan
|
||||||
digitalWrite(LuefterPin, HIGH);
|
digitalWrite(LuefterPin, HIGH);
|
||||||
digitalWrite(HeizungPin, HIGH);
|
digitalWrite(HeizungPin, HIGH);
|
||||||
|
mHeatingStatus = true;
|
||||||
// if fan waiting detach its ticker
|
|
||||||
if (mFanWaiting) {
|
|
||||||
mLuefterTicker.detach();
|
|
||||||
mFanWaiting = false;
|
|
||||||
}
|
|
||||||
} else if (hum < 60.0) {
|
} else if (hum < 60.0) {
|
||||||
// if humidity too low turn off heating and fan after 60secs
|
// if humidity too low turn off heating and fan after 60secs
|
||||||
digitalWrite(HeizungPin, LOW);
|
digitalWrite(HeizungPin, LOW);
|
||||||
Serial.println("heating should NOT run now!");
|
Serial.println("heating should NOT run now!");
|
||||||
if (!mFanWaiting) {
|
|
||||||
mFanWaiting = true;
|
// if heating status in on set ticker to turn of fan in 60sec
|
||||||
|
if (mHeatingStatus) {
|
||||||
mLuefterTicker.once(60, []() {
|
mLuefterTicker.once(60, []() {
|
||||||
// turn off fan
|
// turn off fan
|
||||||
digitalWrite(LuefterPin, LOW);
|
digitalWrite(LuefterPin, LOW);
|
||||||
Serial.println("turning off fan");
|
Serial.println("turning off fan");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
mHeatingStatus = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -17,5 +17,5 @@ private:
|
|||||||
Ticker mLuefterTicker;
|
Ticker mLuefterTicker;
|
||||||
Ticker mTurnOffTicker;
|
Ticker mTurnOffTicker;
|
||||||
|
|
||||||
bool mFanWaiting;
|
bool mHeatingStatus;
|
||||||
};
|
};
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "Pins.h"
|
#include "Pins.h"
|
||||||
#include "Temperature.h"
|
#include "Temperature.h"
|
||||||
|
|
||||||
#define VERSION "v1.1"
|
#define VERSION "v1.1.1"
|
||||||
|
|
||||||
bool allow;
|
bool allow;
|
||||||
bool error = false;
|
bool error = false;
|
||||||
@ -149,9 +149,6 @@ void setup() {
|
|||||||
digitalWrite(SchuetzPin, LOW); //pumpe anfangs sofort abschalten
|
digitalWrite(SchuetzPin, LOW); //pumpe anfangs sofort abschalten
|
||||||
digitalWrite(LuefterPin, LOW);
|
digitalWrite(LuefterPin, LOW);
|
||||||
digitalWrite(HeizungPin, LOW);
|
digitalWrite(HeizungPin, LOW);
|
||||||
//
|
|
||||||
// digitalWrite(HeizungPin, HIGH);
|
|
||||||
// delay(1000000);
|
|
||||||
|
|
||||||
// initilize serial connection
|
// initilize serial connection
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
@ -188,8 +185,9 @@ void setup() {
|
|||||||
Serial.println("Initializing wifi");
|
Serial.println("Initializing wifi");
|
||||||
mang.init(&temp);
|
mang.init(&temp);
|
||||||
|
|
||||||
|
// initialize heating control
|
||||||
Serial.println("initializing heating service");
|
Serial.println("initializing heating service");
|
||||||
mHeat.init(&temp, Heating::TIME);
|
mHeat.init(&temp, Heating::HUMIDITY);
|
||||||
|
|
||||||
Serial.println("startup sequence complete!\n");
|
Serial.println("startup sequence complete!\n");
|
||||||
digitalWrite(LED_BUILTIN, HIGH);
|
digitalWrite(LED_BUILTIN, HIGH);
|
||||||
|
Loading…
Reference in New Issue
Block a user