Compare commits
No commits in common. "master" and "v1.2.3" have entirely different histories.
@ -16,7 +16,7 @@ build:
|
|||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- "platformio run -e esp12e"
|
- "platformio run -e esp12e"
|
||||||
- vers=$(grep -Po '[0-9]+\.[0-9]+\.[0-9]+[-0-9A-Za-z]*(?=\")' ./src/Pins.h)
|
- vers=$(grep -Po '[0-9]*\.[0-9]*\.[0-9]*(?=\")' ./src/Pins.h)
|
||||||
- mv .pio/build/esp12e/*.bin Pumpensteuerung-${vers}.bin
|
- mv .pio/build/esp12e/*.bin Pumpensteuerung-${vers}.bin
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
|
@ -13,7 +13,6 @@ build_flags =
|
|||||||
-D FACTORY_AP_LOCAL_IP=\"192.168.4.1\"
|
-D FACTORY_AP_LOCAL_IP=\"192.168.4.1\"
|
||||||
-D FACTORY_AP_GATEWAY_IP=\"192.168.4.1\"
|
-D FACTORY_AP_GATEWAY_IP=\"192.168.4.1\"
|
||||||
-D FACTORY_AP_SUBNET_MASK=\"255.255.255.0\"
|
-D FACTORY_AP_SUBNET_MASK=\"255.255.255.0\"
|
||||||
-D FACTORY_AP_VISIBLE=true
|
|
||||||
|
|
||||||
; User credentials for admin and guest user
|
; User credentials for admin and guest user
|
||||||
-D FACTORY_ADMIN_USERNAME=\"admin\"
|
-D FACTORY_ADMIN_USERNAME=\"admin\"
|
||||||
|
@ -3,9 +3,8 @@ import { TextValidator, ValidatorForm, SelectValidator } from 'react-material-ui
|
|||||||
|
|
||||||
import MenuItem from '@material-ui/core/MenuItem';
|
import MenuItem from '@material-ui/core/MenuItem';
|
||||||
import SaveIcon from '@material-ui/icons/Save';
|
import SaveIcon from '@material-ui/icons/Save';
|
||||||
import Checkbox from '@material-ui/core/Checkbox';
|
|
||||||
|
|
||||||
import {PasswordValidator, RestFormProps, FormActions, FormButton, BlockFormControlLabel} from '../components';
|
import { PasswordValidator, RestFormProps, FormActions, FormButton } from '../components';
|
||||||
|
|
||||||
import { isAPEnabled } from './APModes';
|
import { isAPEnabled } from './APModes';
|
||||||
import { APSettings, APProvisionMode } from './types';
|
import { APSettings, APProvisionMode } from './types';
|
||||||
@ -92,16 +91,6 @@ class APSettingsForm extends React.Component<APSettingsFormProps> {
|
|||||||
onChange={handleValueChange('subnet_mask')}
|
onChange={handleValueChange('subnet_mask')}
|
||||||
margin="normal"
|
margin="normal"
|
||||||
/>
|
/>
|
||||||
<BlockFormControlLabel
|
|
||||||
control={
|
|
||||||
<Checkbox
|
|
||||||
value="network_visible"
|
|
||||||
checked={data.network_visible}
|
|
||||||
onChange={handleValueChange("network_visible")}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
label="Network visible?"
|
|
||||||
/>
|
|
||||||
</Fragment>
|
</Fragment>
|
||||||
}
|
}
|
||||||
<FormActions>
|
<FormActions>
|
||||||
|
@ -24,5 +24,4 @@ export interface APSettings {
|
|||||||
local_ip: string;
|
local_ip: string;
|
||||||
gateway_ip: string;
|
gateway_ip: string;
|
||||||
subnet_mask: string;
|
subnet_mask: string;
|
||||||
network_visible: boolean;
|
|
||||||
}
|
}
|
||||||
|
@ -57,12 +57,6 @@ class GeneralInformation extends Component<GeneralInformationRestControllerProps
|
|||||||
secondary={props.data.lastPumpDuration !== 0 ? stringifyTime(props.data.lastPumpDuration) : "-"}
|
secondary={props.data.lastPumpDuration !== 0 ? stringifyTime(props.data.lastPumpDuration) : "-"}
|
||||||
/>
|
/>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<ListItem>
|
|
||||||
<ListItemText
|
|
||||||
primary="Pumpzyklen seit Programmstart"
|
|
||||||
secondary={props.data.pumpcycles}
|
|
||||||
/>
|
|
||||||
</ListItem>
|
|
||||||
<ListItem>
|
<ListItem>
|
||||||
<ListItemText
|
<ListItemText
|
||||||
primary="WasserSensor / DruckSensor"
|
primary="WasserSensor / DruckSensor"
|
||||||
|
@ -39,12 +39,6 @@ class HeatingInformation extends React.Component<HeatingRestcontollerprops> {
|
|||||||
secondary={props.data.lastheatduration === 0 ? "-" : props.data.lastheatduration === -1 ? "läuft gerade!" : stringifyTime(props.data.lastheatduration)}
|
secondary={props.data.lastheatduration === 0 ? "-" : props.data.lastheatduration === -1 ? "läuft gerade!" : stringifyTime(props.data.lastheatduration)}
|
||||||
/>
|
/>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<ListItem>
|
|
||||||
<ListItemText
|
|
||||||
primary="Gesammte Heizdauer / Prozentuelle Einschaltzeit"
|
|
||||||
secondary={stringifyTime(props.data.totalheattime) + ' / ' + (props.data.heattimepercent * 100).toFixed(2) + '%'}
|
|
||||||
/>
|
|
||||||
</ListItem>
|
|
||||||
<ListItem>
|
<ListItem>
|
||||||
<ListItemText
|
<ListItemText
|
||||||
primary="Temperatur/Luftfeuchtigkeit:"
|
primary="Temperatur/Luftfeuchtigkeit:"
|
||||||
|
@ -14,7 +14,6 @@ export interface GeneralInformaitonState {
|
|||||||
watersensor: boolean;
|
watersensor: boolean;
|
||||||
pressuresensor: boolean;
|
pressuresensor: boolean;
|
||||||
version: string;
|
version: string;
|
||||||
pumpcycles: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface HeatingInformationState {
|
export interface HeatingInformationState {
|
||||||
@ -22,6 +21,5 @@ export interface HeatingInformationState {
|
|||||||
lastheatduration: number;
|
lastheatduration: number;
|
||||||
hum: number;
|
hum: number;
|
||||||
temp: number;
|
temp: number;
|
||||||
totalheattime: number;
|
|
||||||
heattimepercent: number;
|
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ void APSettingsService::manageAP() {
|
|||||||
void APSettingsService::startAP() {
|
void APSettingsService::startAP() {
|
||||||
Serial.println(F("Starting software access point"));
|
Serial.println(F("Starting software access point"));
|
||||||
WiFi.softAPConfig(_state.localIP, _state.gatewayIP, _state.subnetMask);
|
WiFi.softAPConfig(_state.localIP, _state.gatewayIP, _state.subnetMask);
|
||||||
WiFi.softAP(_state.ssid.c_str(), _state.password.c_str(), 1, !_state.networkVisible);
|
WiFi.softAP(_state.ssid.c_str(), _state.password.c_str());
|
||||||
if (!_dnsServer) {
|
if (!_dnsServer) {
|
||||||
IPAddress apIp = WiFi.softAPIP();
|
IPAddress apIp = WiFi.softAPIP();
|
||||||
Serial.print(F("Starting captive portal on "));
|
Serial.print(F("Starting captive portal on "));
|
||||||
|
@ -28,10 +28,6 @@
|
|||||||
#define FACTORY_AP_PASSWORD "esp-react"
|
#define FACTORY_AP_PASSWORD "esp-react"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FACTORY_AP_VISIBLE
|
|
||||||
#define FACTORY_AP_VISIBLE true
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef FACTORY_AP_LOCAL_IP
|
#ifndef FACTORY_AP_LOCAL_IP
|
||||||
#define FACTORY_AP_LOCAL_IP "192.168.4.1"
|
#define FACTORY_AP_LOCAL_IP "192.168.4.1"
|
||||||
#endif
|
#endif
|
||||||
@ -57,11 +53,10 @@ class APSettings {
|
|||||||
IPAddress localIP;
|
IPAddress localIP;
|
||||||
IPAddress gatewayIP;
|
IPAddress gatewayIP;
|
||||||
IPAddress subnetMask;
|
IPAddress subnetMask;
|
||||||
bool networkVisible;
|
|
||||||
|
|
||||||
bool operator==(const APSettings& settings) const {
|
bool operator==(const APSettings& settings) const {
|
||||||
return provisionMode == settings.provisionMode && ssid == settings.ssid && password == settings.password &&
|
return provisionMode == settings.provisionMode && ssid == settings.ssid && password == settings.password &&
|
||||||
localIP == settings.localIP && gatewayIP == settings.gatewayIP && subnetMask == settings.subnetMask && networkVisible == settings.networkVisible;
|
localIP == settings.localIP && gatewayIP == settings.gatewayIP && subnetMask == settings.subnetMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void read(APSettings& settings, JsonObject& root) {
|
static void read(APSettings& settings, JsonObject& root) {
|
||||||
@ -71,7 +66,6 @@ class APSettings {
|
|||||||
root["local_ip"] = settings.localIP.toString();
|
root["local_ip"] = settings.localIP.toString();
|
||||||
root["gateway_ip"] = settings.gatewayIP.toString();
|
root["gateway_ip"] = settings.gatewayIP.toString();
|
||||||
root["subnet_mask"] = settings.subnetMask.toString();
|
root["subnet_mask"] = settings.subnetMask.toString();
|
||||||
root["network_visible"] = settings.networkVisible;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static StateUpdateResult update(JsonObject& root, APSettings& settings) {
|
static StateUpdateResult update(JsonObject& root, APSettings& settings) {
|
||||||
@ -87,7 +81,6 @@ class APSettings {
|
|||||||
}
|
}
|
||||||
newSettings.ssid = root["ssid"] | FACTORY_AP_SSID;
|
newSettings.ssid = root["ssid"] | FACTORY_AP_SSID;
|
||||||
newSettings.password = root["password"] | FACTORY_AP_PASSWORD;
|
newSettings.password = root["password"] | FACTORY_AP_PASSWORD;
|
||||||
newSettings.networkVisible = root["network_visible"] | FACTORY_AP_VISIBLE;
|
|
||||||
|
|
||||||
JsonUtils::readIP(root, "local_ip", newSettings.localIP, FACTORY_AP_LOCAL_IP);
|
JsonUtils::readIP(root, "local_ip", newSettings.localIP, FACTORY_AP_LOCAL_IP);
|
||||||
JsonUtils::readIP(root, "gateway_ip", newSettings.gatewayIP, FACTORY_AP_GATEWAY_IP);
|
JsonUtils::readIP(root, "gateway_ip", newSettings.gatewayIP, FACTORY_AP_GATEWAY_IP);
|
||||||
|
@ -9,8 +9,7 @@
|
|||||||
GeneralInfoService::GeneralInfoService(AsyncWebServer *server) :
|
GeneralInfoService::GeneralInfoService(AsyncWebServer *server) :
|
||||||
lastPumpTime(0),
|
lastPumpTime(0),
|
||||||
lastWaterOutage(0),
|
lastWaterOutage(0),
|
||||||
lastPumpDuration(0),
|
lastPumpDuration(0) {
|
||||||
pumpCycles(0) {
|
|
||||||
server->on(GENERALINFO_SERVICE_PATH, HTTP_GET, std::bind(&GeneralInfoService::reply, this, std::placeholders::_1));
|
server->on(GENERALINFO_SERVICE_PATH, HTTP_GET, std::bind(&GeneralInfoService::reply, this, std::placeholders::_1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,8 +27,6 @@ void GeneralInfoService::reply(AsyncWebServerRequest *request) {
|
|||||||
root["watersensor"] = digitalRead(WasserSensorPin) ? true : false;
|
root["watersensor"] = digitalRead(WasserSensorPin) ? true : false;
|
||||||
root["pressuresensor"] = digitalRead(DruckSensorPin) ? true : false;
|
root["pressuresensor"] = digitalRead(DruckSensorPin) ? true : false;
|
||||||
|
|
||||||
root["pumpcycles"] = pumpCycles;
|
|
||||||
|
|
||||||
root["version"] = VERSION;
|
root["version"] = VERSION;
|
||||||
|
|
||||||
response->setLength();
|
response->setLength();
|
||||||
@ -47,7 +44,3 @@ void GeneralInfoService::setlastWaterOutage(uint32_t lastWaterOutage) {
|
|||||||
void GeneralInfoService::setPumpDuration(uint32_t lastPumpDuration) {
|
void GeneralInfoService::setPumpDuration(uint32_t lastPumpDuration) {
|
||||||
this->lastPumpDuration = lastPumpDuration;
|
this->lastPumpDuration = lastPumpDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneralInfoService::setPumpCycles(uint32_t cycles) {
|
|
||||||
this->pumpCycles = cycles;
|
|
||||||
}
|
|
||||||
|
@ -37,14 +37,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
void setPumpDuration(uint32_t lastPumpDuration);
|
void setPumpDuration(uint32_t lastPumpDuration);
|
||||||
|
|
||||||
void setPumpCycles(uint32_t i);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void reply(AsyncWebServerRequest* request);
|
void reply(AsyncWebServerRequest* request);
|
||||||
|
|
||||||
unsigned long lastPumpTime, lastWaterOutage, lastPumpDuration;
|
unsigned long lastPumpTime, lastWaterOutage, lastPumpDuration;
|
||||||
|
|
||||||
uint32_t pumpCycles;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,8 +91,6 @@ void Heating::handleHeatingEvents() {
|
|||||||
if (mHeatingStatus == true) {
|
if (mHeatingStatus == true) {
|
||||||
digitalWrite(HeizungPin, LOW);
|
digitalWrite(HeizungPin, LOW);
|
||||||
Serial.println("heating should NOT run now!");
|
Serial.println("heating should NOT run now!");
|
||||||
// add the heat time it took to the total
|
|
||||||
mheatingservice->addHeatTime(Timer::getSystemSeconds() - mheatingservice->getLastHeatingStartTime());
|
|
||||||
|
|
||||||
// if heating status in on set ticker to turn of fan in 60sec
|
// if heating status in on set ticker to turn of fan in 60sec
|
||||||
if (mHeatingStatus) {
|
if (mHeatingStatus) {
|
||||||
|
@ -10,8 +10,7 @@ HeatingInfoService::HeatingInfoService(AsyncWebServer *server) :
|
|||||||
hum(-1),
|
hum(-1),
|
||||||
temp(-1),
|
temp(-1),
|
||||||
lastheating(0),
|
lastheating(0),
|
||||||
lastheatend(0),
|
lastheatend(0) {
|
||||||
totalHeatTime(0) {
|
|
||||||
server->on(HEATINGINFO_SERVICE_PATH, HTTP_GET, std::bind(&HeatingInfoService::reply, this, std::placeholders::_1));
|
server->on(HEATINGINFO_SERVICE_PATH, HTTP_GET, std::bind(&HeatingInfoService::reply, this, std::placeholders::_1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,9 +28,6 @@ void HeatingInfoService::reply(AsyncWebServerRequest *request) {
|
|||||||
// if lastheatend == 0 => heating is currently active
|
// if lastheatend == 0 => heating is currently active
|
||||||
root["lastheatduration"] = lastheating == 0 ? 0 : lastheatend == 0 ? -1 : lastheatend - lastheating;
|
root["lastheatduration"] = lastheating == 0 ? 0 : lastheatend == 0 ? -1 : lastheatend - lastheating;
|
||||||
|
|
||||||
root["totalheattime"] = this->totalHeatTime;
|
|
||||||
root["heattimepercent"] = (float)this->totalHeatTime / (float)Timer::getSystemSeconds();
|
|
||||||
|
|
||||||
response->setLength();
|
response->setLength();
|
||||||
request->send(response);
|
request->send(response);
|
||||||
}
|
}
|
||||||
@ -48,11 +44,3 @@ void HeatingInfoService::setLastHeatingStarttime(unsigned long time) {
|
|||||||
void HeatingInfoService::setLastHetingEndtime(unsigned long time) {
|
void HeatingInfoService::setLastHetingEndtime(unsigned long time) {
|
||||||
this->lastheatend = time;
|
this->lastheatend = time;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t HeatingInfoService::getLastHeatingStartTime() {
|
|
||||||
return this->lastheating;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HeatingInfoService::addHeatTime(uint32_t time) {
|
|
||||||
totalHeatTime += time;
|
|
||||||
}
|
|
||||||
|
@ -18,16 +18,9 @@ public:
|
|||||||
void setSensorData(float hum, float temp);
|
void setSensorData(float hum, float temp);
|
||||||
|
|
||||||
void setLastHeatingStarttime(unsigned long time);
|
void setLastHeatingStarttime(unsigned long time);
|
||||||
uint32_t getLastHeatingStartTime();
|
|
||||||
|
|
||||||
void setLastHetingEndtime(unsigned long time);
|
void setLastHetingEndtime(unsigned long time);
|
||||||
|
|
||||||
/**
|
|
||||||
* add time how long the heater heated
|
|
||||||
* @param time time in seconds
|
|
||||||
*/
|
|
||||||
void addHeatTime(uint32_t time);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void reply(AsyncWebServerRequest* request);
|
void reply(AsyncWebServerRequest* request);
|
||||||
|
|
||||||
@ -36,8 +29,6 @@ private:
|
|||||||
|
|
||||||
unsigned long lastheating;
|
unsigned long lastheating;
|
||||||
unsigned long lastheatend;
|
unsigned long lastheatend;
|
||||||
|
|
||||||
uint32_t totalHeatTime;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,6 +16,6 @@
|
|||||||
#define TempSensorPin D4
|
#define TempSensorPin D4
|
||||||
|
|
||||||
// version info
|
// version info
|
||||||
#define VERSION "v1.2.4-Alpha2"
|
#define VERSION "v1.2.3"
|
||||||
|
|
||||||
#endif //PUMPENSTEUERUNG_PINS_H
|
#endif //PUMPENSTEUERUNG_PINS_H
|
||||||
|
77
src/main.cpp
77
src/main.cpp
@ -15,13 +15,12 @@ bool error = false;
|
|||||||
Ticker status;
|
Ticker status;
|
||||||
|
|
||||||
//pumpendauer maximum ticker
|
//pumpendauer maximum ticker
|
||||||
Ticker pumpendauer, wasserSensorDoubleCheck;
|
Ticker pumpendauer;
|
||||||
|
|
||||||
//WifiManager mang;
|
//WifiManager mang;
|
||||||
Heating mHeat;
|
Heating mHeat;
|
||||||
|
|
||||||
uint32_t turnontime = 0;
|
uint32_t turnontime = 0;
|
||||||
uint32_t pumpcycles = 0;
|
|
||||||
|
|
||||||
AsyncWebServer server(80);
|
AsyncWebServer server(80);
|
||||||
ESP8266React esp8266React(&server);
|
ESP8266React esp8266React(&server);
|
||||||
@ -42,13 +41,9 @@ void pumpeSchalten(bool on) {
|
|||||||
|
|
||||||
if (allow && !error) {
|
if (allow && !error) {
|
||||||
if (on) {
|
if (on) {
|
||||||
pumpcycles++;
|
pumpendauer.once((float)settingsservice.getSettings()->maxpumpduration + 1, []() {
|
||||||
generalinfo.setPumpCycles(pumpcycles);
|
|
||||||
|
|
||||||
pumpendauer.once((float) settingsservice.getSettings()->maxpumpduration + 1, []() {
|
|
||||||
//erlaube keine einschaltung von mehr als 60 sek
|
//erlaube keine einschaltung von mehr als 60 sek
|
||||||
if (Timer::getSystemSeconds() - turnontime >=
|
if (Timer::getSystemSeconds() - turnontime >= (unsigned)settingsservice.getSettings()->maxpumpduration && turnontime != 0) {
|
||||||
(unsigned) settingsservice.getSettings()->maxpumpduration && turnontime != 0) {
|
|
||||||
//error zu lange
|
//error zu lange
|
||||||
Serial.println("\n\npumpe lief mehr als 10 Minuten durchgaengig");
|
Serial.println("\n\npumpe lief mehr als 10 Minuten durchgaengig");
|
||||||
pumpeSchalten(false);
|
pumpeSchalten(false);
|
||||||
@ -65,8 +60,7 @@ void pumpeSchalten(bool on) {
|
|||||||
digitalWrite(SchuetzPin, on);
|
digitalWrite(SchuetzPin, on);
|
||||||
Serial.println("[Erfolg] pumpe wird geschalten");
|
Serial.println("[Erfolg] pumpe wird geschalten");
|
||||||
} else {
|
} else {
|
||||||
Serial.println(
|
Serial.println("[FEHLGESCHLAGEN] Schalten des Schütz gesperrt durch Timeout oder Fehler-- sofortiges ausschalten der pumpe\n");
|
||||||
"[FEHLGESCHLAGEN] Schalten des Schütz gesperrt durch Timeout oder Fehler-- sofortiges ausschalten der pumpe\n");
|
|
||||||
turnontime = -1;
|
turnontime = -1;
|
||||||
digitalWrite(SchuetzPin, LOW);
|
digitalWrite(SchuetzPin, LOW);
|
||||||
}
|
}
|
||||||
@ -95,46 +89,39 @@ int wateroutagewaitduration;
|
|||||||
|
|
||||||
void WasserSensorCheck() {
|
void WasserSensorCheck() {
|
||||||
if (digitalRead(WasserSensorPin) == LOW) {
|
if (digitalRead(WasserSensorPin) == LOW) {
|
||||||
// check if water sensor is also low after 500ms and lock it then
|
Serial.println("Wasser Sensor AUS");
|
||||||
wasserSensorDoubleCheck.once_ms(500, []() {
|
//kein Wasser dh timer auf 10min stellen
|
||||||
if (digitalRead(WasserSensorPin) == LOW) {
|
|
||||||
Serial.println("Wasser Sensor AUS");
|
|
||||||
//kein Wasser dh timer auf 10min stellen
|
|
||||||
|
|
||||||
// refresh wateroutage counter
|
// refresh wateroutage counter
|
||||||
generalinfo.setlastWaterOutage(Timer::getSystemSeconds());
|
generalinfo.setlastWaterOutage(Timer::getSystemSeconds());
|
||||||
|
|
||||||
allow = false;
|
allow = false;
|
||||||
Serial.println("Schalte pumpe aus");
|
Serial.println("Schalte pumpe aus");
|
||||||
pumpeSchalten(false);
|
pumpeSchalten(false);
|
||||||
|
|
||||||
Serial.println("warte 30min");
|
Serial.println("warte 30min");
|
||||||
|
|
||||||
|
status.detach();
|
||||||
|
|
||||||
|
wateroutagewaitduration = settingsservice.getSettings()->waterOutageWaitDuration;
|
||||||
|
status.attach(5, []() {
|
||||||
|
wateroutagewaitduration -= 5;
|
||||||
|
Serial.print("noch ");
|
||||||
|
Serial.print(wateroutagewaitduration);
|
||||||
|
Serial.println(" Sekunden verbleibend");
|
||||||
|
|
||||||
|
if (wateroutagewaitduration <= 0) {
|
||||||
|
if (digitalRead(WasserSensorPin)) {
|
||||||
|
allow = true;
|
||||||
|
Serial.println("Einschalten der Pumpe wieder erlaubt.");
|
||||||
|
|
||||||
|
//pruefen ob drucksensor ein
|
||||||
|
DruckschalterInt();
|
||||||
|
} else {
|
||||||
|
Serial.print("wassersensor immer noch kein Wasser --> verlaengern um 120min\n\n");
|
||||||
|
WasserSensorCheck();
|
||||||
|
}
|
||||||
status.detach();
|
status.detach();
|
||||||
|
|
||||||
wateroutagewaitduration = settingsservice.getSettings()->waterOutageWaitDuration;
|
|
||||||
|
|
||||||
status.detach();
|
|
||||||
status.attach(5, []() {
|
|
||||||
wateroutagewaitduration -= 5;
|
|
||||||
Serial.print("noch ");
|
|
||||||
Serial.print(wateroutagewaitduration);
|
|
||||||
Serial.println(" Sekunden verbleibend");
|
|
||||||
|
|
||||||
if (wateroutagewaitduration <= 0) {
|
|
||||||
status.detach();
|
|
||||||
if (digitalRead(WasserSensorPin)) {
|
|
||||||
allow = true;
|
|
||||||
Serial.println("Einschalten der Pumpe wieder erlaubt.");
|
|
||||||
|
|
||||||
//pruefen ob drucksensor ein
|
|
||||||
DruckschalterInt();
|
|
||||||
} else {
|
|
||||||
Serial.print("wassersensor immer noch kein Wasser --> verlaengern um 120min\n\n");
|
|
||||||
WasserSensorCheck();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user