/* * * Global variables for Power PWM (PID) Regler for StromLog * for configuration of user-data * Version 0.09 * 11.04.2024 P. Rebesky * author Creator P.Rebesky * Copyright (©): 2024-2028 by Peter Rebesky * This code can use in private cases only. Every business or companies using of this codes or codes parts is required an approval of us (me) * Every private use can exchange some parts of code or modify some code-lines. This code can change for private use only. * This software is basicly owned by Peter Rebesky and any comercial using is forbidden without approval of us (me). * */ #ifndef GLOBAL_H_ #define GLOBAL_H_ //#define DEBUG_PAYLOAD //#define DEBUG_VALUE //#define DEBUG_CONNECT //#define PC_EMULATOR //#define SERIAL_ON //#define CHECK_CONSUMPTION //#define ScanCurve #define OTA_on //#define PMW_1_X1 #define PMW_2_X2 //#define PMW_4_X4 //***** set Board Type off relais for input / output ******// #ifdef PMW_1_X1 #define BoardTaster 4 #define blueLED 2 #define LEDboard 16 #define CirculationPump 15 #define SecureRELAIS 5 #define PWM_OUT 14 #define _oneWireBus 12 #define ESPTYP "ESP2PWM_X1" // for 1 relais platine ESP12F 4MB memory #endif #ifdef PMW_2_X2 #define BoardTaster 1 #define blueLED 16 #define LEDboard 2 #define CirculationPump 4 #define SecureRELAIS 5 #define PWM_OUT 13 #define _oneWireBus 14 #define ESPTYP "ESP2PWM_X2" // for 2 relais platine ESP12F 4MB memory #endif #ifdef PMW_4_X4 #define BoardTaster 2 #define blueLED 5 #define LEDboard 2 #define CirculationPump 13 #define SecureRELAIS 12 #define PWM_OUT 15 #define _oneWireBus 4 #define RELAIS1 16 #define RELAIS2 14 // #define ESPTYP "ESP2PWM_X4" // for 4 relais platine ESP12F 4MB memory #define ESPTYP "ESP" // for 4 relais platine ESP12F 4MB memory #endif //*** end **** #define OFF 0 #define ON 1 #define LEDOFF 1 #define LEDON 0 #define FLASHTIME 300 #define MESZ 0 // summer-time = 1 else winter-time = 0 #define TimeOf2021 1640998800 #define bufferLength 300 #define YEAR 0 #define MONTH 1 #define DAY 2 #define HOUR 3 #define MINUTE 4 #define SECOND 5 #define WAIT_TIME_PUMP 600 #define HISTORY_RELAIS_OFFSET 50 const long _utcOffsetInSeconds = 3600; int _year = 0; int _month = 0; int _day = 0; int _hour = 0; int _minute =0; int _second =0; int _date_time[6]; //[YEAR][MONTH][DAY][HOUR][MINUTE][SECOND] uint32_t _timestamp = 0; int _controlValue =0; unsigned int _waitTimeOffCount =0; unsigned int _mqttWaitTime2Connect=120; unsigned int _mqttBrokerOK=0; int _mqttInterval=0; uint32_t _previousMillis = 0; uint32_t _secondMillis =0; int _errorCount=0; int _flashCounter = 0; int _switchRelais=0; bool _receivedOK = false; String _TransmitResult; String _SendResult; int _valueMem =0; int _errorWait =0; // int _tempErrors=0; int _tempRequestError=0; int _actualConsumption=0; float _sumConsumption=0; int _actualDebugValue; int _httpMarker=0; bool _exchangeTemp=false; float _temperature0=-127; float _temperature1=-127; int _temp0Max=0; int _temp0Min=100000; int _temp1Max=0; int _temp1Min=100000; #ifdef ScanCurve String Version = "PWM_PI_0.12_Scan"; #else String Version = "PWM_PI_0.12"; #endif String PWRVersion = "Build "+Version+" 10.05.2024"; const byte DaysPerMonth[] = {31,28,31,30,31,30,31,31,30,31,30,31}; const char HTTP_ANSWER[] = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"; //header of http without mixed content const char HTTP_ANSWERJSON[] = "HTTP/1.1 200 OK\r\nContent-Type: text/json\r\nAccess-Control-Allow-Origin: *\r\n\r\n"; //header of http with mixed content, only for JSON const char HTTP_HEAD_PWR[] = "\r\n\r\n"; const char HTTP_BODYSTYLE_PWR[] PROGMEM = ""; const char HTTP_SETUP_BUTTON[] = "

"; const char HTTP_DIAGRAM_BUTTON[] = "

"; const char HTTP_DIV_FIELD[] = "
"; const char HTTP_TEXT_END[] ="
\n"; const char HTTP_JS_SETUP[] PROGMEM =""; const char HTTP_JS_SCRIPT[] PROGMEM =""; #endif // GLOBAL_H_