21 Commits

Author SHA1 Message Date
Yurii
131ad2fdfd refactor: after merge 2025-12-09 19:26:08 +03:00
Yurii
28099f2d07 Merge branch 'master' into new-equitherm 2025-12-09 19:19:30 +03:00
Yurii
ec50d5ecbb flx: typo 2025-11-03 01:09:13 +03:00
Yurii
32e0a06c19 Merge branch 'master' into new-equitherm 2025-11-03 00:04:57 +03:00
Yurii
ff89c6d478 chore: added additional description of the `T` parameter for Equitherm 2025-09-19 20:07:31 +03:00
Yurii
d867c355ed style: HTML code formatting 2025-09-19 19:25:24 +03:00
Yurii
e751c3aba0 fix: decimation for Equitherm chart fixed; chartjs updated 2025-09-19 02:09:12 +03:00
Yurii
30b55f1946 Merge branch 'master' into new-equitherm 2025-09-19 00:45:07 +03:00
Yurii
5544f43162 Merge branch 'master' into new-equitherm 2025-06-30 02:42:33 +03:00
Yurii
06c2ddcf96 Merge branch 'master' into new-equitherm 2025-05-21 01:20:55 +03:00
Yurii
0bb05006f4 Merge branch 'master' into new-equitherm 2025-05-19 23:45:13 +03:00
Yurii
5046bc0e8f Merge branch 'master' into new-equitherm 2025-05-19 22:49:09 +03:00
P43YM
0d3adad446 refactor: added notes for equitherm parameters 2025-03-18 09:38:09 +03:00
Yurii
587678f184 Merge branch 'master' into new-equitherm 2025-03-06 04:52:12 +03:00
Yurii
72235286c0 chore: resolve conflicts 2025-03-06 04:50:02 +03:00
Yurii
ee868b22ce chore: remove unused files 2025-03-04 21:31:44 +03:00
Yurii
8046a7e13f refactor: cosmetic changes 2025-03-03 04:03:08 +03:00
Yurii
0ec1fc5f24 chore: fix typo 2025-03-03 02:26:09 +03:00
Yurii
061136b13e refactor: cosmetic changes (equitherm chart) 2025-03-03 02:05:33 +03:00
Yurii
3e61dabeab refactor: refactoring after #144 2025-03-02 22:44:53 +03:00
P43YM
e5f4281d4c feat: new equitherm algorithm and chart for it (#144) 2025-02-28 23:21:55 +03:00
34 changed files with 1419 additions and 1555 deletions

2
.gitignore vendored
View File

@@ -1,5 +1,4 @@
.pio .pio
.dummy
.vscode .vscode
.PVS-Studio .PVS-Studio
build/* build/*
@@ -11,4 +10,5 @@ package-lock.json
*.lock *.lock
sdkconfig.* sdkconfig.*
CMakeLists.txt CMakeLists.txt
!sdkconfig.defaults
!.gitkeep !.gitkeep

View File

@@ -1,5 +1,5 @@
# Blueprint for reporting indoor/outdoor temperature to OpenTherm Gateway from any home assistant sensor # Blueprint for reporting indoor/outdoor temperature to OpenTherm Gateway from any home assistant sensor
# Updated: 26.01.2026 # Updated: 03.09.2024
blueprint: blueprint:
name: Report temp to OpenTherm Gateway name: Report temp to OpenTherm Gateway
@@ -15,6 +15,7 @@ blueprint:
multiple: false multiple: false
filter: filter:
- domain: sensor - domain: sensor
device_class: temperature
target_entity: target_entity:
name: Target entity name: Target entity
description: "Usually ``number.opentherm_indoor_temp`` or ``number.opentherm_outdoor_temp``" description: "Usually ``number.opentherm_indoor_temp`` or ``number.opentherm_outdoor_temp``"
@@ -37,12 +38,8 @@ condition:
value_template: "{{ states(source_entity) != 'unavailable' and states(target_entity) != 'unavailable' }}" value_template: "{{ states(source_entity) != 'unavailable' and states(target_entity) != 'unavailable' }}"
action: action:
- if: - if:
- condition: or - condition: template
conditions: value_template: "{{ (states(source_entity)|float(0) - states(target_entity)|float(0)) | abs | round(2) >= 0.01 }}"
- condition: template
value_template: "{{ (states(source_entity)|float(0) - states(target_entity)|float(0)) | abs | round(2) >= 0.01 }}"
- condition: template
value_template: "{{ (as_timestamp(now()) - as_timestamp(states[target_entity].last_updated)) | int(0) > 300 }}"
then: then:
- service: number.set_value - service: number.set_value
data: data:

View File

@@ -1,5 +1,5 @@
# Blueprint for reporting temperature to OpenTherm Gateway from home assistant weather integration # Blueprint for reporting temperature to OpenTherm Gateway from home assistant weather integration
# Updated: 26.01.2026 # Updated: 03.09.2024
blueprint: blueprint:
name: Report temp to OpenTherm Gateway from Weather name: Report temp to OpenTherm Gateway from Weather
@@ -37,12 +37,8 @@ condition:
value_template: "{{ states(source_entity) != 'unavailable' and states(target_entity) != 'unavailable' }}" value_template: "{{ states(source_entity) != 'unavailable' and states(target_entity) != 'unavailable' }}"
action: action:
- if: - if:
- condition: or - condition: template
conditions: value_template: "{{ (state_attr(source_entity, 'temperature')|float(0) - states(target_entity)|float(0)) | abs | round(2) >= 0.1 }}"
- condition: template
value_template: "{{ (state_attr(source_entity, 'temperature')|float(0) - states(target_entity)|float(0)) | abs | round(2) >= 0.1 }}"
- condition: template
value_template: "{{ (as_timestamp(now()) - as_timestamp(states[target_entity].last_updated)) | int(0) > 300 }}"
then: then:
- service: number.set_value - service: number.set_value
data: data:

View File

@@ -70,89 +70,50 @@ public:
} }
} }
inline auto sendBoilerReset() { bool sendBoilerReset() {
return this->sendRequestCode(1); unsigned int data = 1;
} data <<= 8;
inline auto sendServiceReset() {
return this->sendRequestCode(10);
}
inline auto sendWaterFilling() {
return this->sendRequestCode(2);
}
bool sendRequestCode(const uint8_t requestCode) {
unsigned long response = this->sendRequest(buildRequest( unsigned long response = this->sendRequest(buildRequest(
OpenThermMessageType::WRITE_DATA, OpenThermMessageType::WRITE_DATA,
OpenThermMessageID::RemoteRequest, OpenThermMessageID::RemoteRequest,
static_cast<unsigned int>(requestCode) << 8 data
)); ));
if (!isValidResponse(response) || !isValidResponseId(response, OpenThermMessageID::RemoteRequest)) { return isValidResponse(response) && isValidResponseId(response, OpenThermMessageID::RemoteRequest);
return false;
}
const uint8_t responseRequestCode = (response & 0xFFFF) >> 8;
const uint8_t responseCode = response & 0xFF;
if (responseRequestCode != requestCode || responseCode < 128) {
return false;
}
// reset
this->sendRequest(buildRequest(
OpenThermMessageType::WRITE_DATA,
OpenThermMessageID::RemoteRequest,
0u << 8
));
return true;
} }
bool getStr(OpenThermMessageID id, char* buffer, uint16_t length = 50) { bool sendServiceReset() {
if (buffer == nullptr || length == 0) { unsigned int data = 10;
return false; data <<= 8;
} unsigned long response = this->sendRequest(buildRequest(
OpenThermMessageType::WRITE_DATA,
OpenThermMessageID::RemoteRequest,
data
));
unsigned long response; return isValidResponse(response) && isValidResponseId(response, OpenThermMessageID::RemoteRequest);
uint8_t index = 0; }
uint8_t maxIndex = 255;
while (index <= maxIndex && index < length) { bool sendWaterFilling() {
response = this->sendRequest(buildRequest( unsigned int data = 2;
OpenThermMessageType::READ_DATA, data <<= 8;
id, unsigned long response = this->sendRequest(buildRequest(
static_cast<unsigned int>(index) << 8 OpenThermMessageType::WRITE_DATA,
)); OpenThermMessageID::RemoteRequest,
data
));
if (!isValidResponse(response) || !isValidResponseId(response, id)) { return isValidResponse(response) && isValidResponseId(response, OpenThermMessageID::RemoteRequest);
break;
}
const uint8_t character = response & 0xFF;
if (character == 0) {
break;
}
if (index == 0) {
maxIndex = (response & 0xFFFF) >> 8;
}
buffer[index++] = static_cast<char>(character);
}
buffer[index] = '\0';
return index > 0;
} }
static bool isCh2Active(unsigned long response) { static bool isCh2Active(unsigned long response) {
return response & 0x20; return response & 0x20;
} }
static bool isValidResponseId(unsigned long response, OpenThermMessageID id) { static bool isValidResponseId(unsigned long response, OpenThermMessageID id) {
const uint8_t responseId = (response >> 16) & 0xFF; uint8_t responseId = (response >> 16) & 0xFF;
return static_cast<uint8_t>(id) == responseId; return (uint8_t)id == responseId;
} }
static uint8_t getResponseMessageTypeId(unsigned long response) { static uint8_t getResponseMessageTypeId(unsigned long response) {
@@ -163,10 +124,10 @@ public:
uint8_t msgType = getResponseMessageTypeId(response); uint8_t msgType = getResponseMessageTypeId(response);
switch (msgType) { switch (msgType) {
case static_cast<uint8_t>(OpenThermMessageType::READ_ACK): case (uint8_t) OpenThermMessageType::READ_ACK:
case static_cast<uint8_t>(OpenThermMessageType::WRITE_ACK): case (uint8_t) OpenThermMessageType::WRITE_ACK:
case static_cast<uint8_t>(OpenThermMessageType::DATA_INVALID): case (uint8_t) OpenThermMessageType::DATA_INVALID:
case static_cast<uint8_t>(OpenThermMessageType::UNKNOWN_DATA_ID): case (uint8_t) OpenThermMessageType::UNKNOWN_DATA_ID:
return CustomOpenTherm::messageTypeToString( return CustomOpenTherm::messageTypeToString(
static_cast<OpenThermMessageType>(msgType) static_cast<OpenThermMessageType>(msgType)
); );

View File

@@ -1,6 +1,6 @@
#include <Arduino.h> #include <Arduino.h>
class UpgradeHandler : public AsyncWebHandler { class UpgradeHandler : public RequestHandler {
public: public:
enum class UpgradeType { enum class UpgradeType {
FIRMWARE = 0, FIRMWARE = 0,
@@ -12,7 +12,7 @@ public:
NO_FILE, NO_FILE,
SUCCESS, SUCCESS,
PROHIBITED, PROHIBITED,
SIZE_MISMATCH, ABORTED,
ERROR_ON_START, ERROR_ON_START,
ERROR_ON_WRITE, ERROR_ON_WRITE,
ERROR_ON_FINISH ERROR_ON_FINISH
@@ -22,21 +22,27 @@ public:
UpgradeType type; UpgradeType type;
UpgradeStatus status; UpgradeStatus status;
String error; String error;
size_t progress = 0;
size_t size = 0;
} UpgradeResult; } UpgradeResult;
typedef std::function<bool(AsyncWebServerRequest *request, UpgradeType)> BeforeUpgradeCallback; typedef std::function<bool(HTTPMethod, const String&)> CanHandleCallback;
typedef std::function<void(AsyncWebServerRequest *request, const UpgradeResult&, const UpgradeResult&)> AfterUpgradeCallback; typedef std::function<bool(const String&)> CanUploadCallback;
typedef std::function<bool(UpgradeType)> BeforeUpgradeCallback;
typedef std::function<void(const UpgradeResult&, const UpgradeResult&)> AfterUpgradeCallback;
UpgradeHandler(AsyncURIMatcher uri) : uri(uri) {} UpgradeHandler(const char* uri) {
this->uri = uri;
}
bool canHandle(AsyncWebServerRequest *request) const override final { UpgradeHandler* setCanHandleCallback(CanHandleCallback callback = nullptr) {
if (!request->isHTTP()) { this->canHandleCallback = callback;
return false;
}
return this->uri.matches(request); return this;
}
UpgradeHandler* setCanUploadCallback(CanUploadCallback callback = nullptr) {
this->canUploadCallback = callback;
return this;
} }
UpgradeHandler* setBeforeUpgradeCallback(BeforeUpgradeCallback callback = nullptr) { UpgradeHandler* setBeforeUpgradeCallback(BeforeUpgradeCallback callback = nullptr) {
@@ -51,9 +57,29 @@ public:
return this; return this;
} }
void handleRequest(AsyncWebServerRequest *request) override final { #if defined(ARDUINO_ARCH_ESP32)
bool canHandle(WebServer &server, HTTPMethod method, const String &uri) override {
return this->canHandle(method, uri);
}
#endif
bool canHandle(HTTPMethod method, const String& uri) override {
return method == HTTP_POST && uri.equals(this->uri) && (!this->canHandleCallback || this->canHandleCallback(method, uri));
}
#if defined(ARDUINO_ARCH_ESP32)
bool canUpload(WebServer &server, const String &uri) override {
return this->canUpload(uri);
}
#endif
bool canUpload(const String& uri) override {
return uri.equals(this->uri) && (!this->canUploadCallback || this->canUploadCallback(uri));
}
bool handle(WebServer& server, HTTPMethod method, const String& uri) override {
if (this->afterUpgradeCallback) { if (this->afterUpgradeCallback) {
this->afterUpgradeCallback(request, this->firmwareResult, this->filesystemResult); this->afterUpgradeCallback(this->firmwareResult, this->filesystemResult);
} }
this->firmwareResult.status = UpgradeStatus::NONE; this->firmwareResult.status = UpgradeStatus::NONE;
@@ -61,147 +87,129 @@ public:
this->filesystemResult.status = UpgradeStatus::NONE; this->filesystemResult.status = UpgradeStatus::NONE;
this->filesystemResult.error.clear(); this->filesystemResult.error.clear();
return true;
} }
void handleUpload(AsyncWebServerRequest *request, const String &fileName, size_t index, uint8_t *data, size_t dataLength, bool isFinal) override final { void upload(WebServer& server, const String& uri, HTTPUpload& upload) override {
UpgradeResult* result = nullptr; UpgradeResult* result;
if (upload.name.equals(F("firmware"))) {
if (!request->hasParam(asyncsrv::T_name, true, true)) {
// Missing content-disposition 'name' parameter
return;
}
const auto& pName = request->getParam(asyncsrv::T_name, true, true)->value();
if (pName.equals("fw")) {
result = &this->firmwareResult; result = &this->firmwareResult;
if (!index) { } else if (upload.name.equals(F("filesystem"))) {
result->progress = 0;
result->size = request->hasParam("fw_size", true)
? request->getParam("fw_size", true)->value().toInt()
: 0;
}
} else if (pName.equals("fs")) {
result = &this->filesystemResult; result = &this->filesystemResult;
if (!index) {
result->progress = 0;
result->size = request->hasParam("fs_size", true)
? request->getParam("fs_size", true)->value().toInt()
: 0;
}
} else { } else {
// Unknown parameter name
return; return;
} }
// check result status
if (result->status != UpgradeStatus::NONE) { if (result->status != UpgradeStatus::NONE) {
return; return;
} }
if (this->beforeUpgradeCallback && !this->beforeUpgradeCallback(request, result->type)) { if (this->beforeUpgradeCallback && !this->beforeUpgradeCallback(result->type)) {
result->status = UpgradeStatus::PROHIBITED; result->status = UpgradeStatus::PROHIBITED;
return; return;
} }
if (!fileName.length()) { if (!upload.filename.length()) {
result->status = UpgradeStatus::NO_FILE; result->status = UpgradeStatus::NO_FILE;
return; return;
} }
if (!index) { if (upload.status == UPLOAD_FILE_START) {
// reset // reset
if (Update.isRunning()) { if (Update.isRunning()) {
Update.end(false); Update.end(false);
Update.clearError(); Update.clearError();
} }
// try begin
bool begin = false; bool begin = false;
#ifdef ARDUINO_ARCH_ESP8266
Update.runAsync(true);
if (result->type == UpgradeType::FIRMWARE) {
begin = Update.begin((ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000, U_FLASH);
} else if (result->type == UpgradeType::FILESYSTEM) {
close_all_fs();
begin = Update.begin((size_t)FS_end - (size_t)FS_start, U_FS);
}
#elif defined(ARDUINO_ARCH_ESP32)
if (result->type == UpgradeType::FIRMWARE) { if (result->type == UpgradeType::FIRMWARE) {
begin = Update.begin(UPDATE_SIZE_UNKNOWN, U_FLASH); begin = Update.begin(UPDATE_SIZE_UNKNOWN, U_FLASH);
} else if (result->type == UpgradeType::FILESYSTEM) { } else if (result->type == UpgradeType::FILESYSTEM) {
begin = Update.begin(UPDATE_SIZE_UNKNOWN, U_SPIFFS); begin = Update.begin(UPDATE_SIZE_UNKNOWN, U_SPIFFS);
} }
#endif
if (!begin || Update.hasError()) { if (!begin || Update.hasError()) {
result->status = UpgradeStatus::ERROR_ON_START; result->status = UpgradeStatus::ERROR_ON_START;
#ifdef ARDUINO_ARCH_ESP8266
result->error = Update.getErrorString();
#else
result->error = Update.errorString(); result->error = Update.errorString();
#endif
Log.serrorln(FPSTR(L_PORTAL_OTA), "File '%s', on start: %s", fileName.c_str(), result->error.c_str()); Log.serrorln(FPSTR(L_PORTAL_OTA), F("File '%s', on start: %s"), upload.filename.c_str(), result->error.c_str());
return; return;
} }
Log.sinfoln(FPSTR(L_PORTAL_OTA), "File '%s', started", fileName.c_str()); Log.sinfoln(FPSTR(L_PORTAL_OTA), F("File '%s', started"), upload.filename.c_str());
}
if (dataLength) { } else if (upload.status == UPLOAD_FILE_WRITE) {
if (Update.write(data, dataLength) != dataLength) { if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) {
Update.end(false); Update.end(false);
result->status = UpgradeStatus::ERROR_ON_WRITE; result->status = UpgradeStatus::ERROR_ON_WRITE;
#ifdef ARDUINO_ARCH_ESP8266
result->error = Update.getErrorString();
#else
result->error = Update.errorString(); result->error = Update.errorString();
#endif
Log.serrorln( Log.serrorln(
FPSTR(L_PORTAL_OTA), "File '%s', on write %d bytes, %d of %d bytes", FPSTR(L_PORTAL_OTA),
fileName.c_str(), F("File '%s', on writing %d bytes: %s"),
dataLength, upload.filename.c_str(), upload.totalSize, result->error.c_str()
result->progress + dataLength,
result->size
); );
return;
} else {
Log.sinfoln(FPSTR(L_PORTAL_OTA), F("File '%s', writed %d bytes"), upload.filename.c_str(), upload.totalSize);
} }
result->progress += dataLength; } else if (upload.status == UPLOAD_FILE_END) {
Log.sinfoln( if (Update.end(true)) {
FPSTR(L_PORTAL_OTA), "File '%s', write %d bytes, %d of %d bytes", result->status = UpgradeStatus::SUCCESS;
fileName.c_str(),
dataLength,
result->progress,
result->size
);
}
if (result->size > 0) { Log.sinfoln(FPSTR(L_PORTAL_OTA), F("File '%s': finish"), upload.filename.c_str());
if (result->progress > result->size || (isFinal && result->progress < result->size)) {
Update.end(false);
result->status = UpgradeStatus::SIZE_MISMATCH;
Log.serrorln( } else {
FPSTR(L_PORTAL_OTA), "File '%s', size mismatch: %d of %d bytes",
fileName.c_str(),
result->progress,
result->size
);
return;
}
}
if (isFinal) {
if (!Update.end(true)) {
result->status = UpgradeStatus::ERROR_ON_FINISH; result->status = UpgradeStatus::ERROR_ON_FINISH;
#ifdef ARDUINO_ARCH_ESP8266
result->error = Update.getErrorString();
#else
result->error = Update.errorString(); result->error = Update.errorString();
#endif
Log.serrorln(FPSTR(L_PORTAL_OTA), "File '%s', on finish: %s", fileName.c_str(), result->error); Log.serrorln(FPSTR(L_PORTAL_OTA), F("File '%s', on finish: %s"), upload.filename.c_str(), result->error);
return;
} }
result->status = UpgradeStatus::SUCCESS; } else if (upload.status == UPLOAD_FILE_ABORTED) {
Log.sinfoln(FPSTR(L_PORTAL_OTA), "File '%s': finish", fileName.c_str()); Update.end(false);
} result->status = UpgradeStatus::ABORTED;
}
bool isRequestHandlerTrivial() const override final { Log.serrorln(FPSTR(L_PORTAL_OTA), F("File '%s': aborted"), upload.filename.c_str());
return false; }
} }
protected: protected:
CanHandleCallback canHandleCallback;
CanUploadCallback canUploadCallback;
BeforeUpgradeCallback beforeUpgradeCallback; BeforeUpgradeCallback beforeUpgradeCallback;
AfterUpgradeCallback afterUpgradeCallback; AfterUpgradeCallback afterUpgradeCallback;
AsyncURIMatcher uri; const char* uri = nullptr;
UpgradeResult firmwareResult{UpgradeType::FIRMWARE, UpgradeStatus::NONE}; UpgradeResult firmwareResult{UpgradeType::FIRMWARE, UpgradeStatus::NONE};
UpgradeResult filesystemResult{UpgradeType::FILESYSTEM, UpgradeStatus::NONE}; UpgradeResult filesystemResult{UpgradeType::FILESYSTEM, UpgradeStatus::NONE};

View File

@@ -1,228 +1,379 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio] [platformio]
;extra_configs = secrets.ini ;extra_configs = secrets.ini
extra_configs = secrets.default.ini extra_configs = secrets.default.ini
core_dir = .pio core_dir = .pio
[env] [env]
version = 1.6.0-async version = 1.5.6
framework = arduino framework = arduino
lib_deps = ESP32Async/AsyncTCP@^3.4.10 lib_deps =
ESP32Async/ESPAsyncWebServer@^3.9.4 bblanchon/ArduinoJson@^7.4.2
mathieucarbou/MycilaWebSerial@^8.2.0 ;ihormelnyk/OpenTherm Library@^1.1.5
bblanchon/ArduinoJson@^7.4.2 https://github.com/Laxilef/opentherm_library#esp32_timer
;ihormelnyk/OpenTherm Library@^1.1.5 arduino-libraries/ArduinoMqttClient@^0.1.8
https://github.com/Laxilef/opentherm_library#esp32_timer lennarthennigs/ESP Telnet@^2.2.3
arduino-libraries/ArduinoMqttClient@^0.1.8 gyverlibs/FileData@^1.0.3
gyverlibs/FileData@^1.0.3 gyverlibs/GyverPID@^3.3.2
gyverlibs/GyverPID@^3.3.2 gyverlibs/GyverBlinker@^1.1.1
gyverlibs/GyverBlinker@^1.1.1 https://github.com/pstolarz/Arduino-Temperature-Control-Library.git#OneWireNg
pstolarz/OneWireNg@^0.14.1 laxilef/TinyLogger@^1.1.1
milesburton/DallasTemperature@^4.0.6 build_type = ${secrets.build_type}
https://github.com/Laxilef/esp32DHT#idf5 build_flags =
;laxilef/TinyLogger@^1.1.1 -mtext-section-literals
https://github.com/Laxilef/TinyLogger#custom_handlers -D MQTT_CLIENT_STD_FUNCTION_CALLBACK=1
lib_ignore = OneWire ;-D DEBUG_ESP_CORE -D DEBUG_ESP_WIFI -D DEBUG_ESP_HTTP_SERVER -D DEBUG_ESP_PORT=Serial
build_type = ${secrets.build_type} -D BUILD_VERSION='"${this.version}"'
build_flags = ;-mtext-section-literals -D BUILD_ENV='"$PIOENV"'
-O2 -D DEFAULT_SERIAL_ENABLED=${secrets.serial_enabled}
-Wno-deprecated-declarations -D DEFAULT_SERIAL_BAUD=${secrets.serial_baud}
-D MQTT_CLIENT_STD_FUNCTION_CALLBACK=1 -D DEFAULT_TELNET_ENABLED=${secrets.telnet_enabled}
;-D DEBUG_ESP_CORE -D DEBUG_ESP_WIFI -D DEBUG_ESP_HTTP_SERVER -D DEBUG_ESP_PORT=Serial -D DEFAULT_TELNET_PORT=${secrets.telnet_port}
-D BUILD_VERSION='"${this.version}"' -D DEFAULT_LOG_LEVEL=${secrets.log_level}
-D BUILD_ENV='"$PIOENV"' -D DEFAULT_HOSTNAME='"${secrets.hostname}"'
-D CONFIG_ASYNC_TCP_STACK_SIZE=4096 -D DEFAULT_AP_SSID='"${secrets.ap_ssid}"'
-D ARDUINOJSON_USE_DOUBLE=0 -D DEFAULT_AP_PASSWORD='"${secrets.ap_password}"'
-D ARDUINOJSON_USE_LONG_LONG=0 -D DEFAULT_STA_SSID='"${secrets.sta_ssid}"'
-D TINYLOGGER_GLOBAL -D DEFAULT_STA_PASSWORD='"${secrets.sta_password}"'
-D DHT_TASK_STACK_SIZE=4096 -D DEFAULT_PORTAL_LOGIN='"${secrets.portal_login}"'
-D DEFAULT_SERIAL_ENABLED=${secrets.serial_enabled} -D DEFAULT_PORTAL_PASSWORD='"${secrets.portal_password}"'
-D DEFAULT_SERIAL_BAUD=${secrets.serial_baud} -D DEFAULT_MQTT_ENABLED=${secrets.mqtt_enabled}
-D DEFAULT_WEBSERIAL_ENABLED=${secrets.webserial_enabled} -D DEFAULT_MQTT_SERVER='"${secrets.mqtt_server}"'
-D DEFAULT_LOG_LEVEL=${secrets.log_level} -D DEFAULT_MQTT_PORT=${secrets.mqtt_port}
-D DEFAULT_HOSTNAME='"${secrets.hostname}"' -D DEFAULT_MQTT_USER='"${secrets.mqtt_user}"'
-D DEFAULT_AP_SSID='"${secrets.ap_ssid}"' -D DEFAULT_MQTT_PASSWORD='"${secrets.mqtt_password}"'
-D DEFAULT_AP_PASSWORD='"${secrets.ap_password}"' -D DEFAULT_MQTT_PREFIX='"${secrets.mqtt_prefix}"'
-D DEFAULT_STA_SSID='"${secrets.sta_ssid}"' upload_speed = 921600
-D DEFAULT_STA_PASSWORD='"${secrets.sta_password}"' monitor_speed = 115200
-D DEFAULT_PORTAL_LOGIN='"${secrets.portal_login}"' ;monitor_filters = direct
-D DEFAULT_PORTAL_PASSWORD='"${secrets.portal_password}"' monitor_filters =
-D DEFAULT_MQTT_ENABLED=${secrets.mqtt_enabled} esp32_exception_decoder
-D DEFAULT_MQTT_SERVER='"${secrets.mqtt_server}"' esp8266_exception_decoder
-D DEFAULT_MQTT_PORT=${secrets.mqtt_port} board_build.flash_mode = dio
-D DEFAULT_MQTT_USER='"${secrets.mqtt_user}"' board_build.filesystem = littlefs
-D DEFAULT_MQTT_PASSWORD='"${secrets.mqtt_password}"' check_tool = ; pvs-studio
-D DEFAULT_MQTT_PREFIX='"${secrets.mqtt_prefix}"' check_flags =
upload_speed = 921600 ; pvs-studio:
monitor_speed = 115200 ; --analysis-mode=4
;monitor_filters = direct ; --exclude-path=./.pio/libdeps
monitor_filters = esp32_exception_decoder
board_build.flash_mode = dio
board_build.filesystem = littlefs
check_tool = ;pvs-studio
check_flags = ;pvs-studio: --analysis-mode=4 --exclude-path=./.pio/libdeps
; Defaults ; Defaults
[esp8266_defaults]
platform = espressif8266@^4.2.1
platform_packages = ${env.platform_packages}
lib_deps =
${env.lib_deps}
nrwiersma/ESP8266Scheduler@^1.2
lib_ignore =
extra_scripts =
post:tools/build.py
build_type = ${env.build_type}
build_flags =
${env.build_flags}
-D PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
;-D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH
-D PIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK305
board_build.ldscript = eagle.flash.4m1m.ld
check_tool = ${env.check_tool}
check_flags = ${env.check_flags}
[esp32_defaults] [esp32_defaults]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.37/platform-espressif32.zip ;platform = espressif32@^6.7
platform_packages = ${env.platform_packages} ;platform = https://github.com/platformio/platform-espressif32.git
board_build.partitions = esp32_partitions.csv ;platform_packages =
lib_deps = ${env.lib_deps} ; framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.5
laxilef/ESP32Scheduler@^1.0.1 ; framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip
nimble_lib = https://github.com/h2zero/NimBLE-Arduino platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.34/platform-espressif32.zip
lib_ignore = ${env.lib_ignore} platform_packages = ${env.platform_packages}
BluetoothSerial board_build.partitions = esp32_partitions.csv
SimpleBLE lib_deps =
ESP RainMaker ${env.lib_deps}
RainMaker laxilef/ESP32Scheduler@^1.0.1
ESP Insights nimble_lib = h2zero/NimBLE-Arduino@2.3.3
Insights lib_ignore =
Zigbee extra_scripts =
Matter post:tools/esp32.py
OpenThread post:tools/build.py
dsp build_type = ${env.build_type}
custom_component_remove = espressif/esp_hosted build_flags =
espressif/esp_wifi_remote ${env.build_flags}
espressif/esp-dsp -D CORE_DEBUG_LEVEL=0
espressif/esp_modem -Wl,--wrap=esp_panic_handler
espressif/esp_rainmaker check_tool = ${env.check_tool}
espressif/rmaker_common check_flags = ${env.check_flags}
espressif/esp_insights
espressif/esp_diag_data_store
espressif/esp_diagnostics
espressif/libsodium
espressif/esp-modbus
espressif/esp-cbor
espressif/esp-sr
espressif/esp32-camera
espressif/qrcode
espressif/esp-zboss-lib
espressif/esp-zigbee-lib
chmorgan/esp-libhelix-mp3
extra_scripts = pre:tools/add_build_commit.py
post:tools/esp32.py
post:tools/build.py
build_type = ${env.build_type}
build_flags = ${env.build_flags}
-D CORE_DEBUG_LEVEL=0
-Wl,--wrap=esp_panic_handler
check_tool = ${env.check_tool}
check_flags = ${env.check_flags}
; Boards ; Boards
[env:d1_mini]
platform = ${esp8266_defaults.platform}
platform_packages = ${esp8266_defaults.platform_packages}
board = d1_mini
lib_deps = ${esp8266_defaults.lib_deps}
lib_ignore = ${esp8266_defaults.lib_ignore}
extra_scripts = ${esp8266_defaults.extra_scripts}
board_build.ldscript = ${esp8266_defaults.board_build.ldscript}
build_type = ${esp8266_defaults.build_type}
build_flags =
${esp8266_defaults.build_flags}
-D DEFAULT_OT_IN_GPIO=4
-D DEFAULT_OT_OUT_GPIO=5
-D DEFAULT_SENSOR_OUTDOOR_GPIO=12
-D DEFAULT_SENSOR_INDOOR_GPIO=14
-D DEFAULT_STATUS_LED_GPIO=13
-D DEFAULT_OT_RX_LED_GPIO=15
check_tool = ${esp8266_defaults.check_tool}
check_flags = ${esp8266_defaults.check_flags}
[env:d1_mini_lite]
platform = ${esp8266_defaults.platform}
platform_packages = ${esp8266_defaults.platform_packages}
board = d1_mini_lite
lib_deps = ${esp8266_defaults.lib_deps}
lib_ignore = ${esp8266_defaults.lib_ignore}
extra_scripts = ${esp8266_defaults.extra_scripts}
board_build.ldscript = ${esp8266_defaults.board_build.ldscript}
build_type = ${esp8266_defaults.build_type}
build_flags =
${esp8266_defaults.build_flags}
-D DEFAULT_OT_IN_GPIO=4
-D DEFAULT_OT_OUT_GPIO=5
-D DEFAULT_SENSOR_OUTDOOR_GPIO=12
-D DEFAULT_SENSOR_INDOOR_GPIO=14
-D DEFAULT_STATUS_LED_GPIO=13
-D DEFAULT_OT_RX_LED_GPIO=15
check_tool = ${esp8266_defaults.check_tool}
check_flags = ${esp8266_defaults.check_flags}
[env:d1_mini_pro]
platform = ${esp8266_defaults.platform}
platform_packages = ${esp8266_defaults.platform_packages}
board = d1_mini_pro
lib_deps = ${esp8266_defaults.lib_deps}
lib_ignore = ${esp8266_defaults.lib_ignore}
extra_scripts = ${esp8266_defaults.extra_scripts}
board_build.ldscript = ${esp8266_defaults.board_build.ldscript}
build_type = ${esp8266_defaults.build_type}
build_flags =
${esp8266_defaults.build_flags}
-D DEFAULT_OT_IN_GPIO=4
-D DEFAULT_OT_OUT_GPIO=5
-D DEFAULT_SENSOR_OUTDOOR_GPIO=12
-D DEFAULT_SENSOR_INDOOR_GPIO=14
-D DEFAULT_STATUS_LED_GPIO=13
-D DEFAULT_OT_RX_LED_GPIO=15
check_tool = ${esp8266_defaults.check_tool}
check_flags = ${esp8266_defaults.check_flags}
[env:nodemcu_8266]
platform = ${esp8266_defaults.platform}
platform_packages = ${esp8266_defaults.platform_packages}
board = nodemcuv2
lib_deps = ${esp8266_defaults.lib_deps}
lib_ignore = ${esp8266_defaults.lib_ignore}
extra_scripts = ${esp8266_defaults.extra_scripts}
board_build.ldscript = ${esp8266_defaults.board_build.ldscript}
build_type = ${esp8266_defaults.build_type}
build_flags =
${esp8266_defaults.build_flags}
-D DEFAULT_OT_IN_GPIO=13
-D DEFAULT_OT_OUT_GPIO=15
-D DEFAULT_SENSOR_OUTDOOR_GPIO=12
-D DEFAULT_SENSOR_INDOOR_GPIO=4
-D DEFAULT_STATUS_LED_GPIO=2
-D DEFAULT_OT_RX_LED_GPIO=16
check_tool = ${esp8266_defaults.check_tool}
check_flags = ${esp8266_defaults.check_flags}
[env:s2_mini] [env:s2_mini]
extends = esp32_defaults platform = ${esp32_defaults.platform}
board = lolin_s2_mini platform_packages = ${esp32_defaults.platform_packages}
build_unflags = -DARDUINO_USB_MODE=1 board = lolin_s2_mini
build_flags = ${esp32_defaults.build_flags} board_build.partitions = ${esp32_defaults.board_build.partitions}
-D ARDUINO_USB_MODE=0 lib_deps = ${esp32_defaults.lib_deps}
-D ARDUINO_USB_CDC_ON_BOOT=1 lib_ignore = ${esp32_defaults.lib_ignore}
-D DEFAULT_OT_IN_GPIO=33 extra_scripts = ${esp32_defaults.extra_scripts}
-D DEFAULT_OT_OUT_GPIO=35 build_unflags =
-D DEFAULT_SENSOR_OUTDOOR_GPIO=9 -DARDUINO_USB_MODE=1
-D DEFAULT_SENSOR_INDOOR_GPIO=7 build_type = ${esp32_defaults.build_type}
-D DEFAULT_STATUS_LED_GPIO=11 build_flags =
-D DEFAULT_OT_RX_LED_GPIO=12 ${esp32_defaults.build_flags}
-D ARDUINO_USB_MODE=0
-D ARDUINO_USB_CDC_ON_BOOT=1
-D DEFAULT_OT_IN_GPIO=33
-D DEFAULT_OT_OUT_GPIO=35
-D DEFAULT_SENSOR_OUTDOOR_GPIO=9
-D DEFAULT_SENSOR_INDOOR_GPIO=7
-D DEFAULT_STATUS_LED_GPIO=11
-D DEFAULT_OT_RX_LED_GPIO=12
check_tool = ${esp32_defaults.check_tool}
check_flags = ${esp32_defaults.check_flags}
[env:s3_mini] [env:s3_mini]
extends = esp32_defaults platform = ${esp32_defaults.platform}
board = lolin_s3_mini platform_packages = ${esp32_defaults.platform_packages}
lib_deps = ${esp32_defaults.lib_deps} board = lolin_s3_mini
${esp32_defaults.nimble_lib} board_build.partitions = ${esp32_defaults.board_build.partitions}
build_unflags = -DARDUINO_USB_MODE=1 lib_deps =
build_flags = ${esp32_defaults.build_flags} ${esp32_defaults.lib_deps}
-D ARDUINO_USB_MODE=0 ${esp32_defaults.nimble_lib}
-D ARDUINO_USB_CDC_ON_BOOT=1 lib_ignore = ${esp32_defaults.lib_ignore}
-D MYNEWT_VAL_BLE_EXT_ADV=1 extra_scripts = ${esp32_defaults.extra_scripts}
-D USE_BLE=1 build_unflags =
-D DEFAULT_OT_IN_GPIO=35 -DARDUINO_USB_MODE=1
-D DEFAULT_OT_OUT_GPIO=36 build_type = ${esp32_defaults.build_type}
-D DEFAULT_SENSOR_OUTDOOR_GPIO=13 build_flags =
-D DEFAULT_SENSOR_INDOOR_GPIO=12 ${esp32_defaults.build_flags}
-D DEFAULT_STATUS_LED_GPIO=11 -D ARDUINO_USB_MODE=0
-D DEFAULT_OT_RX_LED_GPIO=10 -D ARDUINO_USB_CDC_ON_BOOT=1
-D CONFIG_BT_NIMBLE_EXT_ADV=1
-D USE_BLE=1
-D DEFAULT_OT_IN_GPIO=35
-D DEFAULT_OT_OUT_GPIO=36
-D DEFAULT_SENSOR_OUTDOOR_GPIO=13
-D DEFAULT_SENSOR_INDOOR_GPIO=12
-D DEFAULT_STATUS_LED_GPIO=11
-D DEFAULT_OT_RX_LED_GPIO=10
check_tool = ${esp32_defaults.check_tool}
check_flags = ${esp32_defaults.check_flags}
[env:c3_mini] [env:c3_mini]
extends = esp32_defaults platform = ${esp32_defaults.platform}
board = lolin_c3_mini platform_packages = ${esp32_defaults.platform_packages}
lib_deps = ${esp32_defaults.lib_deps} board = lolin_c3_mini
${esp32_defaults.nimble_lib} board_build.partitions = ${esp32_defaults.board_build.partitions}
;build_unflags = -mtext-section-literals lib_deps =
build_flags = ${esp32_defaults.build_flags} ${esp32_defaults.lib_deps}
-D MYNEWT_VAL_BLE_EXT_ADV=1 ${esp32_defaults.nimble_lib}
-D USE_BLE=1 lib_ignore = ${esp32_defaults.lib_ignore}
-D DEFAULT_OT_IN_GPIO=8 extra_scripts = ${esp32_defaults.extra_scripts}
-D DEFAULT_OT_OUT_GPIO=10 build_unflags =
-D DEFAULT_SENSOR_OUTDOOR_GPIO=0 -mtext-section-literals
-D DEFAULT_SENSOR_INDOOR_GPIO=1 build_type = ${esp32_defaults.build_type}
-D DEFAULT_STATUS_LED_GPIO=4 build_flags =
-D DEFAULT_OT_RX_LED_GPIO=5 ${esp32_defaults.build_flags}
-D CONFIG_BT_NIMBLE_EXT_ADV=1
-D USE_BLE=1
-D DEFAULT_OT_IN_GPIO=8
-D DEFAULT_OT_OUT_GPIO=10
-D DEFAULT_SENSOR_OUTDOOR_GPIO=0
-D DEFAULT_SENSOR_INDOOR_GPIO=1
-D DEFAULT_STATUS_LED_GPIO=4
-D DEFAULT_OT_RX_LED_GPIO=5
check_tool = ${esp32_defaults.check_tool}
check_flags = ${esp32_defaults.check_flags}
[env:nodemcu_32] [env:nodemcu_32]
extends = esp32_defaults platform = ${esp32_defaults.platform}
board = nodemcu-32s platform_packages = ${esp32_defaults.platform_packages}
lib_deps = ${esp32_defaults.lib_deps} board = nodemcu-32s
${esp32_defaults.nimble_lib} board_build.partitions = ${esp32_defaults.board_build.partitions}
build_flags = ${esp32_defaults.build_flags} lib_deps =
-D USE_BLE=1 ${esp32_defaults.lib_deps}
-D DEFAULT_OT_IN_GPIO=16 ${esp32_defaults.nimble_lib}
-D DEFAULT_OT_OUT_GPIO=4 lib_ignore = ${esp32_defaults.lib_ignore}
-D DEFAULT_SENSOR_OUTDOOR_GPIO=15 extra_scripts = ${esp32_defaults.extra_scripts}
-D DEFAULT_SENSOR_INDOOR_GPIO=26 build_type = ${esp32_defaults.build_type}
-D DEFAULT_STATUS_LED_GPIO=2 build_flags =
-D DEFAULT_OT_RX_LED_GPIO=19 ${esp32_defaults.build_flags}
-D USE_BLE=1
-D DEFAULT_OT_IN_GPIO=16
-D DEFAULT_OT_OUT_GPIO=4
-D DEFAULT_SENSOR_OUTDOOR_GPIO=15
-D DEFAULT_SENSOR_INDOOR_GPIO=26
-D DEFAULT_STATUS_LED_GPIO=2
-D DEFAULT_OT_RX_LED_GPIO=19
check_tool = ${esp32_defaults.check_tool}
check_flags = ${esp32_defaults.check_flags}
[env:nodemcu_32_160mhz] [env:nodemcu_32_160mhz]
extends = env:nodemcu_32 extends = env:nodemcu_32
board_build.f_cpu = 160000000L ; set frequency to 160MHz board_build.f_cpu = 160000000L ; set frequency to 160MHz
[env:d1_mini32] [env:d1_mini32]
extends = esp32_defaults platform = ${esp32_defaults.platform}
board = wemos_d1_mini32 platform_packages = ${esp32_defaults.platform_packages}
lib_deps = ${esp32_defaults.lib_deps} board = wemos_d1_mini32
${esp32_defaults.nimble_lib} board_build.partitions = ${esp32_defaults.board_build.partitions}
build_flags = ${esp32_defaults.build_flags} lib_deps =
-D USE_BLE=1 ${esp32_defaults.lib_deps}
-D DEFAULT_OT_IN_GPIO=21 ${esp32_defaults.nimble_lib}
-D DEFAULT_OT_OUT_GPIO=22 lib_ignore = ${esp32_defaults.lib_ignore}
-D DEFAULT_SENSOR_OUTDOOR_GPIO=12 extra_scripts = ${esp32_defaults.extra_scripts}
-D DEFAULT_SENSOR_INDOOR_GPIO=18 build_type = ${esp32_defaults.build_type}
-D DEFAULT_STATUS_LED_GPIO=2 build_flags =
-D DEFAULT_OT_RX_LED_GPIO=19 ${esp32_defaults.build_flags}
-D USE_BLE=1
-D DEFAULT_OT_IN_GPIO=21
-D DEFAULT_OT_OUT_GPIO=22
-D DEFAULT_SENSOR_OUTDOOR_GPIO=12
-D DEFAULT_SENSOR_INDOOR_GPIO=18
-D DEFAULT_STATUS_LED_GPIO=2
-D DEFAULT_OT_RX_LED_GPIO=19
check_tool = ${esp32_defaults.check_tool}
check_flags = ${esp32_defaults.check_flags}
[env:esp32_c6] [env:esp32_c6]
extends = esp32_defaults platform = ${esp32_defaults.platform}
board = esp32-c6-devkitc-1 framework = arduino, espidf
lib_deps = ${esp32_defaults.lib_deps} platform_packages = ${esp32_defaults.platform_packages}
${esp32_defaults.nimble_lib} board = esp32-c6-devkitm-1
;build_unflags = -mtext-section-literals board_build.partitions = ${esp32_defaults.board_build.partitions}
build_flags = ${esp32_defaults.build_flags} board_build.embed_txtfiles =
-D USE_BLE=1 managed_components/espressif__esp_insights/server_certs/https_server.crt
-D DEFAULT_OT_IN_GPIO=15 managed_components/espressif__esp_rainmaker/server_certs/rmaker_mqtt_server.crt
-D DEFAULT_OT_OUT_GPIO=23 managed_components/espressif__esp_rainmaker/server_certs/rmaker_claim_service_server.crt
-D DEFAULT_SENSOR_OUTDOOR_GPIO=0 managed_components/espressif__esp_rainmaker/server_certs/rmaker_ota_server.crt
-D DEFAULT_SENSOR_INDOOR_GPIO=0 lib_deps = ${esp32_defaults.lib_deps}
-D DEFAULT_STATUS_LED_GPIO=11 lib_ignore =
-D DEFAULT_OT_RX_LED_GPIO=10 ${esp32_defaults.lib_ignore}
custom_sdkconfig = '# CONFIG_OPENTHREAD_ENABLED is not set' extra_scripts = ${esp32_defaults.extra_scripts}
'# CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT is not set' build_unflags =
'# CONFIG_LWIP_IPV6 is not set' -mtext-section-literals
'# CONFIG_LWIP_IPV6_AUTOCONFIG is not set' build_type = ${esp32_defaults.build_type}
'# CONFIG_LWIP_PPP_SUPPORT is not set' build_flags =
${esp32_defaults.build_flags}
-D USE_BLE=1
-D DEFAULT_OT_IN_GPIO=15
-D DEFAULT_OT_OUT_GPIO=23
-D DEFAULT_SENSOR_OUTDOOR_GPIO=0
-D DEFAULT_SENSOR_INDOOR_GPIO=0
-D DEFAULT_STATUS_LED_GPIO=11
-D DEFAULT_OT_RX_LED_GPIO=10
check_tool = ${esp32_defaults.check_tool}
check_flags = ${esp32_defaults.check_flags}
[env:otthing] [env:otthing]
extends = esp32_defaults platform = ${esp32_defaults.platform}
board = lolin_c3_mini platform_packages = ${esp32_defaults.platform_packages}
lib_deps = ${esp32_defaults.lib_deps} board = lolin_c3_mini
${esp32_defaults.nimble_lib} board_build.partitions = ${esp32_defaults.board_build.partitions}
;build_unflags = -mtext-section-literals lib_deps =
build_flags = ${esp32_defaults.build_flags} ${esp32_defaults.lib_deps}
-D MYNEWT_VAL_BLE_EXT_ADV=1 ${esp32_defaults.nimble_lib}
-D USE_BLE=1 lib_ignore = ${esp32_defaults.lib_ignore}
-D DEFAULT_OT_IN_GPIO=3 extra_scripts = ${esp32_defaults.extra_scripts}
-D DEFAULT_OT_OUT_GPIO=1 build_unflags =
;-D DEFAULT_SENSOR_OUTDOOR_GPIO=0 -mtext-section-literals
;-D DEFAULT_SENSOR_INDOOR_GPIO=1 build_type = ${esp32_defaults.build_type}
-D DEFAULT_STATUS_LED_GPIO=8 build_flags =
-D DEFAULT_OT_RX_LED_GPIO=2 ${esp32_defaults.build_flags}
-D OT_BYPASS_RELAY_GPIO=20 -D CONFIG_BT_NIMBLE_EXT_ADV=1
-D USE_BLE=1
-D DEFAULT_OT_IN_GPIO=3
-D DEFAULT_OT_OUT_GPIO=1
; -D DEFAULT_SENSOR_OUTDOOR_GPIO=0
; -D DEFAULT_SENSOR_INDOOR_GPIO=1
-D DEFAULT_STATUS_LED_GPIO=8
-D DEFAULT_OT_RX_LED_GPIO=2
-D OT_BYPASS_RELAY_GPIO=20
check_tool = ${esp32_defaults.check_tool}
check_flags = ${esp32_defaults.check_flags}

33
sdkconfig.defaults Normal file
View File

@@ -0,0 +1,33 @@
# Source:
# https://github.com/pioarduino/platform-espressif32/tree/main/examples/espidf-arduino-h2zero-BLE_scan
CONFIG_FREERTOS_HZ=1000
CONFIG_MBEDTLS_PSK_MODES=y
CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y
CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE=y
#
# BT config
CONFIG_BT_ENABLED=y
CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y
CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=n
CONFIG_BTDM_CTRL_MODE_BTDM=n
CONFIG_BT_BLUEDROID_ENABLED=n
CONFIG_BT_NIMBLE_ENABLED=y
#
# Arduino Configuration
CONFIG_AUTOSTART_ARDUINO=y
CONFIG_ARDUINO_SELECTIVE_COMPILATION=y
CONFIG_ARDUINO_SELECTIVE_Zigbee=n
CONFIG_ARDUINO_SELECTIVE_Matter=n
CONFIG_ARDUINO_SELECTIVE_WiFiProv=n
CONFIG_ARDUINO_SELECTIVE_BLE=n
CONFIG_ARDUINO_SELECTIVE_BluetoothSerial=n
CONFIG_ARDUINO_SELECTIVE_SimpleBLE=n
CONFIG_ARDUINO_SELECTIVE_RainMaker=n
CONFIG_ARDUINO_SELECTIVE_OpenThread=n
CONFIG_ARDUINO_SELECTIVE_Insights=n

View File

@@ -3,7 +3,8 @@ build_type = release
serial_enabled = true serial_enabled = true
serial_baud = 115200 serial_baud = 115200
webserial_enabled = true telnet_enabled = true
telnet_port = 23
log_level = 5 log_level = 5
hostname = opentherm hostname = opentherm

View File

@@ -176,10 +176,9 @@ public:
objId.c_str() objId.c_str()
); );
// set device class, name, value template for Bluetooth/DHT sensors // set device class, name, value template for bluetooth sensors
// or name & value template for another sensors // or name & value template for another sensors
if (sSensor.type == Sensors::Type::BLUETOOTH || if (sSensor.type == Sensors::Type::BLUETOOTH) {
sSensor.type == Sensors::Type::DHT11 || sSensor.type == Sensors::Type::DHT22) {
// available state topic // available state topic
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = doc[FPSTR(HA_STATE_TOPIC)]; doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = doc[FPSTR(HA_STATE_TOPIC)];
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_SENSOR_CONN, true); doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_SENSOR_CONN, true);
@@ -444,28 +443,6 @@ public:
return this->publish(this->makeConfigTopic(FPSTR(HA_ENTITY_SWITCH), F("heating_turbo")).c_str(), doc); return this->publish(this->makeConfigTopic(FPSTR(HA_ENTITY_SWITCH), F("heating_turbo")).c_str(), doc);
} }
bool publishSwitchHeatingHysteresis(bool enabledByDefault = true) {
JsonDocument doc;
doc[FPSTR(HA_AVAILABILITY)][FPSTR(HA_TOPIC)] = this->statusTopic.c_str();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("heating_hysteresis"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_SWITCH), F("heating_hysteresis"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_NAME)] = F("Use heating hysteresis");
doc[FPSTR(HA_ICON)] = F("mdi:altimeter");
doc[FPSTR(HA_STATE_TOPIC)] = this->settingsTopic.c_str();
doc[FPSTR(HA_STATE_ON)] = true;
doc[FPSTR(HA_STATE_OFF)] = false;
doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.heating.hysteresis.enabled }}");
doc[FPSTR(HA_COMMAND_TOPIC)] = this->setSettingsTopic.c_str();
doc[FPSTR(HA_PAYLOAD_ON)] = F("{\"heating\": {\"hysteresis\" : {\"enabled\" : true}}}");
doc[FPSTR(HA_PAYLOAD_OFF)] = F("{\"heating\": {\"hysteresis\" : {\"enabled\" : false}}}");
doc[FPSTR(HA_EXPIRE_AFTER)] = this->expireAfter;
doc.shrinkToFit();
return this->publish(this->makeConfigTopic(FPSTR(HA_ENTITY_SWITCH), F("heating_hysteresis")).c_str(), doc);
}
bool publishInputHeatingHysteresis(UnitSystem unit = UnitSystem::METRIC, bool enabledByDefault = true) { bool publishInputHeatingHysteresis(UnitSystem unit = UnitSystem::METRIC, bool enabledByDefault = true) {
JsonDocument doc; JsonDocument doc;
doc[FPSTR(HA_AVAILABILITY)][FPSTR(HA_TOPIC)] = this->statusTopic.c_str(); doc[FPSTR(HA_AVAILABILITY)][FPSTR(HA_TOPIC)] = this->statusTopic.c_str();
@@ -485,9 +462,9 @@ public:
doc[FPSTR(HA_NAME)] = F("Heating hysteresis"); doc[FPSTR(HA_NAME)] = F("Heating hysteresis");
doc[FPSTR(HA_ICON)] = F("mdi:altimeter"); doc[FPSTR(HA_ICON)] = F("mdi:altimeter");
doc[FPSTR(HA_STATE_TOPIC)] = this->settingsTopic.c_str(); doc[FPSTR(HA_STATE_TOPIC)] = this->settingsTopic.c_str();
doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.heating.hysteresis.value|float(0)|round(2) }}"); doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.heating.hysteresis|float(0)|round(2) }}");
doc[FPSTR(HA_COMMAND_TOPIC)] = this->setSettingsTopic.c_str(); doc[FPSTR(HA_COMMAND_TOPIC)] = this->setSettingsTopic.c_str();
doc[FPSTR(HA_COMMAND_TEMPLATE)] = F("{\"heating\": {\"hysteresis\" : {\"value\" : {{ value }}}}}"); doc[FPSTR(HA_COMMAND_TEMPLATE)] = F("{\"heating\": {\"hysteresis\" : {{ value }}}}");
doc[FPSTR(HA_MIN)] = 0; doc[FPSTR(HA_MIN)] = 0;
doc[FPSTR(HA_MAX)] = 15; doc[FPSTR(HA_MAX)] = 15;
doc[FPSTR(HA_STEP)] = 0.01f; doc[FPSTR(HA_STEP)] = 0.01f;

View File

@@ -6,6 +6,7 @@ extern NetworkMgr* network;
extern MqttTask* tMqtt; extern MqttTask* tMqtt;
extern OpenThermTask* tOt; extern OpenThermTask* tOt;
extern FileData fsNetworkSettings, fsSettings, fsSensorsSettings; extern FileData fsNetworkSettings, fsSettings, fsSensorsSettings;
extern ESPTelnetStream* telnetStream;
class MainTask : public Task { class MainTask : public Task {
@@ -39,6 +40,7 @@ protected:
PumpStartReason extPumpStartReason = PumpStartReason::NONE; PumpStartReason extPumpStartReason = PumpStartReason::NONE;
unsigned long externalPumpStartTime = 0; unsigned long externalPumpStartTime = 0;
bool ntpStarted = false; bool ntpStarted = false;
bool telnetStarted = false;
bool emergencyDetected = false; bool emergencyDetected = false;
unsigned long emergencyFlipTime = 0; unsigned long emergencyFlipTime = 0;
bool freezeDetected = false; bool freezeDetected = false;
@@ -104,9 +106,9 @@ protected:
vars.network.connected = network->isConnected(); vars.network.connected = network->isConnected();
vars.network.rssi = network->isConnected() ? WiFi.RSSI() : 0; vars.network.rssi = network->isConnected() ? WiFi.RSSI() : 0;
if (settings.system.logLevel >= TinyLoggerLevel::SILENT && settings.system.logLevel <= TinyLoggerLevel::VERBOSE) { if (settings.system.logLevel >= TinyLogger::Level::SILENT && settings.system.logLevel <= TinyLogger::Level::VERBOSE) {
if (Log.getLevel() != settings.system.logLevel) { if (Log.getLevel() != settings.system.logLevel) {
Log.setLevel(static_cast<TinyLoggerLevel>(settings.system.logLevel)); Log.setLevel(static_cast<TinyLogger::Level>(settings.system.logLevel));
} }
} }
@@ -121,6 +123,11 @@ protected:
} }
} }
if (!this->telnetStarted && telnetStream != nullptr) {
telnetStream->begin(23, false);
this->telnetStarted = true;
}
if (settings.mqtt.enabled && !tMqtt->isEnabled()) { if (settings.mqtt.enabled && !tMqtt->isEnabled()) {
tMqtt->enable(); tMqtt->enable();
@@ -128,11 +135,18 @@ protected:
tMqtt->disable(); tMqtt->disable();
} }
Sensors::setConnectionStatusByType(Sensors::Type::MANUAL, !settings.mqtt.enabled || vars.mqtt.connected, false);
} else { } else {
if (this->ntpStarted) { if (this->ntpStarted) {
this->ntpStarted = false; this->ntpStarted = false;
} }
if (this->telnetStarted) {
telnetStream->stop();
this->telnetStarted = false;
}
if (tMqtt->isEnabled()) { if (tMqtt->isEnabled()) {
tMqtt->disable(); tMqtt->disable();
} }
@@ -146,10 +160,23 @@ protected:
} }
this->ledStatus(); this->ledStatus();
// telnet
if (this->telnetStarted) {
this->yield();
telnetStream->loop();
this->yield();
}
// anti memory leak // anti memory leak
while (Serial.available() > 0) { for (Stream* stream : Log.getStreams()) {
Serial.read(); while (stream->available() > 0) {
stream->read();
#ifdef ARDUINO_ARCH_ESP8266
::optimistic_yield(1000);
#endif
}
} }
// heap info // heap info
@@ -188,7 +215,7 @@ protected:
vars.states.restarting = true; vars.states.restarting = true;
} }
if (settings.system.logLevel < TinyLoggerLevel::VERBOSE) { if (settings.system.logLevel < TinyLogger::Level::VERBOSE) {
return; return;
} }
@@ -292,7 +319,7 @@ protected:
emergencyFlags |= 0b00000010; emergencyFlags |= 0b00000010;
} }
if (settings.opentherm.options.nativeOTC) { if (settings.opentherm.options.nativeHeatingControl) {
emergencyFlags |= 0b00000100; emergencyFlags |= 0b00000100;
} }
} }

View File

@@ -292,14 +292,6 @@ protected:
this->haHelper->deleteDynamicSensor(prevSettings, Sensors::ValueType::RSSI); this->haHelper->deleteDynamicSensor(prevSettings, Sensors::ValueType::RSSI);
break; break;
case Sensors::Type::DHT11:
case Sensors::Type::DHT22:
this->haHelper->deleteConnectionDynamicSensor(prevSettings);
this->haHelper->deleteSignalQualityDynamicSensor(prevSettings);
this->haHelper->deleteDynamicSensor(prevSettings, Sensors::ValueType::TEMPERATURE);
this->haHelper->deleteDynamicSensor(prevSettings, Sensors::ValueType::HUMIDITY);
break;
case Sensors::Type::DALLAS_TEMP: case Sensors::Type::DALLAS_TEMP:
this->haHelper->deleteConnectionDynamicSensor(prevSettings); this->haHelper->deleteConnectionDynamicSensor(prevSettings);
this->haHelper->deleteSignalQualityDynamicSensor(prevSettings); this->haHelper->deleteSignalQualityDynamicSensor(prevSettings);
@@ -327,14 +319,6 @@ protected:
this->haHelper->publishDynamicSensor(sSettings, Sensors::ValueType::RSSI, settings.system.unitSystem, false); this->haHelper->publishDynamicSensor(sSettings, Sensors::ValueType::RSSI, settings.system.unitSystem, false);
break; break;
case Sensors::Type::DHT11:
case Sensors::Type::DHT22:
this->haHelper->publishConnectionDynamicSensor(sSettings);
this->haHelper->publishSignalQualityDynamicSensor(sSettings, false);
this->haHelper->publishDynamicSensor(sSettings, Sensors::ValueType::TEMPERATURE, settings.system.unitSystem);
this->haHelper->publishDynamicSensor(sSettings, Sensors::ValueType::HUMIDITY, settings.system.unitSystem);
break;
case Sensors::Type::DALLAS_TEMP: case Sensors::Type::DALLAS_TEMP:
this->haHelper->publishConnectionDynamicSensor(sSettings); this->haHelper->publishConnectionDynamicSensor(sSettings);
this->haHelper->publishSignalQualityDynamicSensor(sSettings, false); this->haHelper->publishSignalQualityDynamicSensor(sSettings, false);
@@ -432,7 +416,7 @@ protected:
return; return;
} }
if (settings.system.logLevel >= TinyLoggerLevel::TRACE) { if (settings.system.logLevel >= TinyLogger::Level::TRACE) {
Log.strace(FPSTR(L_MQTT_MSG), F("Topic: %s\r\n> "), topic.c_str()); Log.strace(FPSTR(L_MQTT_MSG), F("Topic: %s\r\n> "), topic.c_str());
if (Log.lock()) { if (Log.lock()) {
for (size_t i = 0; i < length; i++) { for (size_t i = 0; i < length; i++) {
@@ -502,7 +486,6 @@ protected:
void publishHaEntities() { void publishHaEntities() {
// heating // heating
this->haHelper->publishSwitchHeatingTurbo(false); this->haHelper->publishSwitchHeatingTurbo(false);
this->haHelper->publishSwitchHeatingHysteresis();
this->haHelper->publishInputHeatingHysteresis(settings.system.unitSystem); this->haHelper->publishInputHeatingHysteresis(settings.system.unitSystem);
this->haHelper->publishInputHeatingTurboFactor(false); this->haHelper->publishInputHeatingTurboFactor(false);
this->haHelper->publishInputHeatingMinTemp(settings.system.unitSystem); this->haHelper->publishInputHeatingMinTemp(settings.system.unitSystem);

View File

@@ -186,9 +186,7 @@ protected:
|| (settings.opentherm.options.dhwToCh2 && settings.opentherm.options.dhwSupport && settings.dhw.enabled); || (settings.opentherm.options.dhwToCh2 && settings.opentherm.options.dhwSupport && settings.dhw.enabled);
if (settings.opentherm.options.heatingToCh2) { if (settings.opentherm.options.heatingToCh2) {
vars.master.ch2.targetTemp = !settings.opentherm.options.nativeOTC vars.master.ch2.targetTemp = vars.master.heating.setpointTemp;
? vars.master.heating.setpointTemp
: vars.master.heating.targetTemp;
} else if (settings.opentherm.options.dhwToCh2) { } else if (settings.opentherm.options.dhwToCh2) {
vars.master.ch2.targetTemp = vars.master.dhw.targetTemp; vars.master.ch2.targetTemp = vars.master.dhw.targetTemp;
@@ -220,7 +218,7 @@ protected:
vars.master.heating.enabled, vars.master.heating.enabled,
vars.master.dhw.enabled, vars.master.dhw.enabled,
settings.opentherm.options.coolingSupport, settings.opentherm.options.coolingSupport,
settings.opentherm.options.nativeOTC, settings.opentherm.options.nativeHeatingControl,
vars.master.ch2.enabled, vars.master.ch2.enabled,
summerWinterMode, summerWinterMode,
dhwBlocking, dhwBlocking,
@@ -307,7 +305,6 @@ protected:
Sensors::setConnectionStatusByType(Sensors::Type::OT_DHW_BURNER_HOURS, false); Sensors::setConnectionStatusByType(Sensors::Type::OT_DHW_BURNER_HOURS, false);
Sensors::setConnectionStatusByType(Sensors::Type::OT_HEATING_PUMP_HOURS, false); Sensors::setConnectionStatusByType(Sensors::Type::OT_HEATING_PUMP_HOURS, false);
Sensors::setConnectionStatusByType(Sensors::Type::OT_DHW_PUMP_HOURS, false); Sensors::setConnectionStatusByType(Sensors::Type::OT_DHW_PUMP_HOURS, false);
Sensors::setConnectionStatusByType(Sensors::Type::OT_COOLING_HOURS, false);
this->initialized = false; this->initialized = false;
this->disconnectedTime = millis(); this->disconnectedTime = millis();
@@ -680,21 +677,6 @@ protected:
} }
} }
// Update cooling hours
if (Sensors::getAmountByType(Sensors::Type::OT_COOLING_HOURS, true)) {
if (this->updateCoolingHours()) {
Log.snoticeln(FPSTR(L_OT), F("Received cooling hours: %hu"), vars.slave.stats.coolingHours);
Sensors::setValueByType(
Sensors::Type::OT_COOLING_HOURS, vars.slave.stats.coolingHours,
Sensors::ValueType::PRIMARY, true, true
);
} else {
Log.swarningln(FPSTR(L_OT), F("Failed receive cooling hours"));
}
}
// Auto fault reset // Auto fault reset
if (settings.opentherm.options.autoFaultReset && vars.slave.fault.active && !vars.actions.resetFault) { if (settings.opentherm.options.autoFaultReset && vars.slave.fault.active && !vars.actions.resetFault) {
vars.actions.resetFault = true; vars.actions.resetFault = true;
@@ -810,7 +792,7 @@ protected:
bool result = this->updateDhwTemp(); bool result = this->updateDhwTemp();
if (result) { if (result) {
const float convertedDhwTemp = convertTemp( float convertedDhwTemp = convertTemp(
vars.slave.dhw.currentTemp, vars.slave.dhw.currentTemp,
settings.opentherm.unitSystem, settings.opentherm.unitSystem,
settings.system.unitSystem settings.system.unitSystem
@@ -834,7 +816,7 @@ protected:
// Update DHW temp 2 // Update DHW temp 2
if (settings.opentherm.options.dhwSupport && Sensors::getAmountByType(Sensors::Type::OT_DHW_TEMP2, true)) { if (settings.opentherm.options.dhwSupport && Sensors::getAmountByType(Sensors::Type::OT_DHW_TEMP2, true)) {
if (this->updateDhwTemp2()) { if (this->updateDhwTemp2()) {
const float convertedDhwTemp2 = convertTemp( float convertedDhwTemp2 = convertTemp(
vars.slave.dhw.currentTemp2, vars.slave.dhw.currentTemp2,
settings.opentherm.unitSystem, settings.opentherm.unitSystem,
settings.system.unitSystem settings.system.unitSystem
@@ -858,7 +840,7 @@ protected:
// Update DHW flow rate // Update DHW flow rate
if (settings.opentherm.options.dhwSupport && Sensors::getAmountByType(Sensors::Type::OT_DHW_FLOW_RATE, true)) { if (settings.opentherm.options.dhwSupport && Sensors::getAmountByType(Sensors::Type::OT_DHW_FLOW_RATE, true)) {
if (this->updateDhwFlowRate()) { if (this->updateDhwFlowRate()) {
const float convertedDhwFlowRate = convertVolume( float convertedDhwFlowRate = convertVolume(
vars.slave.dhw.flowRate, vars.slave.dhw.flowRate,
settings.opentherm.unitSystem, settings.opentherm.unitSystem,
settings.system.unitSystem settings.system.unitSystem
@@ -882,7 +864,7 @@ protected:
// Update heating temp // Update heating temp
if (Sensors::getAmountByType(Sensors::Type::OT_HEATING_TEMP, true)) { if (Sensors::getAmountByType(Sensors::Type::OT_HEATING_TEMP, true)) {
if (this->updateHeatingTemp()) { if (this->updateHeatingTemp()) {
const float convertedHeatingTemp = convertTemp( float convertedHeatingTemp = convertTemp(
vars.slave.heating.currentTemp, vars.slave.heating.currentTemp,
settings.opentherm.unitSystem, settings.opentherm.unitSystem,
settings.system.unitSystem settings.system.unitSystem
@@ -906,7 +888,7 @@ protected:
// Update heating return temp // Update heating return temp
if (Sensors::getAmountByType(Sensors::Type::OT_HEATING_RETURN_TEMP, true)) { if (Sensors::getAmountByType(Sensors::Type::OT_HEATING_RETURN_TEMP, true)) {
if (this->updateHeatingReturnTemp()) { if (this->updateHeatingReturnTemp()) {
const float convertedHeatingReturnTemp = convertTemp( float convertedHeatingReturnTemp = convertTemp(
vars.slave.heating.returnTemp, vars.slave.heating.returnTemp,
settings.opentherm.unitSystem, settings.opentherm.unitSystem,
settings.system.unitSystem settings.system.unitSystem
@@ -929,9 +911,9 @@ protected:
// Update CH2 temp // Update CH2 temp
if (Sensors::getAmountByType(Sensors::Type::OT_CH2_TEMP, true)) { if (Sensors::getAmountByType(Sensors::Type::OT_CH2_TEMP, true)) {
if (vars.master.ch2.enabled && !settings.opentherm.options.nativeOTC) { if (vars.master.ch2.enabled && !settings.opentherm.options.nativeHeatingControl) {
if (this->updateCh2Temp()) { if (this->updateCh2Temp()) {
const float convertedCh2Temp = convertTemp( float convertedCh2Temp = convertTemp(
vars.slave.ch2.currentTemp, vars.slave.ch2.currentTemp,
settings.opentherm.unitSystem, settings.opentherm.unitSystem,
settings.system.unitSystem settings.system.unitSystem
@@ -956,7 +938,7 @@ protected:
// Update exhaust temp // Update exhaust temp
if (Sensors::getAmountByType(Sensors::Type::OT_EXHAUST_TEMP, true)) { if (Sensors::getAmountByType(Sensors::Type::OT_EXHAUST_TEMP, true)) {
if (this->updateExhaustTemp()) { if (this->updateExhaustTemp()) {
const float convertedExhaustTemp = convertTemp( float convertedExhaustTemp = convertTemp(
vars.slave.exhaust.temp, vars.slave.exhaust.temp,
settings.opentherm.unitSystem, settings.opentherm.unitSystem,
settings.system.unitSystem settings.system.unitSystem
@@ -980,7 +962,7 @@ protected:
// Update heat exchanger temp // Update heat exchanger temp
if (Sensors::getAmountByType(Sensors::Type::OT_HEAT_EXCHANGER_TEMP, true)) { if (Sensors::getAmountByType(Sensors::Type::OT_HEAT_EXCHANGER_TEMP, true)) {
if (this->updateHeatExchangerTemp()) { if (this->updateHeatExchangerTemp()) {
const float convertedHeatExchTemp = convertTemp( float convertedHeatExchTemp = convertTemp(
vars.slave.heatExchangerTemp, vars.slave.heatExchangerTemp,
settings.opentherm.unitSystem, settings.opentherm.unitSystem,
settings.system.unitSystem settings.system.unitSystem
@@ -1004,7 +986,7 @@ protected:
// Update outdoor temp // Update outdoor temp
if (Sensors::getAmountByType(Sensors::Type::OT_OUTDOOR_TEMP, true)) { if (Sensors::getAmountByType(Sensors::Type::OT_OUTDOOR_TEMP, true)) {
if (this->updateOutdoorTemp()) { if (this->updateOutdoorTemp()) {
const float convertedOutdoorTemp = convertTemp( float convertedOutdoorTemp = convertTemp(
vars.slave.heating.outdoorTemp, vars.slave.heating.outdoorTemp,
settings.opentherm.unitSystem, settings.opentherm.unitSystem,
settings.system.unitSystem settings.system.unitSystem
@@ -1028,7 +1010,7 @@ protected:
// Update solar storage temp // Update solar storage temp
if (Sensors::getAmountByType(Sensors::Type::OT_SOLAR_STORAGE_TEMP, true)) { if (Sensors::getAmountByType(Sensors::Type::OT_SOLAR_STORAGE_TEMP, true)) {
if (this->updateSolarStorageTemp()) { if (this->updateSolarStorageTemp()) {
const float convertedSolarStorageTemp = convertTemp( float convertedSolarStorageTemp = convertTemp(
vars.slave.solar.storage, vars.slave.solar.storage,
settings.opentherm.unitSystem, settings.opentherm.unitSystem,
settings.system.unitSystem settings.system.unitSystem
@@ -1052,7 +1034,7 @@ protected:
// Update solar collector temp // Update solar collector temp
if (Sensors::getAmountByType(Sensors::Type::OT_SOLAR_COLLECTOR_TEMP, true)) { if (Sensors::getAmountByType(Sensors::Type::OT_SOLAR_COLLECTOR_TEMP, true)) {
if (this->updateSolarCollectorTemp()) { if (this->updateSolarCollectorTemp()) {
const float convertedSolarCollectorTemp = convertTemp( float convertedSolarCollectorTemp = convertTemp(
vars.slave.solar.collector, vars.slave.solar.collector,
settings.opentherm.unitSystem, settings.opentherm.unitSystem,
settings.system.unitSystem settings.system.unitSystem
@@ -1098,7 +1080,7 @@ protected:
// Update pressure // Update pressure
if (Sensors::getAmountByType(Sensors::Type::OT_PRESSURE, true)) { if (Sensors::getAmountByType(Sensors::Type::OT_PRESSURE, true)) {
if (this->updatePressure()) { if (this->updatePressure()) {
const float convertedPressure = convertPressure( float convertedPressure = convertPressure(
vars.slave.pressure, vars.slave.pressure,
settings.opentherm.unitSystem, settings.opentherm.unitSystem,
settings.system.unitSystem settings.system.unitSystem
@@ -1204,12 +1186,9 @@ protected:
// Update DHW temp // Update DHW temp
if (vars.master.dhw.enabled) { if (vars.master.dhw.enabled) {
// Target dhw temp
const float& targetTemp = vars.master.dhw.targetTemp;
// Converted target dhw temp // Converted target dhw temp
const float convertedTemp = convertTemp( float convertedTemp = convertTemp(
targetTemp, vars.master.dhw.targetTemp,
settings.system.unitSystem, settings.system.unitSystem,
settings.opentherm.unitSystem settings.opentherm.unitSystem
); );
@@ -1221,7 +1200,7 @@ protected:
Log.sinfoln( Log.sinfoln(
FPSTR(L_OT_DHW), F("Set temp: %.2f (converted: %.2f, response: %.2f)"), FPSTR(L_OT_DHW), F("Set temp: %.2f (converted: %.2f, response: %.2f)"),
targetTemp, convertedTemp, vars.slave.dhw.targetTemp vars.master.dhw.targetTemp, convertedTemp, vars.slave.dhw.targetTemp
); );
} else { } else {
@@ -1230,19 +1209,16 @@ protected:
} }
} }
// Send indoor temp if AlwaysSendIndoorTemp option is enabled. // Native heating control
if (settings.opentherm.options.nativeOTC || settings.opentherm.options.alwaysSendIndoorTemp) { if (settings.opentherm.options.nativeHeatingControl) {
// Current indoor temp
const float& indoorTemp = vars.master.heating.indoorTemp;
// Converted current indoor temp // Converted current indoor temp
const float convertedTemp = convertTemp(indoorTemp, settings.system.unitSystem, settings.opentherm.unitSystem); float convertedTemp = convertTemp(vars.master.heating.indoorTemp, settings.system.unitSystem, settings.opentherm.unitSystem);
// Set current indoor temp // Set current indoor temp
if (this->setRoomTemp(convertedTemp)) { if (this->setRoomTemp(convertedTemp)) {
Log.sinfoln( Log.sinfoln(
FPSTR(L_OT_HEATING), F("Set current indoor temp: %.2f (converted: %.2f, response: %.2f)"), FPSTR(L_OT_HEATING), F("Set current indoor temp: %.2f (converted: %.2f, response: %.2f)"),
indoorTemp, convertedTemp, vars.slave.heating.indoorTemp vars.master.heating.indoorTemp, convertedTemp, vars.slave.heating.indoorTemp
); );
} else { } else {
@@ -1254,26 +1230,17 @@ protected:
if (this->setRoomTempCh2(convertedTemp)) { if (this->setRoomTempCh2(convertedTemp)) {
Log.sinfoln( Log.sinfoln(
FPSTR(L_OT_HEATING), F("Set current CH2 indoor temp: %.2f (converted: %.2f, response: %.2f)"), FPSTR(L_OT_HEATING), F("Set current CH2 indoor temp: %.2f (converted: %.2f, response: %.2f)"),
indoorTemp, convertedTemp, vars.slave.ch2.indoorTemp vars.master.heating.indoorTemp, convertedTemp, vars.slave.ch2.indoorTemp
); );
} else { } else {
Log.swarningln(FPSTR(L_OT_HEATING), F("Failed set current CH2 indoor temp")); Log.swarningln(FPSTR(L_OT_HEATING), F("Failed set current CH2 indoor temp"));
} }
} }
}
// NativeOTC
if (settings.opentherm.options.nativeOTC) {
// Target indoor temp
const float& targetTemp = vars.master.heating.targetTemp;
// Converted target indoor temp // Converted target indoor temp
const float convertedTemp = convertTemp( convertedTemp = convertTemp(vars.master.heating.targetTemp, settings.system.unitSystem, settings.opentherm.unitSystem);
targetTemp,
settings.system.unitSystem,
settings.opentherm.unitSystem
);
// Set target indoor temp // Set target indoor temp
if (this->needSetHeatingTemp(convertedTemp)) { if (this->needSetHeatingTemp(convertedTemp)) {
@@ -1282,7 +1249,7 @@ protected:
Log.sinfoln( Log.sinfoln(
FPSTR(L_OT_HEATING), F("Set target indoor temp: %.2f (converted: %.2f, response: %.2f)"), FPSTR(L_OT_HEATING), F("Set target indoor temp: %.2f (converted: %.2f, response: %.2f)"),
targetTemp, convertedTemp, vars.slave.heating.targetTemp vars.master.heating.targetTemp, convertedTemp, vars.slave.heating.targetTemp
); );
} else { } else {
@@ -1297,7 +1264,7 @@ protected:
Log.sinfoln( Log.sinfoln(
FPSTR(L_OT_HEATING), F("Set target CH2 indoor temp: %.2f (converted: %.2f, response: %.2f)"), FPSTR(L_OT_HEATING), F("Set target CH2 indoor temp: %.2f (converted: %.2f, response: %.2f)"),
targetTemp, convertedTemp, vars.slave.ch2.targetTemp vars.master.heating.targetTemp, convertedTemp, vars.slave.ch2.targetTemp
); );
} else { } else {
@@ -1306,22 +1273,10 @@ protected:
} }
} }
// Set heating temp // Normal heating control
{ if (!settings.opentherm.options.nativeHeatingControl && vars.master.heating.enabled) {
// Target heating temp
float targetTemp = 0.0f;
if (vars.master.heating.enabled) {
targetTemp = !settings.opentherm.options.nativeOTC
? vars.master.heating.setpointTemp
: vars.master.heating.targetTemp;
}
// Converted target heating temp // Converted target heating temp
const float convertedTemp = convertTemp( float convertedTemp = convertTemp(vars.master.heating.setpointTemp, settings.system.unitSystem, settings.opentherm.unitSystem);
targetTemp,
settings.system.unitSystem,
settings.opentherm.unitSystem
);
if (this->needSetHeatingTemp(convertedTemp)) { if (this->needSetHeatingTemp(convertedTemp)) {
// Set max heating temp // Set max heating temp
@@ -1329,13 +1284,13 @@ protected:
if (this->setMaxHeatingTemp(convertedTemp)) { if (this->setMaxHeatingTemp(convertedTemp)) {
Log.sinfoln( Log.sinfoln(
FPSTR(L_OT_HEATING), F("Set max heating temp: %.2f (converted: %.2f)"), FPSTR(L_OT_HEATING), F("Set max heating temp: %.2f (converted: %.2f)"),
targetTemp, convertedTemp vars.master.heating.setpointTemp, convertedTemp
); );
} else { } else {
Log.swarningln( Log.swarningln(
FPSTR(L_OT_HEATING), F("Failed set max heating temp: %.2f (converted: %.2f)"), FPSTR(L_OT_HEATING), F("Failed set max heating temp: %.2f (converted: %.2f)"),
targetTemp, convertedTemp vars.master.heating.setpointTemp, convertedTemp
); );
} }
} }
@@ -1346,7 +1301,7 @@ protected:
Log.sinfoln( Log.sinfoln(
FPSTR(L_OT_HEATING), F("Set target temp: %.2f (converted: %.2f, response: %.2f)"), FPSTR(L_OT_HEATING), F("Set target temp: %.2f (converted: %.2f, response: %.2f)"),
targetTemp, convertedTemp, vars.slave.heating.targetTemp vars.master.heating.setpointTemp, convertedTemp, vars.slave.heating.targetTemp
); );
} else { } else {
@@ -1356,30 +1311,27 @@ protected:
} }
// Set CH2 temp // Set CH2 temp
if (settings.opentherm.options.heatingToCh2 || settings.opentherm.options.dhwToCh2) { if (!settings.opentherm.options.nativeHeatingControl && vars.master.ch2.enabled) {
// Target CH2 heating temp if (settings.opentherm.options.heatingToCh2 || settings.opentherm.options.dhwToCh2) {
const float targetTemp = vars.master.ch2.enabled // Converted target CH2 temp
? vars.master.ch2.targetTemp float convertedTemp = convertTemp(
: 0.0f; vars.master.ch2.targetTemp,
settings.system.unitSystem,
settings.opentherm.unitSystem
);
// Converted target CH2 temp if (this->needSetCh2Temp(convertedTemp)) {
const float convertedTemp = convertTemp( if (this->setCh2Temp(convertedTemp)) {
targetTemp, this->ch2SetTempTime = millis();
settings.system.unitSystem,
settings.opentherm.unitSystem
);
if (this->needSetCh2Temp(convertedTemp)) { Log.sinfoln(
if (this->setCh2Temp(convertedTemp)) { FPSTR(L_OT_CH2), F("Set temp: %.2f (converted: %.2f, response: %.2f)"),
this->ch2SetTempTime = millis(); vars.master.ch2.targetTemp, convertedTemp, vars.slave.ch2.targetTemp
);
Log.sinfoln( } else {
FPSTR(L_OT_CH2), F("Set temp: %.2f (converted: %.2f, response: %.2f)"), Log.swarningln(FPSTR(L_OT_CH2), F("Failed set temp"));
targetTemp, convertedTemp, vars.slave.ch2.targetTemp }
);
} else {
Log.swarningln(FPSTR(L_OT_CH2), F("Failed set temp"));
} }
} }
} }
@@ -1387,7 +1339,7 @@ protected:
// Heating overheat control // Heating overheat control
if (settings.heating.overheatProtection.highTemp > 0 && settings.heating.overheatProtection.lowTemp > 0) { if (settings.heating.overheatProtection.highTemp > 0 && settings.heating.overheatProtection.lowTemp > 0) {
const float highTemp = convertTemp( float highTemp = convertTemp(
max({ max({
vars.slave.heating.currentTemp, vars.slave.heating.currentTemp,
vars.slave.heating.returnTemp, vars.slave.heating.returnTemp,
@@ -1424,7 +1376,7 @@ protected:
// DHW overheat control // DHW overheat control
if (settings.dhw.overheatProtection.highTemp > 0 && settings.dhw.overheatProtection.lowTemp > 0) { if (settings.dhw.overheatProtection.highTemp > 0 && settings.dhw.overheatProtection.lowTemp > 0) {
const float highTemp = convertTemp( float highTemp = convertTemp(
max({ max({
vars.slave.heating.currentTemp, vars.slave.heating.currentTemp,
vars.slave.heating.returnTemp, vars.slave.heating.returnTemp,
@@ -1518,19 +1470,6 @@ protected:
} else { } else {
Log.swarningln(FPSTR(L_OT), F("Failed set master config")); Log.swarningln(FPSTR(L_OT), F("Failed set master config"));
} }
/*char buf[100];
if (this->instance->getStr(OpenThermMessageID::Brand, buf, sizeof(buf) - 1)) {
Log.snoticeln(FPSTR(L_OT), F("Slave brand: %s"), buf);
}
if (this->instance->getStr(OpenThermMessageID::BrandVersion, buf, sizeof(buf) - 1)) {
Log.snoticeln(FPSTR(L_OT), F("Slave brand version: %s"), buf);
}
if (this->instance->getStr(OpenThermMessageID::BrandSerialNumber, buf, sizeof(buf) - 1)) {
Log.snoticeln(FPSTR(L_OT), F("Slave brand s/n: %s"), buf);
}*/
} }
bool isReady() { bool isReady() {
@@ -1708,7 +1647,7 @@ protected:
} }
bool setRoomTemp(const float temperature) { bool setRoomTemp(float temperature) {
const unsigned int request = CustomOpenTherm::temperatureToData(temperature); const unsigned int request = CustomOpenTherm::temperatureToData(temperature);
const unsigned long response = this->instance->sendRequest(CustomOpenTherm::buildRequest( const unsigned long response = this->instance->sendRequest(CustomOpenTherm::buildRequest(
OpenThermMessageType::WRITE_DATA, OpenThermMessageType::WRITE_DATA,
@@ -1728,7 +1667,7 @@ protected:
return CustomOpenTherm::getUInt(response) == request; return CustomOpenTherm::getUInt(response) == request;
} }
bool setRoomTempCh2(const float temperature) { bool setRoomTempCh2(float temperature) {
const unsigned int request = CustomOpenTherm::temperatureToData(temperature); const unsigned int request = CustomOpenTherm::temperatureToData(temperature);
const unsigned long response = this->instance->sendRequest(CustomOpenTherm::buildRequest( const unsigned long response = this->instance->sendRequest(CustomOpenTherm::buildRequest(
OpenThermMessageType::WRITE_DATA, OpenThermMessageType::WRITE_DATA,
@@ -2230,25 +2169,6 @@ protected:
return true; return true;
} }
bool updateCoolingHours() {
const unsigned long response = this->instance->sendRequest(CustomOpenTherm::buildRequest(
OpenThermRequestType::READ_DATA,
OpenThermMessageID::CoolingOperationHours,
0
));
if (!CustomOpenTherm::isValidResponse(response)) {
return false;
} else if (!CustomOpenTherm::isValidResponseId(response, OpenThermMessageID::CoolingOperationHours)) {
return false;
}
vars.slave.stats.coolingHours = CustomOpenTherm::getUInt(response);
return true;
}
bool updateModulationLevel() { bool updateModulationLevel() {
const unsigned long response = this->instance->sendRequest(CustomOpenTherm::buildRequest( const unsigned long response = this->instance->sendRequest(CustomOpenTherm::buildRequest(
OpenThermRequestType::READ_DATA, OpenThermRequestType::READ_DATA,
@@ -2263,7 +2183,7 @@ protected:
return false; return false;
} }
const float value = CustomOpenTherm::getFloat(response); float value = CustomOpenTherm::getFloat(response);
if (value < 0) { if (value < 0) {
return false; return false;
} }
@@ -2287,7 +2207,7 @@ protected:
return false; return false;
} }
const float value = CustomOpenTherm::getFloat(response); float value = CustomOpenTherm::getFloat(response);
if (value <= 0) { if (value <= 0) {
return false; return false;
} }
@@ -2311,7 +2231,7 @@ protected:
return false; return false;
} }
const float value = CustomOpenTherm::getFloat(response); float value = CustomOpenTherm::getFloat(response);
if (value <= 0) { if (value <= 0) {
return false; return false;
} }
@@ -2365,7 +2285,7 @@ protected:
return false; return false;
} }
const float value = CustomOpenTherm::getFloat(response); float value = CustomOpenTherm::getFloat(response);
if (value <= 0) { if (value <= 0) {
return false; return false;
} }
@@ -2429,7 +2349,7 @@ protected:
return false; return false;
} }
const float value = (float) CustomOpenTherm::getInt(response); float value = (float) CustomOpenTherm::getInt(response);
if (!isValidTemp(value, settings.opentherm.unitSystem, -40, 500)) { if (!isValidTemp(value, settings.opentherm.unitSystem, -40, 500)) {
return false; return false;
} }
@@ -2453,7 +2373,7 @@ protected:
return false; return false;
} }
const float value = (float) CustomOpenTherm::getInt(response); float value = (float) CustomOpenTherm::getInt(response);
if (value <= 0) { if (value <= 0) {
return false; return false;
} }
@@ -2554,7 +2474,7 @@ protected:
return false; return false;
} }
const float value = CustomOpenTherm::getFloat(response); float value = CustomOpenTherm::getFloat(response);
if (value < 0) { if (value < 0) {
return false; return false;
} }

File diff suppressed because it is too large Load Diff

View File

@@ -37,7 +37,7 @@ protected:
this->indoorSensorsConnected = Sensors::existsConnectedSensorsByPurpose(Sensors::Purpose::INDOOR_TEMP); this->indoorSensorsConnected = Sensors::existsConnectedSensorsByPurpose(Sensors::Purpose::INDOOR_TEMP);
//this->outdoorSensorsConnected = Sensors::existsConnectedSensorsByPurpose(Sensors::Purpose::OUTDOOR_TEMP); //this->outdoorSensorsConnected = Sensors::existsConnectedSensorsByPurpose(Sensors::Purpose::OUTDOOR_TEMP);
if (settings.equitherm.enabled || settings.pid.enabled || settings.opentherm.options.nativeOTC) { if (settings.equitherm.enabled || settings.pid.enabled || settings.opentherm.options.nativeHeatingControl) {
vars.master.heating.indoorTempControl = true; vars.master.heating.indoorTempControl = true;
vars.master.heating.minTemp = THERMOSTAT_INDOOR_MIN_TEMP; vars.master.heating.minTemp = THERMOSTAT_INDOOR_MIN_TEMP;
vars.master.heating.maxTemp = THERMOSTAT_INDOOR_MAX_TEMP; vars.master.heating.maxTemp = THERMOSTAT_INDOOR_MAX_TEMP;
@@ -90,15 +90,15 @@ protected:
void hysteresis() { void hysteresis() {
bool useHyst = false; bool useHyst = false;
if (settings.heating.hysteresis.enabled && this->indoorSensorsConnected) { if (settings.heating.hysteresis > 0.01f && this->indoorSensorsConnected) {
useHyst = settings.equitherm.enabled || settings.pid.enabled || settings.opentherm.options.nativeOTC; useHyst = settings.equitherm.enabled || settings.pid.enabled || settings.opentherm.options.nativeHeatingControl;
} }
if (useHyst) { if (useHyst) {
if (!vars.master.heating.blocking && vars.master.heating.indoorTemp - settings.heating.target + 0.0001f >= settings.heating.hysteresis.value) { if (!vars.master.heating.blocking && vars.master.heating.indoorTemp - settings.heating.target + 0.0001f >= settings.heating.hysteresis) {
vars.master.heating.blocking = true; vars.master.heating.blocking = true;
} else if (vars.master.heating.blocking && vars.master.heating.indoorTemp - settings.heating.target - 0.0001f <= -(settings.heating.hysteresis.value)) { } else if (vars.master.heating.blocking && vars.master.heating.indoorTemp - settings.heating.target - 0.0001f <= -(settings.heating.hysteresis)) {
vars.master.heating.blocking = false; vars.master.heating.blocking = false;
} }
@@ -108,13 +108,13 @@ protected:
} }
inline float getHeatingMinSetpointTemp() { inline float getHeatingMinSetpointTemp() {
return settings.opentherm.options.nativeOTC return settings.opentherm.options.nativeHeatingControl
? vars.master.heating.minTemp ? vars.master.heating.minTemp
: settings.heating.minTemp; : settings.heating.minTemp;
} }
inline float getHeatingMaxSetpointTemp() { inline float getHeatingMaxSetpointTemp() {
return settings.opentherm.options.nativeOTC return settings.opentherm.options.nativeHeatingControl
? vars.master.heating.maxTemp ? vars.master.heating.maxTemp
: settings.heating.maxTemp; : settings.heating.maxTemp;
} }
@@ -135,7 +135,7 @@ protected:
if (vars.emergency.state) { if (vars.emergency.state) {
return settings.emergency.target; return settings.emergency.target;
} else if (settings.opentherm.options.nativeOTC) { } else if (settings.opentherm.options.nativeHeatingControl) {
return settings.heating.target; return settings.heating.target;
} else if (!settings.equitherm.enabled && !settings.pid.enabled) { } else if (!settings.equitherm.enabled && !settings.pid.enabled) {

View File

@@ -34,13 +34,10 @@ public:
OT_DHW_BURNER_HOURS = 24, OT_DHW_BURNER_HOURS = 24,
OT_HEATING_PUMP_HOURS = 25, OT_HEATING_PUMP_HOURS = 25,
OT_DHW_PUMP_HOURS = 26, OT_DHW_PUMP_HOURS = 26,
OT_COOLING_HOURS = 27,
NTC_10K_TEMP = 50, NTC_10K_TEMP = 50,
DALLAS_TEMP = 51, DALLAS_TEMP = 51,
BLUETOOTH = 52, BLUETOOTH = 52,
DHT11 = 53,
DHT22 = 54,
HEATING_SETPOINT_TEMP = 253, HEATING_SETPOINT_TEMP = 253,
MANUAL = 254, MANUAL = 254,
@@ -152,7 +149,7 @@ public:
static int16_t getIdByName(const char* name) { static int16_t getIdByName(const char* name) {
if (settings == nullptr) { if (settings == nullptr) {
return -1; return 0;
} }
for (uint8_t id = 0; id <= getMaxSensorId(); id++) { for (uint8_t id = 0; id <= getMaxSensorId(); id++) {
@@ -166,7 +163,7 @@ public:
static int16_t getIdByObjectId(const char* objectId) { static int16_t getIdByObjectId(const char* objectId) {
if (settings == nullptr) { if (settings == nullptr) {
return -1; return 0;
} }
String refObjectId; String refObjectId;
@@ -332,12 +329,12 @@ public:
static float getMeanValueByPurpose(Purpose purpose, const ValueType valueType, bool onlyConnected = true) { static float getMeanValueByPurpose(Purpose purpose, const ValueType valueType, bool onlyConnected = true) {
if (settings == nullptr || results == nullptr) { if (settings == nullptr || results == nullptr) {
return 0.0f; return 0;
} }
uint8_t valueId = (uint8_t) valueType; uint8_t valueId = (uint8_t) valueType;
if (!isValidValueId(valueId)) { if (!isValidValueId(valueId)) {
return 0.0f; return 0;
} }
float value = 0.0f; float value = 0.0f;
@@ -366,7 +363,7 @@ public:
static bool existsConnectedSensorsByPurpose(Purpose purpose) { static bool existsConnectedSensorsByPurpose(Purpose purpose) {
if (settings == nullptr || results == nullptr) { if (settings == nullptr || results == nullptr) {
return false; return 0;
} }
for (uint8_t id = 0; id <= getMaxSensorId(); id++) { for (uint8_t id = 0; id <= getMaxSensorId(); id++) {

View File

@@ -1,7 +1,6 @@
#include <unordered_map> #include <unordered_map>
#include <OneWire.h> #include <OneWire.h>
#include <DallasTemperature.h> #include <DallasTemperature.h>
#include <esp32DHT.h>
#if USE_BLE #if USE_BLE
#include <NimBLEDevice.h> #include <NimBLEDevice.h>
@@ -51,50 +50,36 @@ protected:
class SensorsTask : public LeanTask { class SensorsTask : public LeanTask {
public: public:
SensorsTask(bool _enabled = false, unsigned long _interval = 0) : LeanTask(_enabled, _interval) { SensorsTask(bool _enabled = false, unsigned long _interval = 0) : LeanTask(_enabled, _interval) {
this->gpioLastPollingTime.reserve(2);
// OneWire
this->owInstances.reserve(2); this->owInstances.reserve(2);
this->dallasInstances.reserve(2); this->dallasInstances.reserve(2);
this->dallasSearchTime.reserve(2); this->dallasSearchTime.reserve(2);
this->dallasPolling.reserve(2); this->dallasPolling.reserve(2);
this->dallasLastPollingTime.reserve(2);
} }
~SensorsTask() { ~SensorsTask() {
this->gpioLastPollingTime.clear();
// OneWire
this->dallasInstances.clear(); this->dallasInstances.clear();
this->owInstances.clear(); this->owInstances.clear();
this->dallasSearchTime.clear(); this->dallasSearchTime.clear();
this->dallasPolling.clear(); this->dallasPolling.clear();
this->dallasLastPollingTime.clear();
} }
protected: protected:
const unsigned int wiredDisconnectTimeout = 180000u; const unsigned int disconnectedTimeout = 120000;
const unsigned int wirelessDisconnectTimeout = 600000u;
const unsigned short dallasSearchInterval = 60000; const unsigned short dallasSearchInterval = 60000;
const unsigned short dallasPollingInterval = 10000; const unsigned short dallasPollingInterval = 10000;
const unsigned short dhtPollingInterval = 15000;
const unsigned short globalPollingInterval = 15000; const unsigned short globalPollingInterval = 15000;
#if USE_BLE #if USE_BLE
const unsigned int bleSetDtInterval = 7200000; const unsigned int bleSetDtInterval = 7200000;
#endif #endif
std::unordered_map<uint8_t, unsigned long> gpioLastPollingTime;
// OneWire
std::unordered_map<uint8_t, OneWire> owInstances; std::unordered_map<uint8_t, OneWire> owInstances;
std::unordered_map<uint8_t, DallasTemperature> dallasInstances; std::unordered_map<uint8_t, DallasTemperature> dallasInstances;
std::unordered_map<uint8_t, unsigned long> dallasSearchTime; std::unordered_map<uint8_t, unsigned long> dallasSearchTime;
std::unordered_map<uint8_t, bool> dallasPolling; std::unordered_map<uint8_t, bool> dallasPolling;
std::unordered_map<uint8_t, unsigned long> dallasLastPollingTime;
// DHT
DHT dhtInstance;
bool dhtIsPolling = false;
#if USE_BLE #if USE_BLE
// Bluetooth
std::unordered_map<uint8_t, NimBLEClient*> bleClients; std::unordered_map<uint8_t, NimBLEClient*> bleClients;
std::unordered_map<uint8_t, bool> bleSubscribed; std::unordered_map<uint8_t, bool> bleSubscribed;
std::unordered_map<uint8_t, unsigned long> bleLastSetDtTime; std::unordered_map<uint8_t, unsigned long> bleLastSetDtTime;
@@ -130,9 +115,6 @@ protected:
this->yield(); this->yield();
} }
pollingDhtSensors();
this->yield();
if (millis() - this->globalLastPollingTime > this->globalPollingInterval) { if (millis() - this->globalLastPollingTime > this->globalPollingInterval) {
cleanDallasInstances(); cleanDallasInstances();
makeDallasInstances(); makeDallasInstances();
@@ -190,7 +172,7 @@ protected:
this->dallasSearchTime[sSensor.gpio] = 0; this->dallasSearchTime[sSensor.gpio] = 0;
this->dallasPolling[sSensor.gpio] = false; this->dallasPolling[sSensor.gpio] = false;
this->gpioLastPollingTime[sSensor.gpio] = 0; this->dallasLastPollingTime[sSensor.gpio] = 0;
auto& instance = this->dallasInstances[sSensor.gpio]; auto& instance = this->dallasInstances[sSensor.gpio];
instance.setOneWire(&owInstance); instance.setOneWire(&owInstance);
@@ -225,7 +207,7 @@ protected:
this->owInstances.erase(gpio); this->owInstances.erase(gpio);
this->dallasSearchTime.erase(gpio); this->dallasSearchTime.erase(gpio);
this->dallasPolling.erase(gpio); this->dallasPolling.erase(gpio);
this->gpioLastPollingTime.erase(gpio); this->dallasLastPollingTime.erase(gpio);
Log.sinfoln(FPSTR(L_SENSORS_DALLAS), F("Stopped on GPIO %hhu"), gpio); Log.sinfoln(FPSTR(L_SENSORS_DALLAS), F("Stopped on GPIO %hhu"), gpio);
continue; continue;
@@ -346,7 +328,7 @@ protected:
if (this->dallasPolling[gpio]) { if (this->dallasPolling[gpio]) {
unsigned long minPollingTime = instance.millisToWaitForConversion(12) * 2; unsigned long minPollingTime = instance.millisToWaitForConversion(12) * 2;
unsigned long estimatePollingTime = ts - this->gpioLastPollingTime[gpio]; unsigned long estimatePollingTime = ts - this->dallasLastPollingTime[gpio];
// check conversion time // check conversion time
// isConversionComplete does not work with chinese clones! // isConversionComplete does not work with chinese clones!
@@ -398,7 +380,7 @@ protected:
this->dallasPolling[gpio] = false; this->dallasPolling[gpio] = false;
} else if (newPolling) { } else if (newPolling) {
auto estimateLastPollingTime = ts - this->gpioLastPollingTime[gpio]; auto estimateLastPollingTime = ts - this->dallasLastPollingTime[gpio];
// check last polling time // check last polling time
if (estimateLastPollingTime < this->dallasPollingInterval) { if (estimateLastPollingTime < this->dallasPollingInterval) {
@@ -409,102 +391,13 @@ protected:
instance.setResolution(12); instance.setResolution(12);
instance.requestTemperatures(); instance.requestTemperatures();
this->dallasPolling[gpio] = true; this->dallasPolling[gpio] = true;
this->gpioLastPollingTime[gpio] = ts; this->dallasLastPollingTime[gpio] = ts;
Log.straceln(FPSTR(L_SENSORS_DALLAS), F("GPIO %hhu, polling..."), gpio); Log.straceln(FPSTR(L_SENSORS_DALLAS), F("GPIO %hhu, polling..."), gpio);
} }
} }
} }
void pollingDhtSensors() {
if (this->dhtIsPolling) {
// busy
return;
}
for (uint8_t sensorId = 0; sensorId <= Sensors::getMaxSensorId(); sensorId++) {
auto& sSensor = Sensors::settings[sensorId];
if (!sSensor.enabled || sSensor.purpose == Sensors::Purpose::NOT_CONFIGURED) {
continue;
}
if (sSensor.type != Sensors::Type::DHT11 && sSensor.type != Sensors::Type::DHT22) {
continue;
}
if (this->gpioLastPollingTime.count(sSensor.gpio) && millis() - this->gpioLastPollingTime[sSensor.gpio] < this->dhtPollingInterval) {
continue;
}
const auto sensorGpio = static_cast<gpio_num_t>(sSensor.gpio);
if (this->dhtInstance.getGpio() != sensorGpio) {
this->dhtInstance.reset();
this->dhtInstance.onData([this, sensorId](float humidity, float temperature) {
auto& sSensor = Sensors::settings[sensorId];
Log.straceln(
FPSTR(L_SENSORS_DHT), F("GPIO %hhu, sensor #%hhu '%s', temp: %.2f, humidity: %.2f%%"),
sSensor.gpio, sensorId, sSensor.name, temperature, humidity
);
// set temperature
Sensors::setValueById(sensorId, temperature, Sensors::ValueType::TEMPERATURE, true, true);
// set humidity
Sensors::setValueById(sensorId, humidity, Sensors::ValueType::HUMIDITY, true, true);
auto& rSensor = Sensors::results[sensorId];
if (rSensor.signalQuality < 100) {
rSensor.signalQuality++;
}
this->gpioLastPollingTime[sSensor.gpio] = millis();
this->dhtIsPolling = false;
});
this->dhtInstance.onError([this, sensorId](DHT::Status status) {
auto& sSensor = Sensors::settings[sensorId];
Log.swarningln(
FPSTR(L_SENSORS_DHT), F("GPIO %hhu, sensor #%hhu '%s': failed receiving data (err: %s)"),
sSensor.gpio, sensorId, sSensor.name, DHT::statusToString(this->dhtInstance.getStatus())
);
auto& rSensor = Sensors::results[sensorId];
if (rSensor.signalQuality > 0) {
rSensor.signalQuality--;
}
this->gpioLastPollingTime[sSensor.gpio] = millis();
this->dhtIsPolling = false;
});
DHT::Type sType = DHT::Type::DHT22;
if (sSensor.type == Sensors::Type::DHT11) {
sType = DHT::Type::DHT11;
} else if (sSensor.type == Sensors::Type::DHT22) {
sType = DHT::Type::DHT22;
}
if (this->dhtInstance.setup(sensorGpio, sType)) {
Log.sinfoln(FPSTR(L_SENSORS_DHT), F("Started on GPIO %hhu"), sSensor.gpio);
} else {
Log.swarningln(
FPSTR(L_SENSORS_DHT), F("Failed to start on GPIO %hhu (err: %s)"),
sSensor.gpio, DHT::statusToString(this->dhtInstance.getStatus())
);
}
}
this->dhtIsPolling = this->dhtInstance.poll();
break;
}
}
void pollingNtcSensors() { void pollingNtcSensors() {
for (uint8_t sensorId = 0; sensorId <= Sensors::getMaxSensorId(); sensorId++) { for (uint8_t sensorId = 0; sensorId <= Sensors::getMaxSensorId(); sensorId++) {
auto& sSensor = Sensors::settings[sensorId]; auto& sSensor = Sensors::settings[sensorId];
@@ -1111,16 +1004,12 @@ protected:
} else if (rSensor.connected && sSensor.purpose == Sensors::Purpose::NOT_CONFIGURED) { } else if (rSensor.connected && sSensor.purpose == Sensors::Purpose::NOT_CONFIGURED) {
Sensors::setConnectionStatusById(sensorId, false, false); Sensors::setConnectionStatusById(sensorId, false, false);
} else if (rSensor.connected) { } else if (sSensor.type != Sensors::Type::MANUAL && rSensor.connected && (millis() - rSensor.activityTime) > this->disconnectedTimeout) {
if (sSensor.type == Sensors::Type::MANUAL || sSensor.type == Sensors::Type::BLUETOOTH) { Sensors::setConnectionStatusById(sensorId, false, false);
if ((millis() - rSensor.activityTime) > this->wirelessDisconnectTimeout) {
Sensors::setConnectionStatusById(sensorId, false, false);
}
} else if ((millis() - rSensor.activityTime) > this->wiredDisconnectTimeout) { }/* else if (!rSensor.connected) {
Sensors::setConnectionStatusById(sensorId, false, false); rSensor.connected = true;
} }*/
}
} }
} }

View File

@@ -32,8 +32,9 @@ struct Settings {
} serial; } serial;
struct { struct {
bool enabled = DEFAULT_WEBSERIAL_ENABLED; bool enabled = DEFAULT_TELNET_ENABLED;
} webSerial; unsigned short port = DEFAULT_TELNET_PORT;
} telnet;
struct { struct {
char server[49] = "pool.ntp.org"; char server[49] = "pool.ntp.org";
@@ -77,8 +78,7 @@ struct Settings {
bool autoFaultReset = false; bool autoFaultReset = false;
bool autoDiagReset = false; bool autoDiagReset = false;
bool setDateAndTime = false; bool setDateAndTime = false;
bool alwaysSendIndoorTemp = true; bool nativeHeatingControl = false;
bool nativeOTC = false;
bool immergasFix = false; bool immergasFix = false;
} options; } options;
} opentherm; } opentherm;
@@ -103,17 +103,12 @@ struct Settings {
bool enabled = true; bool enabled = true;
bool turbo = false; bool turbo = false;
float target = DEFAULT_HEATING_TARGET_TEMP; float target = DEFAULT_HEATING_TARGET_TEMP;
float hysteresis = 0.5f;
float turboFactor = 7.5f; float turboFactor = 7.5f;
uint8_t minTemp = DEFAULT_HEATING_MIN_TEMP; uint8_t minTemp = DEFAULT_HEATING_MIN_TEMP;
uint8_t maxTemp = DEFAULT_HEATING_MAX_TEMP; uint8_t maxTemp = DEFAULT_HEATING_MAX_TEMP;
uint8_t maxModulation = 100; uint8_t maxModulation = 100;
struct {
bool enabled = true;
float value = 0.5f;
HysteresisAction action = HysteresisAction::DISABLE_HEATING;
} hysteresis;
struct { struct {
uint8_t highTemp = 95; uint8_t highTemp = 95;
uint8_t lowTemp = 90; uint8_t lowTemp = 90;
@@ -388,7 +383,6 @@ struct Variables {
uint16_t dhwBurnerStarts = 0; uint16_t dhwBurnerStarts = 0;
uint16_t heatingPumpStarts = 0; uint16_t heatingPumpStarts = 0;
uint16_t dhwPumpStarts = 0; uint16_t dhwPumpStarts = 0;
uint16_t coolingHours = 0;
uint16_t burnerHours = 0; uint16_t burnerHours = 0;
uint16_t dhwBurnerHours = 0; uint16_t dhwBurnerHours = 0;
uint16_t heatingPumpHours = 0; uint16_t heatingPumpHours = 0;

View File

@@ -30,10 +30,6 @@
#define BUILD_VERSION "0.0.0" #define BUILD_VERSION "0.0.0"
#endif #endif
#ifndef BUILD_COMMIT
#define BUILD_COMMIT "undefined"
#endif
#ifndef BUILD_ENV #ifndef BUILD_ENV
#define BUILD_ENV "undefined" #define BUILD_ENV "undefined"
#endif #endif
@@ -46,8 +42,12 @@
#define DEFAULT_SERIAL_BAUD 115200 #define DEFAULT_SERIAL_BAUD 115200
#endif #endif
#ifndef DEFAULT_WEBSERIAL_ENABLED #ifndef DEFAULT_TELNET_ENABLED
#define DEFAULT_WEBSERIAL_ENABLED true #define DEFAULT_TELNET_ENABLED true
#endif
#ifndef DEFAULT_TELNET_PORT
#define DEFAULT_TELNET_PORT 23
#endif #endif
#ifndef USE_BLE #ifndef USE_BLE
@@ -75,7 +75,7 @@
#endif #endif
#ifndef DEFAULT_LOG_LEVEL #ifndef DEFAULT_LOG_LEVEL
#define DEFAULT_LOG_LEVEL TinyLoggerLevel::VERBOSE #define DEFAULT_LOG_LEVEL TinyLogger::Level::VERBOSE
#endif #endif
#ifndef DEFAULT_STATUS_LED_GPIO #ifndef DEFAULT_STATUS_LED_GPIO
@@ -163,9 +163,4 @@ enum class UnitSystem : uint8_t {
IMPERIAL = 1 IMPERIAL = 1
}; };
enum class HysteresisAction : uint8_t {
DISABLE_HEATING = 0,
SET_ZERO_TARGET = 1
};
char buffer[255]; char buffer[255];

3
src/idf_component.yml Normal file
View File

@@ -0,0 +1,3 @@
dependencies:
idf: ">=5.3.2"
h2zero/esp-nimble-cpp: ">=2.2.1"

View File

@@ -1,8 +1,11 @@
#define ARDUINOJSON_USE_DOUBLE 0
#define ARDUINOJSON_USE_LONG_LONG 0
#include <Arduino.h> #include <Arduino.h>
#include <ArduinoJson.h> #include <ArduinoJson.h>
#include <FileData.h> #include <FileData.h>
#include <LittleFS.h> #include <LittleFS.h>
#include <MycilaWebSerial.h> #include <ESPTelnetStream.h>
#include "defines.h" #include "defines.h"
#include "strings.h" #include "strings.h"
@@ -34,7 +37,7 @@
using namespace NetworkUtils; using namespace NetworkUtils;
// Vars // Vars
WebSerial* webSerial = nullptr; ESPTelnetStream* telnetStream = nullptr;
NetworkMgr* network = nullptr; NetworkMgr* network = nullptr;
Sensors::Result sensorsResults[SENSORS_AMOUNT]; Sensors::Result sensorsResults[SENSORS_AMOUNT];
@@ -58,7 +61,7 @@ void setup() {
Sensors::results = sensorsResults; Sensors::results = sensorsResults;
LittleFS.begin(); LittleFS.begin();
Log.setLevel(TinyLoggerLevel::VERBOSE); Log.setLevel(TinyLogger::Level::VERBOSE);
Log.setServiceTemplate("\033[1m[%s]\033[22m"); Log.setServiceTemplate("\033[1m[%s]\033[22m");
Log.setLevelTemplate("\033[1m[%s]\033[22m"); Log.setLevelTemplate("\033[1m[%s]\033[22m");
Log.setMsgPrefix("\033[m "); Log.setMsgPrefix("\033[m ");
@@ -76,7 +79,7 @@ void setup() {
#if ARDUINO_USB_MODE #if ARDUINO_USB_MODE
Serial.setTxBufferSize(512); Serial.setTxBufferSize(512);
#endif #endif
Log.addHandler(&Serial); Log.addStream(&Serial);
Log.print("\n\n\r"); Log.print("\n\n\r");
// //
@@ -160,24 +163,24 @@ void setup() {
// Logs settings // Logs settings
if (!settings.system.serial.enabled) { if (!settings.system.serial.enabled) {
Serial.end(); Serial.end();
Log.clearHandlers(); Log.clearStreams();
} else if (settings.system.serial.baudrate != 115200) { } else if (settings.system.serial.baudrate != 115200) {
Serial.end(); Serial.end();
Log.clearHandlers(); Log.clearStreams();
Serial.begin(settings.system.serial.baudrate); Serial.begin(settings.system.serial.baudrate);
Log.addHandler(&Serial); Log.addStream(&Serial);
} }
if (settings.system.webSerial.enabled) { if (settings.system.telnet.enabled) {
webSerial = new WebSerial(); telnetStream = new ESPTelnetStream;
webSerial->setBuffer(100); telnetStream->setKeepAliveInterval(500);
Log.addHandler(webSerial); Log.addStream(telnetStream);
} }
if (settings.system.logLevel >= TinyLoggerLevel::SILENT && settings.system.logLevel <= TinyLoggerLevel::VERBOSE) { if (settings.system.logLevel >= TinyLogger::Level::SILENT && settings.system.logLevel <= TinyLogger::Level::VERBOSE) {
Log.setLevel(static_cast<TinyLoggerLevel>(settings.system.logLevel)); Log.setLevel(static_cast<TinyLogger::Level>(settings.system.logLevel));
} }
// //
@@ -213,7 +216,7 @@ void setup() {
tRegulator = new RegulatorTask(true, 10000); tRegulator = new RegulatorTask(true, 10000);
Scheduler.start(tRegulator); Scheduler.start(tRegulator);
tPortal = new PortalTask(true, 10); tPortal = new PortalTask(true, 0);
Scheduler.start(tPortal); Scheduler.start(tPortal);
tMain = new MainTask(true, 100); tMain = new MainTask(true, 100);

View File

@@ -24,7 +24,6 @@ const char L_OT_CH2[] PROGMEM = "OT.CH2";
const char L_SENSORS[] PROGMEM = "SENSORS"; const char L_SENSORS[] PROGMEM = "SENSORS";
const char L_SENSORS_SETTINGS[] PROGMEM = "SENSORS.SETTINGS"; const char L_SENSORS_SETTINGS[] PROGMEM = "SENSORS.SETTINGS";
const char L_SENSORS_DALLAS[] PROGMEM = "SENSORS.DALLAS"; const char L_SENSORS_DALLAS[] PROGMEM = "SENSORS.DALLAS";
const char L_SENSORS_DHT[] PROGMEM = "SENSORS.DHT";
const char L_SENSORS_NTC[] PROGMEM = "SENSORS.NTC"; const char L_SENSORS_NTC[] PROGMEM = "SENSORS.NTC";
const char L_SENSORS_BLE[] PROGMEM = "SENSORS.BLE"; const char L_SENSORS_BLE[] PROGMEM = "SENSORS.BLE";
const char L_REGULATOR[] PROGMEM = "REGULATOR"; const char L_REGULATOR[] PROGMEM = "REGULATOR";
@@ -35,7 +34,6 @@ const char L_CASCADE_OUTPUT[] PROGMEM = "CASCADE.OUTPUT";
const char L_EXTPUMP[] PROGMEM = "EXTPUMP"; const char L_EXTPUMP[] PROGMEM = "EXTPUMP";
const char S_ACTION[] PROGMEM = "action";
const char S_ACTIONS[] PROGMEM = "actions"; const char S_ACTIONS[] PROGMEM = "actions";
const char S_ACTIVE[] PROGMEM = "active"; const char S_ACTIVE[] PROGMEM = "active";
const char S_ADDRESS[] PROGMEM = "address"; const char S_ADDRESS[] PROGMEM = "address";
@@ -57,7 +55,6 @@ const char S_CHANNEL[] PROGMEM = "channel";
const char S_CH2_ALWAYS_ENABLED[] PROGMEM = "ch2AlwaysEnabled"; const char S_CH2_ALWAYS_ENABLED[] PROGMEM = "ch2AlwaysEnabled";
const char S_CHIP[] PROGMEM = "chip"; const char S_CHIP[] PROGMEM = "chip";
const char S_CODE[] PROGMEM = "code"; const char S_CODE[] PROGMEM = "code";
const char S_COMMIT[] PROGMEM = "commit";
const char S_CONNECTED[] PROGMEM = "connected"; const char S_CONNECTED[] PROGMEM = "connected";
const char S_CONTINUES[] PROGMEM = "continues"; const char S_CONTINUES[] PROGMEM = "continues";
const char S_COOLING[] PROGMEM = "cooling"; const char S_COOLING[] PROGMEM = "cooling";
@@ -112,7 +109,6 @@ const char S_HYSTERESIS[] PROGMEM = "hysteresis";
const char S_ID[] PROGMEM = "id"; const char S_ID[] PROGMEM = "id";
const char S_IGNORE_DIAG_STATE[] PROGMEM = "ignoreDiagState"; const char S_IGNORE_DIAG_STATE[] PROGMEM = "ignoreDiagState";
const char S_IMMERGAS_FIX[] PROGMEM = "immergasFix"; const char S_IMMERGAS_FIX[] PROGMEM = "immergasFix";
const char S_ALWAYS_SEND_INDOOR_TEMP[] PROGMEM = "alwaysSendIndoorTemp";
const char S_INDOOR_TEMP[] PROGMEM = "indoorTemp"; const char S_INDOOR_TEMP[] PROGMEM = "indoorTemp";
const char S_INDOOR_TEMP_CONTROL[] PROGMEM = "indoorTempControl"; const char S_INDOOR_TEMP_CONTROL[] PROGMEM = "indoorTempControl";
const char S_IN_GPIO[] PROGMEM = "inGpio"; const char S_IN_GPIO[] PROGMEM = "inGpio";
@@ -144,7 +140,7 @@ const char S_MODEL[] PROGMEM = "model";
const char S_MODULATION[] PROGMEM = "modulation"; const char S_MODULATION[] PROGMEM = "modulation";
const char S_MQTT[] PROGMEM = "mqtt"; const char S_MQTT[] PROGMEM = "mqtt";
const char S_NAME[] PROGMEM = "name"; const char S_NAME[] PROGMEM = "name";
const char S_NATIVE_OTC[] PROGMEM = "nativeOTC"; const char S_NATIVE_HEATING_CONTROL[] PROGMEM = "nativeHeatingControl";
const char S_NETWORK[] PROGMEM = "network"; const char S_NETWORK[] PROGMEM = "network";
const char S_NTP[] PROGMEM = "ntp"; const char S_NTP[] PROGMEM = "ntp";
const char S_OFFSET[] PROGMEM = "offset"; const char S_OFFSET[] PROGMEM = "offset";
@@ -167,7 +163,6 @@ const char S_POWER[] PROGMEM = "power";
const char S_PREFIX[] PROGMEM = "prefix"; const char S_PREFIX[] PROGMEM = "prefix";
const char S_PROTOCOL_VERSION[] PROGMEM = "protocolVersion"; const char S_PROTOCOL_VERSION[] PROGMEM = "protocolVersion";
const char S_PURPOSE[] PROGMEM = "purpose"; const char S_PURPOSE[] PROGMEM = "purpose";
const char S_PSRAM[] PROGMEM = "psram";
const char S_P_FACTOR[] PROGMEM = "p_factor"; const char S_P_FACTOR[] PROGMEM = "p_factor";
const char S_P_MULTIPLIER[] PROGMEM = "p_multiplier"; const char S_P_MULTIPLIER[] PROGMEM = "p_multiplier";
const char S_REAL_SIZE[] PROGMEM = "realSize"; const char S_REAL_SIZE[] PROGMEM = "realSize";
@@ -204,6 +199,7 @@ const char S_SYSTEM[] PROGMEM = "system";
const char S_TARGET[] PROGMEM = "target"; const char S_TARGET[] PROGMEM = "target";
const char S_TARGET_DIFF_FACTOR[] PROGMEM = "targetDiffFactor"; const char S_TARGET_DIFF_FACTOR[] PROGMEM = "targetDiffFactor";
const char S_TARGET_TEMP[] PROGMEM = "targetTemp"; const char S_TARGET_TEMP[] PROGMEM = "targetTemp";
const char S_TELNET[] PROGMEM = "telnet";
const char S_TEMPERATURE[] PROGMEM = "temperature"; const char S_TEMPERATURE[] PROGMEM = "temperature";
const char S_THRESHOLD_HIGH[] PROGMEM = "thresholdHigh"; const char S_THRESHOLD_HIGH[] PROGMEM = "thresholdHigh";
const char S_THRESHOLD_LOW[] PROGMEM = "thresholdLow"; const char S_THRESHOLD_LOW[] PROGMEM = "thresholdLow";
@@ -221,4 +217,3 @@ const char S_USE_DHCP[] PROGMEM = "useDhcp";
const char S_USER[] PROGMEM = "user"; const char S_USER[] PROGMEM = "user";
const char S_VALUE[] PROGMEM = "value"; const char S_VALUE[] PROGMEM = "value";
const char S_VERSION[] PROGMEM = "version"; const char S_VERSION[] PROGMEM = "version";
const char S_WEBSERIAL[] PROGMEM = "webSerial";

View File

@@ -425,8 +425,9 @@ void settingsToJson(const Settings& src, JsonVariant dst, bool safe = false) {
serial[FPSTR(S_ENABLED)] = src.system.serial.enabled; serial[FPSTR(S_ENABLED)] = src.system.serial.enabled;
serial[FPSTR(S_BAUDRATE)] = src.system.serial.baudrate; serial[FPSTR(S_BAUDRATE)] = src.system.serial.baudrate;
auto webSerial = system[FPSTR(S_WEBSERIAL)].to<JsonObject>(); auto telnet = system[FPSTR(S_TELNET)].to<JsonObject>();
webSerial[FPSTR(S_ENABLED)] = src.system.webSerial.enabled; telnet[FPSTR(S_ENABLED)] = src.system.telnet.enabled;
telnet[FPSTR(S_PORT)] = src.system.telnet.port;
auto ntp = system[FPSTR(S_NTP)].to<JsonObject>(); auto ntp = system[FPSTR(S_NTP)].to<JsonObject>();
ntp[FPSTR(S_SERVER)] = src.system.ntp.server; ntp[FPSTR(S_SERVER)] = src.system.ntp.server;
@@ -467,11 +468,9 @@ void settingsToJson(const Settings& src, JsonVariant dst, bool safe = false) {
otOptions[FPSTR(S_AUTO_FAULT_RESET)] = src.opentherm.options.autoFaultReset; otOptions[FPSTR(S_AUTO_FAULT_RESET)] = src.opentherm.options.autoFaultReset;
otOptions[FPSTR(S_AUTO_DIAG_RESET)] = src.opentherm.options.autoDiagReset; otOptions[FPSTR(S_AUTO_DIAG_RESET)] = src.opentherm.options.autoDiagReset;
otOptions[FPSTR(S_SET_DATE_AND_TIME)] = src.opentherm.options.setDateAndTime; otOptions[FPSTR(S_SET_DATE_AND_TIME)] = src.opentherm.options.setDateAndTime;
otOptions[FPSTR(S_ALWAYS_SEND_INDOOR_TEMP)] = src.opentherm.options.alwaysSendIndoorTemp; otOptions[FPSTR(S_NATIVE_HEATING_CONTROL)] = src.opentherm.options.nativeHeatingControl;
otOptions[FPSTR(S_NATIVE_OTC)] = src.opentherm.options.nativeOTC;
otOptions[FPSTR(S_IMMERGAS_FIX)] = src.opentherm.options.immergasFix; otOptions[FPSTR(S_IMMERGAS_FIX)] = src.opentherm.options.immergasFix;
auto mqtt = dst[FPSTR(S_MQTT)].to<JsonObject>(); auto mqtt = dst[FPSTR(S_MQTT)].to<JsonObject>();
mqtt[FPSTR(S_ENABLED)] = src.mqtt.enabled; mqtt[FPSTR(S_ENABLED)] = src.mqtt.enabled;
mqtt[FPSTR(S_SERVER)] = src.mqtt.server; mqtt[FPSTR(S_SERVER)] = src.mqtt.server;
@@ -491,9 +490,7 @@ void settingsToJson(const Settings& src, JsonVariant dst, bool safe = false) {
heating[FPSTR(S_ENABLED)] = src.heating.enabled; heating[FPSTR(S_ENABLED)] = src.heating.enabled;
heating[FPSTR(S_TURBO)] = src.heating.turbo; heating[FPSTR(S_TURBO)] = src.heating.turbo;
heating[FPSTR(S_TARGET)] = roundf(src.heating.target, 2); heating[FPSTR(S_TARGET)] = roundf(src.heating.target, 2);
heating[FPSTR(S_HYSTERESIS)][FPSTR(S_ENABLED)] = src.heating.hysteresis.enabled; heating[FPSTR(S_HYSTERESIS)] = roundf(src.heating.hysteresis, 3);
heating[FPSTR(S_HYSTERESIS)][FPSTR(S_VALUE)] = roundf(src.heating.hysteresis.value, 3);
heating[FPSTR(S_HYSTERESIS)][FPSTR(S_ACTION)] = static_cast<uint8_t>(src.heating.hysteresis.action);
heating[FPSTR(S_TURBO_FACTOR)] = roundf(src.heating.turboFactor, 3); heating[FPSTR(S_TURBO_FACTOR)] = roundf(src.heating.turboFactor, 3);
heating[FPSTR(S_MIN_TEMP)] = src.heating.minTemp; heating[FPSTR(S_MIN_TEMP)] = src.heating.minTemp;
heating[FPSTR(S_MAX_TEMP)] = src.heating.maxTemp; heating[FPSTR(S_MAX_TEMP)] = src.heating.maxTemp;
@@ -580,7 +577,7 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
if (!src[FPSTR(S_SYSTEM)][FPSTR(S_LOG_LEVEL)].isNull()) { if (!src[FPSTR(S_SYSTEM)][FPSTR(S_LOG_LEVEL)].isNull()) {
uint8_t value = src[FPSTR(S_SYSTEM)][FPSTR(S_LOG_LEVEL)].as<uint8_t>(); uint8_t value = src[FPSTR(S_SYSTEM)][FPSTR(S_LOG_LEVEL)].as<uint8_t>();
if (value != dst.system.logLevel && value >= TinyLoggerLevel::SILENT && value <= TinyLoggerLevel::VERBOSE) { if (value != dst.system.logLevel && value >= TinyLogger::Level::SILENT && value <= TinyLogger::Level::VERBOSE) {
dst.system.logLevel = value; dst.system.logLevel = value;
changed = true; changed = true;
} }
@@ -606,11 +603,20 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
} }
} }
if (src[FPSTR(S_SYSTEM)][FPSTR(S_WEBSERIAL)][FPSTR(S_ENABLED)].is<bool>()) { if (src[FPSTR(S_SYSTEM)][FPSTR(S_TELNET)][FPSTR(S_ENABLED)].is<bool>()) {
bool value = src[FPSTR(S_SYSTEM)][FPSTR(S_WEBSERIAL)][FPSTR(S_ENABLED)].as<bool>(); bool value = src[FPSTR(S_SYSTEM)][FPSTR(S_TELNET)][FPSTR(S_ENABLED)].as<bool>();
if (value != dst.system.webSerial.enabled) { if (value != dst.system.telnet.enabled) {
dst.system.webSerial.enabled = value; dst.system.telnet.enabled = value;
changed = true;
}
}
if (!src[FPSTR(S_SYSTEM)][FPSTR(S_TELNET)][FPSTR(S_PORT)].isNull()) {
unsigned short value = src[FPSTR(S_SYSTEM)][FPSTR(S_TELNET)][FPSTR(S_PORT)].as<unsigned short>();
if (value > 0 && value <= 65535 && value != dst.system.telnet.port) {
dst.system.telnet.port = value;
changed = true; changed = true;
} }
} }
@@ -995,20 +1001,11 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
} }
} }
if (src[FPSTR(S_OPENTHERM)][FPSTR(S_OPTIONS)][FPSTR(S_ALWAYS_SEND_INDOOR_TEMP)].is<bool>()) { if (src[FPSTR(S_OPENTHERM)][FPSTR(S_OPTIONS)][FPSTR(S_NATIVE_HEATING_CONTROL)].is<bool>()) {
bool value = src[FPSTR(S_OPENTHERM)][FPSTR(S_OPTIONS)][FPSTR(S_ALWAYS_SEND_INDOOR_TEMP)].as<bool>(); bool value = src[FPSTR(S_OPENTHERM)][FPSTR(S_OPTIONS)][FPSTR(S_NATIVE_HEATING_CONTROL)].as<bool>();
if (value != dst.opentherm.options.alwaysSendIndoorTemp) { if (value != dst.opentherm.options.nativeHeatingControl) {
dst.opentherm.options.alwaysSendIndoorTemp = value; dst.opentherm.options.nativeHeatingControl = value;
changed = true;
}
}
if (src[FPSTR(S_OPENTHERM)][FPSTR(S_OPTIONS)][FPSTR(S_NATIVE_OTC)].is<bool>()) {
bool value = src[FPSTR(S_OPENTHERM)][FPSTR(S_OPTIONS)][FPSTR(S_NATIVE_OTC)].as<bool>();
if (value != dst.opentherm.options.nativeOTC) {
dst.opentherm.options.nativeOTC = value;
if (value) { if (value) {
dst.equitherm.enabled = false; dst.equitherm.enabled = false;
@@ -1028,6 +1025,7 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
} }
} }
// mqtt // mqtt
if (src[FPSTR(S_MQTT)][FPSTR(S_ENABLED)].is<bool>()) { if (src[FPSTR(S_MQTT)][FPSTR(S_ENABLED)].is<bool>()) {
bool value = src[FPSTR(S_MQTT)][FPSTR(S_ENABLED)].as<bool>(); bool value = src[FPSTR(S_MQTT)][FPSTR(S_ENABLED)].as<bool>();
@@ -1118,7 +1116,7 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
if (src[FPSTR(S_EQUITHERM)][FPSTR(S_ENABLED)].is<bool>()) { if (src[FPSTR(S_EQUITHERM)][FPSTR(S_ENABLED)].is<bool>()) {
bool value = src[FPSTR(S_EQUITHERM)][FPSTR(S_ENABLED)].as<bool>(); bool value = src[FPSTR(S_EQUITHERM)][FPSTR(S_ENABLED)].as<bool>();
if (!dst.opentherm.options.nativeOTC) { if (!dst.opentherm.options.nativeHeatingControl) {
if (value != dst.equitherm.enabled) { if (value != dst.equitherm.enabled) {
dst.equitherm.enabled = value; dst.equitherm.enabled = value;
changed = true; changed = true;
@@ -1171,7 +1169,7 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
if (src[FPSTR(S_PID)][FPSTR(S_ENABLED)].is<bool>()) { if (src[FPSTR(S_PID)][FPSTR(S_ENABLED)].is<bool>()) {
bool value = src[FPSTR(S_PID)][FPSTR(S_ENABLED)].as<bool>(); bool value = src[FPSTR(S_PID)][FPSTR(S_ENABLED)].as<bool>();
if (!dst.opentherm.options.nativeOTC) { if (!dst.opentherm.options.nativeHeatingControl) {
if (value != dst.pid.enabled) { if (value != dst.pid.enabled) {
dst.pid.enabled = value; dst.pid.enabled = value;
changed = true; changed = true;
@@ -1316,41 +1314,15 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
} }
} }
if (src[FPSTR(S_HEATING)][FPSTR(S_HYSTERESIS)][FPSTR(S_ENABLED)].is<bool>()) { if (!src[FPSTR(S_HEATING)][FPSTR(S_HYSTERESIS)].isNull()) {
bool value = src[FPSTR(S_HEATING)][FPSTR(S_HYSTERESIS)][FPSTR(S_ENABLED)].as<bool>(); float value = src[FPSTR(S_HEATING)][FPSTR(S_HYSTERESIS)].as<float>();
if (value != dst.heating.hysteresis.enabled) { if (value >= 0.0f && value <= 15.0f && fabsf(value - dst.heating.hysteresis) > 0.0001f) {
dst.heating.hysteresis.enabled = value; dst.heating.hysteresis = roundf(value, 2);
changed = true; changed = true;
} }
} }
if (!src[FPSTR(S_HEATING)][FPSTR(S_HYSTERESIS)][FPSTR(S_VALUE)].isNull()) {
float value = src[FPSTR(S_HEATING)][FPSTR(S_HYSTERESIS)][FPSTR(S_VALUE)].as<float>();
if (value >= 0.0f && value <= 15.0f && fabsf(value - dst.heating.hysteresis.value) > 0.0001f) {
dst.heating.hysteresis.value = roundf(value, 2);
changed = true;
}
}
if (!src[FPSTR(S_HEATING)][FPSTR(S_HYSTERESIS)][FPSTR(S_ACTION)].isNull()) {
uint8_t value = src[FPSTR(S_HEATING)][FPSTR(S_HYSTERESIS)][FPSTR(S_ACTION)].as<uint8_t>();
switch (value) {
case static_cast<uint8_t>(HysteresisAction::DISABLE_HEATING):
case static_cast<uint8_t>(HysteresisAction::SET_ZERO_TARGET):
if (static_cast<uint8_t>(dst.heating.hysteresis.action) != value) {
dst.heating.hysteresis.action = static_cast<HysteresisAction>(value);
changed = true;
}
break;
default:
break;
}
}
if (!src[FPSTR(S_HEATING)][FPSTR(S_TURBO_FACTOR)].isNull()) { if (!src[FPSTR(S_HEATING)][FPSTR(S_TURBO_FACTOR)].isNull()) {
float value = src[FPSTR(S_HEATING)][FPSTR(S_TURBO_FACTOR)].as<float>(); float value = src[FPSTR(S_HEATING)][FPSTR(S_TURBO_FACTOR)].as<float>();
@@ -1704,7 +1676,7 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
// force check emergency target // force check emergency target
{ {
float value = !src[FPSTR(S_EMERGENCY)][FPSTR(S_TARGET)].isNull() ? src[FPSTR(S_EMERGENCY)][FPSTR(S_TARGET)].as<float>() : dst.emergency.target; float value = !src[FPSTR(S_EMERGENCY)][FPSTR(S_TARGET)].isNull() ? src[FPSTR(S_EMERGENCY)][FPSTR(S_TARGET)].as<float>() : dst.emergency.target;
bool noRegulators = !dst.opentherm.options.nativeOTC; bool noRegulators = !dst.opentherm.options.nativeHeatingControl;
bool valid = isValidTemp( bool valid = isValidTemp(
value, value,
dst.system.unitSystem, dst.system.unitSystem,
@@ -1729,7 +1701,7 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
// force check heating target // force check heating target
{ {
bool indoorTempControl = dst.equitherm.enabled || dst.pid.enabled || dst.opentherm.options.nativeOTC; bool indoorTempControl = dst.equitherm.enabled || dst.pid.enabled || dst.opentherm.options.nativeHeatingControl;
float minTemp = indoorTempControl ? THERMOSTAT_INDOOR_MIN_TEMP : dst.heating.minTemp; float minTemp = indoorTempControl ? THERMOSTAT_INDOOR_MIN_TEMP : dst.heating.minTemp;
float maxTemp = indoorTempControl ? THERMOSTAT_INDOOR_MAX_TEMP : dst.heating.maxTemp; float maxTemp = indoorTempControl ? THERMOSTAT_INDOOR_MAX_TEMP : dst.heating.maxTemp;
@@ -1922,13 +1894,10 @@ bool jsonToSensorSettings(const uint8_t sensorId, const JsonVariantConst src, Se
case static_cast<uint8_t>(Sensors::Type::OT_DHW_BURNER_HOURS): case static_cast<uint8_t>(Sensors::Type::OT_DHW_BURNER_HOURS):
case static_cast<uint8_t>(Sensors::Type::OT_HEATING_PUMP_HOURS): case static_cast<uint8_t>(Sensors::Type::OT_HEATING_PUMP_HOURS):
case static_cast<uint8_t>(Sensors::Type::OT_DHW_PUMP_HOURS): case static_cast<uint8_t>(Sensors::Type::OT_DHW_PUMP_HOURS):
case static_cast<uint8_t>(Sensors::Type::OT_COOLING_HOURS):
case static_cast<uint8_t>(Sensors::Type::NTC_10K_TEMP): case static_cast<uint8_t>(Sensors::Type::NTC_10K_TEMP):
case static_cast<uint8_t>(Sensors::Type::DALLAS_TEMP): case static_cast<uint8_t>(Sensors::Type::DALLAS_TEMP):
case static_cast<uint8_t>(Sensors::Type::BLUETOOTH): case static_cast<uint8_t>(Sensors::Type::BLUETOOTH):
case static_cast<uint8_t>(Sensors::Type::DHT11):
case static_cast<uint8_t>(Sensors::Type::DHT22):
case static_cast<uint8_t>(Sensors::Type::HEATING_SETPOINT_TEMP): case static_cast<uint8_t>(Sensors::Type::HEATING_SETPOINT_TEMP):
case static_cast<uint8_t>(Sensors::Type::MANUAL): case static_cast<uint8_t>(Sensors::Type::MANUAL):
case static_cast<uint8_t>(Sensors::Type::NOT_CONFIGURED): case static_cast<uint8_t>(Sensors::Type::NOT_CONFIGURED):
@@ -1945,8 +1914,7 @@ bool jsonToSensorSettings(const uint8_t sensorId, const JsonVariantConst src, Se
// gpio // gpio
if (!src[FPSTR(S_GPIO)].isNull()) { if (!src[FPSTR(S_GPIO)].isNull()) {
if (dst.type != Sensors::Type::DALLAS_TEMP && dst.type != Sensors::Type::NTC_10K_TEMP && if (dst.type != Sensors::Type::DALLAS_TEMP && dst.type != Sensors::Type::NTC_10K_TEMP) {
dst.type != Sensors::Type::DHT11 && dst.type != Sensors::Type::DHT22) {
if (dst.gpio != GPIO_IS_NOT_CONFIGURED) { if (dst.gpio != GPIO_IS_NOT_CONFIGURED) {
dst.gpio = GPIO_IS_NOT_CONFIGURED; dst.gpio = GPIO_IS_NOT_CONFIGURED;
changed = true; changed = true;
@@ -2087,10 +2055,6 @@ void sensorResultToJson(const uint8_t sensorId, JsonVariant dst) {
dst[FPSTR(S_BATTERY)] = roundf(rSensor.values[static_cast<uint8_t>(Sensors::ValueType::BATTERY)], 1); dst[FPSTR(S_BATTERY)] = roundf(rSensor.values[static_cast<uint8_t>(Sensors::ValueType::BATTERY)], 1);
dst[FPSTR(S_RSSI)] = roundf(rSensor.values[static_cast<uint8_t>(Sensors::ValueType::RSSI)], 0); dst[FPSTR(S_RSSI)] = roundf(rSensor.values[static_cast<uint8_t>(Sensors::ValueType::RSSI)], 0);
} else if (sSensor.type == Sensors::Type::DHT11 || sSensor.type == Sensors::Type::DHT22) {
dst[FPSTR(S_TEMPERATURE)] = roundf(rSensor.values[static_cast<uint8_t>(Sensors::ValueType::TEMPERATURE)], 3);
dst[FPSTR(S_HUMIDITY)] = roundf(rSensor.values[static_cast<uint8_t>(Sensors::ValueType::HUMIDITY)], 3);
} else { } else {
dst[FPSTR(S_VALUE)] = roundf(rSensor.values[static_cast<uint8_t>(Sensors::ValueType::PRIMARY)], 3); dst[FPSTR(S_VALUE)] = roundf(rSensor.values[static_cast<uint8_t>(Sensors::ValueType::PRIMARY)], 3);
} }
@@ -2106,18 +2070,21 @@ bool jsonToSensorResult(const uint8_t sensorId, const JsonVariantConst src) {
return false; return false;
} }
auto& dst = Sensors::results[sensorId];
bool changed = false;
// value // value
if (!src[FPSTR(S_VALUE)].isNull()) { if (!src[FPSTR(S_VALUE)].isNull()) {
return Sensors::setValueById( float value = src[FPSTR(S_VALUE)].as<float>();
sensorId,
src[FPSTR(S_VALUE)].as<float>(), uint8_t vType = static_cast<uint8_t>(Sensors::ValueType::PRIMARY);
Sensors::ValueType::PRIMARY, if (fabsf(value - dst.values[vType]) > 0.0001f) {
true, dst.values[vType] = roundf(value, 2);
true changed = true;
); }
} }
return false; return changed;
} }
void varsToJson(const Variables& src, JsonVariant dst) { void varsToJson(const Variables& src, JsonVariant dst) {
@@ -2126,7 +2093,7 @@ void varsToJson(const Variables& src, JsonVariant dst) {
slave[FPSTR(S_FLAGS)] = src.slave.flags; slave[FPSTR(S_FLAGS)] = src.slave.flags;
slave[FPSTR(S_TYPE)] = src.slave.type; slave[FPSTR(S_TYPE)] = src.slave.type;
slave[FPSTR(S_APP_VERSION)] = src.slave.appVersion; slave[FPSTR(S_APP_VERSION)] = src.slave.appVersion;
slave[FPSTR(S_PROTOCOL_VERSION)] = src.slave.protocolVersion; slave[FPSTR(S_PROTOCOL_VERSION)] = src.slave.appVersion;
slave[FPSTR(S_CONNECTED)] = src.slave.connected; slave[FPSTR(S_CONNECTED)] = src.slave.connected;
slave[FPSTR(S_FLAME)] = src.slave.flame; slave[FPSTR(S_FLAME)] = src.slave.flame;

View File

@@ -44,7 +44,6 @@
"build": { "build": {
"title": "Build", "title": "Build",
"version": "固件版本", "version": "固件版本",
"commit": "Commit",
"date": "日期", "date": "日期",
"core": "内核版本", "core": "内核版本",
"sdk": "SDK" "sdk": "SDK"
@@ -244,13 +243,10 @@
"otDhwBurnerHours": "OpenTherm, number of burner operating hours (DHW)", "otDhwBurnerHours": "OpenTherm, number of burner operating hours (DHW)",
"otHeatingPumpHours": "OpenTherm, number of pump operating hours (heating)", "otHeatingPumpHours": "OpenTherm, number of pump operating hours (heating)",
"otDhwPumpHours": "OpenTherm, number of pump operating hours (DHW)", "otDhwPumpHours": "OpenTherm, number of pump operating hours (DHW)",
"otCoolingHours": "OpenTherm, number of cooling hours",
"ntcTemp": "NTC 传感器", "ntcTemp": "NTC 传感器",
"dallasTemp": "DALLAS 传感器", "dallasTemp": "DALLAS 传感器",
"bluetooth": "BLE 传感器", "bluetooth": "BLE 传感器",
"dht11": "DHT11 传感器",
"dht22": "DHT22 传感器",
"heatSetpointTemp": "Heating, setpoint temp", "heatSetpointTemp": "Heating, setpoint temp",
"manual": "通过 MQTT/API 手动配置", "manual": "通过 MQTT/API 手动配置",
"notConfigured": "未配置" "notConfigured": "未配置"
@@ -345,8 +341,12 @@
"enable": "启用串口", "enable": "启用串口",
"baud": "串口波特率" "baud": "串口波特率"
}, },
"webSerial": { "telnet": {
"enable": "启用 WebSerial" "enable": "启用 Telnet",
"port": {
"title": "Telnet 端口",
"note": "默认值23"
}
}, },
"ntp": { "ntp": {
"server": "NTP服务器", "server": "NTP服务器",
@@ -356,16 +356,7 @@
}, },
"heating": { "heating": {
"hyst": { "hyst": "滞后值<small>(单位:度)</small>",
"title": "滞回",
"desc": "滞回有助于维持设定的室内温度在使用«Equitherm»和/或«PID»时。强制禁用加热当<code>current indoor > target + value</code>,启用加热当<code>current indoor < (target - value)</code>。",
"value": "值 <small>(以度为单位)</small>",
"action": {
"title": "行动",
"disableHeating": "禁用加热",
"set0target": "设置空目标"
}
},
"turboFactor": "Turbo 模式系数" "turboFactor": "Turbo 模式系数"
}, },
@@ -380,26 +371,11 @@
}, },
"equitherm": { "equitherm": {
"slope": { "n": "N 系数",
"title": "斜率", "k": "K 系数",
"note": "热损失补偿。主要调谐参数。" "t": {
}, "title": "T 系数",
"exponent": { "note": "启用PID时此参数无效"
"title": "指数",
"note": "散热器效率。典型值:<code>1.1</code> - 地板采暖,<code>1.2</code> - 铸铁,<code>1.3</code> - 面板散热器,<code>1.4</code> - 对流器。"
},
"shift": {
"title": "偏移",
"note": "补偿额外热损失(例如,在管道中)或额外热源。"
},
"targetDiffFactor": {
"title": "T 因子",
"note": "如果启用 PID则不使用。将目标和当前室内温度之间的差值添加到设定点<code>setpoint = setpoint + ((target - indoor) * T)</code>。"
},
"chart": {
"targetTemp": "目标室内温度",
"setpointTemp": "热载体温度",
"outdoorTemp": "室外温度"
} }
}, },
@@ -457,13 +433,12 @@
"autoFaultReset": "自动报警复位 <small>(不推荐!)</small>", "autoFaultReset": "自动报警复位 <small>(不推荐!)</small>",
"autoDiagReset": "自动诊断复位 <small>(不推荐!)</small>", "autoDiagReset": "自动诊断复位 <small>(不推荐!)</small>",
"setDateAndTime": "同步设置锅炉日期与时间", "setDateAndTime": "同步设置锅炉日期与时间",
"immergasFix": "针对Immergas锅炉的兼容性修复", "immergasFix": "针对Immergas锅炉的兼容性修复"
"alwaysSendIndoorTemp": "向锅炉发送当前室内温度"
}, },
"nativeOTC": { "nativeHeating": {
"title": "原生热载体温度计算模式", "title": "原生锅炉供暖控制",
"note": "仅在锅炉处于 OTC 模式时<u>才</u>工作:需要并接受目标室内温度,并基于内置曲线模式自行调节热载体温度。与 PID 和 Equitherm 不兼容。" "note": "<u>注意:</u> 仅适用于锅炉需接收目标室温并自主调节载热介质温度的场景与固件中的PID及Equithermq气候补偿功能不兼容。"
} }
}, },

View File

@@ -44,7 +44,6 @@
"build": { "build": {
"title": "Build", "title": "Build",
"version": "Version", "version": "Version",
"commit": "Commit",
"date": "Date", "date": "Date",
"core": "Core", "core": "Core",
"sdk": "SDK" "sdk": "SDK"
@@ -244,13 +243,10 @@
"otDhwBurnerHours": "OpenTherm, number of burner operating hours (DHW)", "otDhwBurnerHours": "OpenTherm, number of burner operating hours (DHW)",
"otHeatingPumpHours": "OpenTherm, number of pump operating hours (heating)", "otHeatingPumpHours": "OpenTherm, number of pump operating hours (heating)",
"otDhwPumpHours": "OpenTherm, number of pump operating hours (DHW)", "otDhwPumpHours": "OpenTherm, number of pump operating hours (DHW)",
"otCoolingHours": "OpenTherm, number of cooling hours",
"ntcTemp": "NTC sensor", "ntcTemp": "NTC sensor",
"dallasTemp": "DALLAS sensor", "dallasTemp": "DALLAS sensor",
"bluetooth": "BLE sensor", "bluetooth": "BLE sensor",
"dht11": "DHT11 sensor",
"dht22": "DHT22 sensor",
"heatSetpointTemp": "Heating, setpoint temp", "heatSetpointTemp": "Heating, setpoint temp",
"manual": "Manual via MQTT/API", "manual": "Manual via MQTT/API",
"notConfigured": "Not configured" "notConfigured": "Not configured"
@@ -345,8 +341,12 @@
"enable": "Enabled Serial port", "enable": "Enabled Serial port",
"baud": "Serial port baud rate" "baud": "Serial port baud rate"
}, },
"webSerial": { "telnet": {
"enable": "Enabled WebSerial" "enable": "Enabled Telnet",
"port": {
"title": "Telnet port",
"note": "Default: 23"
}
}, },
"ntp": { "ntp": {
"server": "NTP server", "server": "NTP server",
@@ -356,16 +356,7 @@
}, },
"heating": { "heating": {
"hyst": { "hyst": "Hysteresis <small>(in degrees)</small>",
"title": "Hysteresis",
"desc": "Hysteresis is useful for maintaining a set indoor temp (when using «Equitherm» and/or «PID»). Forces disable heating when <code>current indoor > target + value</code> and enable heating when <code>current indoor < (target - value)</code>.",
"value": "Value <small>(in degrees)</small>",
"action": {
"title": "Action",
"disableHeating": "Disable heating",
"set0target": "Set null target"
}
},
"turboFactor": "Turbo mode coeff." "turboFactor": "Turbo mode coeff."
}, },
@@ -457,13 +448,12 @@
"autoFaultReset": "Auto fault reset <small>(not recommended!)</small>", "autoFaultReset": "Auto fault reset <small>(not recommended!)</small>",
"autoDiagReset": "Auto diag reset <small>(not recommended!)</small>", "autoDiagReset": "Auto diag reset <small>(not recommended!)</small>",
"setDateAndTime": "Set date & time on boiler", "setDateAndTime": "Set date & time on boiler",
"immergasFix": "Fix for Immergas boilers", "immergasFix": "Fix for Immergas boilers"
"alwaysSendIndoorTemp": "Send current indoor temp to boiler"
}, },
"nativeOTC": { "nativeHeating": {
"title": "Native OTC mode", "title": "Native heating control (boiler)",
"note": "Works <u>ONLY</u> if the boiler is in OTC mode: requires and accepts the target indoor temperature and self-regulates the heat carrier temperature based on the built-in curves mode. Incompatible with PID and Equitherm." "note": "Works <u>ONLY</u> if the boiler requires the desired room temperature and regulates the temperature of the coolant itself. Not compatible with PID and Equitherm regulators in firmware."
} }
}, },

View File

@@ -44,7 +44,6 @@
"build": { "build": {
"title": "Build", "title": "Build",
"version": "Versione", "version": "Versione",
"commit": "Commit",
"date": "Data", "date": "Data",
"core": "Core", "core": "Core",
"sdk": "SDK" "sdk": "SDK"
@@ -244,13 +243,10 @@
"otDhwBurnerHours": "OpenTherm, numero di ore di funzionamento del bruciatore (ACS)", "otDhwBurnerHours": "OpenTherm, numero di ore di funzionamento del bruciatore (ACS)",
"otHeatingPumpHours": "OpenTherm, numero di ore di funzionamento della pompa (riscaldamento)", "otHeatingPumpHours": "OpenTherm, numero di ore di funzionamento della pompa (riscaldamento)",
"otDhwPumpHours": "OpenTherm, numero di ore di funzionamento della pompa (ACS)", "otDhwPumpHours": "OpenTherm, numero di ore di funzionamento della pompa (ACS)",
"otCoolingHours": "OpenTherm, numero di ore di funzionamento della cooling",
"ntcTemp": "Sensore NTC", "ntcTemp": "Sensore NTC",
"dallasTemp": "Sensore DALLAS", "dallasTemp": "Sensore DALLAS",
"bluetooth": "Sensore BLE", "bluetooth": "Sensore BLE",
"dht11": "Sensore DHT11",
"dht22": "Sensore DHT22",
"heatSetpointTemp": "Riscaldamento, temp impostata", "heatSetpointTemp": "Riscaldamento, temp impostata",
"manual": "Manuale via MQTT/API", "manual": "Manuale via MQTT/API",
"notConfigured": "Non configurato" "notConfigured": "Non configurato"
@@ -345,8 +341,12 @@
"enable": "Porta seriale attivata", "enable": "Porta seriale attivata",
"baud": "Porta seriale baud rate" "baud": "Porta seriale baud rate"
}, },
"webSerial": { "telnet": {
"enable": "WebSerial attivato" "enable": "Telnet attivato",
"port": {
"title": "Porta Telnet",
"note": "Default: 23"
}
}, },
"ntp": { "ntp": {
"server": "NTP server", "server": "NTP server",
@@ -356,16 +356,7 @@
}, },
"heating": { "heating": {
"hyst": { "hyst": "Isteresi <small>(in gradi)</small>",
"title": "Isteresi",
"desc": "L'isteresi è utile per mantenere una temperatura interna impostata (quando si utilizza «Equitherm» e/o «PID»). Forza la disabilitazione del riscaldamento quando <code>current indoor > target + value</code> e abilita il riscaldamento quando <code>current indoor < (target - value)</code>.",
"value": "Valore <small>(in gradi)</small>",
"action": {
"title": "Azione",
"disableHeating": "Disabilita riscaldamento",
"set0target": "Imposta target nullo"
}
},
"turboFactor": "Turbo mode coeff." "turboFactor": "Turbo mode coeff."
}, },
@@ -382,23 +373,23 @@
"equitherm": { "equitherm": {
"slope": { "slope": {
"title": "Pendenza", "title": "Pendenza",
"note": "Compensazione della perdita di calore. Parametro di regolazione principale." "note": "Compensazione delle perdite di calore. Principale parametro di regolazione."
}, },
"exponent": { "exponent": {
"title": "Esponente", "title": "Esponente",
"note": "Efficienza del radiatore. Valori tipici: <code>1.1</code> - Riscaldamento a pavimento, <code>1.2</code> - Ghisa, <code>1.3</code> - Radiatori a pannello, <code>1.4</code> - Convettori." "note": "Efficienza del radiatore. Valori tipici: <code>1.1</code> - Riscaldamento a pavimento, <code>1.2</code> - Radiatori in ghisa, <code>1.3</code> - Radiatori a pannelli, <code>1.4</code> - Convetttori."
}, },
"shift": { "shift": {
"title": "Spostamento", "title": "Spostare",
"note": "Compensa perdite di calore aggiuntive (ad es., nelle tubature) o fonti di calore extra." "note": "Compensa le perdite di calore aggiuntive (ad esempio, nelle tubature) o fonti di calore extra."
}, },
"targetDiffFactor": { "targetDiffFactor": {
"title": "Fattore T", "title": "Fattore T",
"note": "Non utilizzato se PID è abilitato. Aggiunge al setpoint la differenza tra la temperatura target e quella interna attuale: <code>setpoint = setpoint + ((target - indoor) * T)</code>." "note": "Non usato se PID è attivato. Aggiunge al setpoint la differenza tra la temperatura interna target e quella attuale: <code>setpoint = setpoint + ((target - indoor) * T)</code>."
}, },
"chart": { "chart": {
"targetTemp": "Temperatura interna target", "targetTemp": "Temperatura interna target",
"setpointTemp": "Temperatura del vettore termico", "setpointTemp": "Temperatura del portatore di calore",
"outdoorTemp": "Temperatura esterna" "outdoorTemp": "Temperatura esterna"
} }
}, },
@@ -457,13 +448,12 @@
"autoFaultReset": "Ripristino automatico degli errori <small>(sconsigliato!)</small>", "autoFaultReset": "Ripristino automatico degli errori <small>(sconsigliato!)</small>",
"autoDiagReset": "Ripristino diagnostico automatica <small>(sconsigliato!)</small>", "autoDiagReset": "Ripristino diagnostico automatica <small>(sconsigliato!)</small>",
"setDateAndTime": "Imposta data e ora sulla caldaia", "setDateAndTime": "Imposta data e ora sulla caldaia",
"immergasFix": "Fix per caldiaie Immergas", "immergasFix": "Fix per caldiaie Immergas"
"alwaysSendIndoorTemp": "Invia la temp attuale interna alla caldaia"
}, },
"nativeOTC": { "nativeHeating": {
"title": "Modalità nativa di calcolo della temperatura del vettore termico", "title": "Controllo del riscaldamento nativo (caldaia)",
"note": "Funziona <u>SOLO</u> se la caldaia è in modalità OTC: richiede e accetta la temperatura interna target e regola autonomamente la temperatura del vettore termico basata sulla modalità curve integrata. Incompatibile con PID e Equitherm." "note": "Lavora <u>SOLO</u> se la caldaia richiede la temperatura ambiente desiderata e regola autonomamente la temperatura del fluido. Non compatiblile con regolazioni PID e Equitherm del sistema."
} }
}, },

View File

@@ -40,7 +40,6 @@
"build": { "build": {
"title": "Build", "title": "Build",
"version": "Versie", "version": "Versie",
"commit": "Commit",
"date": "Datum", "date": "Datum",
"core": "Core", "core": "Core",
"sdk": "SDK" "sdk": "SDK"
@@ -223,13 +222,9 @@
"otDhwBurnerHours": "OpenTherm, aantal branderuren (warm water)", "otDhwBurnerHours": "OpenTherm, aantal branderuren (warm water)",
"otHeatingPumpHours": "OpenTherm, aantal pompuren (verwarming)", "otHeatingPumpHours": "OpenTherm, aantal pompuren (verwarming)",
"otDhwPumpHours": "OpenTherm, aantal pompuren (warm water)", "otDhwPumpHours": "OpenTherm, aantal pompuren (warm water)",
"otCoolingHours": "OpenTherm, aantal cooling",
"ntcTemp": "NTC-sensor", "ntcTemp": "NTC-sensor",
"dallasTemp": "DALLAS-sensor", "dallasTemp": "DALLAS-sensor",
"bluetooth": "BLE-sensor", "bluetooth": "BLE-sensor",
"dht11": "DHT11-sensor",
"dht22": "DHT22-sensor",
"heatSetpointTemp": "Verwarming, insteltemperatuur", "heatSetpointTemp": "Verwarming, insteltemperatuur",
"manual": "Handmatig via MQTT/API", "manual": "Handmatig via MQTT/API",
"notConfigured": "Niet geconfigureerd" "notConfigured": "Niet geconfigureerd"
@@ -318,8 +313,12 @@
"enable": "Seriële poort ingeschakeld", "enable": "Seriële poort ingeschakeld",
"baud": "Baudrate seriële poort" "baud": "Baudrate seriële poort"
}, },
"webSerial": { "telnet": {
"enable": "WebSerial ingeschakeld" "enable": "Telnet ingeschakeld",
"port": {
"title": "Telnet-poort",
"note": "Standaard: 23"
}
}, },
"ntp": { "ntp": {
"server": "NTP-server", "server": "NTP-server",
@@ -328,16 +327,7 @@
} }
}, },
"heating": { "heating": {
"hyst": { "hyst": "Hysterese <small>(in graden)</small>",
"title": "Hysterese",
"desc": "Hysterese is nuttig voor het handhaven van een ingestelde binnentemperatuur (bij gebruik van «Equitherm» en/of «PID»). Forceert uitschakelen van verwarming wanneer <code>current indoor > target + value</code> en inschakelen van verwarming wanneer <code>current indoor < (target - value)</code>.",
"value": "Waarde <small>(in graden)</small>",
"action": {
"title": "Actie",
"disableHeating": "Verwarming uitschakelen",
"set0target": "Stel null target in"
}
},
"turboFactor": "Turbomodus coëff." "turboFactor": "Turbomodus coëff."
}, },
"emergency": { "emergency": {
@@ -349,26 +339,11 @@
"treshold": "Drempeltijd <small>(sec)</small>" "treshold": "Drempeltijd <small>(sec)</small>"
}, },
"equitherm": { "equitherm": {
"slope": { "n": "N-factor",
"title": "Helling", "k": "K-factor",
"note": "Compensatie voor warmteverlies. Hoofdafstelparameter." "t": {
}, "title": "T-factor",
"exponent": { "note": "Niet gebruikt als PID is ingeschakeld"
"title": "Exponent",
"note": "Radiator efficiëntie. Typische waarden: <code>1.1</code> - Vloerverwarming, <code>1.2</code> - Gietijzer, <code>1.3</code> - Paneelradiatoren, <code>1.4</code> - Convectors."
},
"shift": {
"title": "Verschuiving",
"note": "Compenseert voor extra warmteverliezen (bijv. in leidingen) of extra warmtebronnen."
},
"targetDiffFactor": {
"title": "T factor",
"note": "Niet gebruikt als PID is ingeschakeld. Voegt aan de setpoint de verschil tussen de target en huidige binnentemperatuur toe: <code>setpoint = setpoint + ((target - indoor) * T)</code>."
},
"chart": {
"targetTemp": "Doel binnentemperatuur",
"setpointTemp": "Warmtedrager temperatuur",
"outdoorTemp": "Buitentemperatuur"
} }
}, },
"pid": { "pid": {
@@ -423,13 +398,11 @@
"autoFaultReset": "Automatische storingsreset <small>(niet aanbevolen!)</small>", "autoFaultReset": "Automatische storingsreset <small>(niet aanbevolen!)</small>",
"autoDiagReset": "Automatische diagnosereset <small>(niet aanbevolen!)</small>", "autoDiagReset": "Automatische diagnosereset <small>(niet aanbevolen!)</small>",
"setDateAndTime": "Stel datum & tijd in op ketel", "setDateAndTime": "Stel datum & tijd in op ketel",
"immergasFix": "Fix voor Immergas-ketels", "immergasFix": "Fix voor Immergas-ketels"
"alwaysSendIndoorTemp": "Stuur huidige binnentemp naar ketel"
}, },
"nativeHeating": {
"nativeOTC": { "title": "Natuurlijke verwarmingsregeling (ketel)",
"title": "Native warmtedrager temperatuur berekeningsmodus", "note": "Werkt <u>ALLEEN</u> als de ketel de gewenste kamertemperatuur vereist en zelf de temperatuur van de warmtedrager regelt. Niet compatibel met PID- en Equitherm-regelaars in de firmware."
"note": "Werkt <u>ALLEEN</u> als de ketel in OTC-modus is: vereist en accepteert de doel binnentemperatuur en regelt zelf de warmtedrager temperatuur op basis van de ingebouwde curves modus. Incompatibel met PID en Equitherm."
} }
}, },
"mqtt": { "mqtt": {

View File

@@ -44,7 +44,6 @@
"build": { "build": {
"title": "Билд", "title": "Билд",
"version": "Версия", "version": "Версия",
"commit": "Коммит",
"date": "Дата", "date": "Дата",
"core": "Ядро", "core": "Ядро",
"sdk": "SDK" "sdk": "SDK"
@@ -244,13 +243,10 @@
"otDhwBurnerHours": "OpenTherm, кол-во часов работы горелки (ГВС)", "otDhwBurnerHours": "OpenTherm, кол-во часов работы горелки (ГВС)",
"otHeatingPumpHours": "OpenTherm, кол-во часов работы насоса (отопление)", "otHeatingPumpHours": "OpenTherm, кол-во часов работы насоса (отопление)",
"otDhwPumpHours": "OpenTherm, кол-во часов работы насоса (ГВС)", "otDhwPumpHours": "OpenTherm, кол-во часов работы насоса (ГВС)",
"otCoolingHours": "OpenTherm, кол-во часов работы охлаждения",
"ntcTemp": "NTC датчик", "ntcTemp": "NTC датчик",
"dallasTemp": "DALLAS датчик", "dallasTemp": "DALLAS датчик",
"bluetooth": "BLE датчик", "bluetooth": "BLE датчик",
"dht11": "DHT11 датчик",
"dht22": "DHT22 датчик",
"heatSetpointTemp": "Отопление, температура уставки", "heatSetpointTemp": "Отопление, температура уставки",
"manual": "Вручную через MQTT/API", "manual": "Вручную через MQTT/API",
"notConfigured": "Не сконфигурировано" "notConfigured": "Не сконфигурировано"
@@ -345,8 +341,12 @@
"enable": "Вкл. Serial порт", "enable": "Вкл. Serial порт",
"baud": "Скорость Serial порта" "baud": "Скорость Serial порта"
}, },
"webSerial": { "telnet": {
"enable": "Вкл. WebSerial" "enable": "Вкл. Telnet",
"port": {
"title": "Telnet порт",
"note": "По умолчанию: 23"
}
}, },
"ntp": { "ntp": {
"server": "NTP сервер", "server": "NTP сервер",
@@ -356,16 +356,7 @@
}, },
"heating": { "heating": {
"hyst": { "hyst": "Гистерезис <small>(в градусах)</small>",
"title": "Гистерезис",
"desc": "Гистерезис полезен для поддержания заданной внутр. темп. (при использовании «ПЗА» и/или «ПИД»). Принудительно откл. отопление, когда <code>current indoor > target + value</code>, и вкл. отопление, когда <code>current indoor < (target - value)</code>.",
"value": "Значение <small>(в градусах)</small>",
"action": {
"title": "Действие",
"disableHeating": "Отключить отопление",
"set0target": "Установить 0 в качестве целевой темп."
}
},
"turboFactor": "Коэфф. турбо режима" "turboFactor": "Коэфф. турбо режима"
}, },
@@ -457,13 +448,12 @@
"autoFaultReset": "Автоматический сброс ошибок <small>(не рекомендуется!)</small>", "autoFaultReset": "Автоматический сброс ошибок <small>(не рекомендуется!)</small>",
"autoDiagReset": "Автоматический сброс диагностики <small>(не рекомендуется!)</small>", "autoDiagReset": "Автоматический сброс диагностики <small>(не рекомендуется!)</small>",
"setDateAndTime": "Устанавливать время и дату на котле", "setDateAndTime": "Устанавливать время и дату на котле",
"immergasFix": "Фикс для котлов Immergas", "immergasFix": "Фикс для котлов Immergas"
"alwaysSendIndoorTemp": "Передавать текущую темп. в помещении котлу"
}, },
"nativeOTC": { "nativeHeating": {
"title": "Нативный режим OTC (расчёт температуры теплоносителя)", "title": "Передать управление отоплением котлу",
"note": "Работает <u>ТОЛЬКО</u> если котел в режиме OTC: требует и принимает целевую температуру в помещении и сам регулирует температуру теплоносителя на основе встроенного режима кривых. Несовместимо с ПИД и ПЗА." "note": "Работает <u>ТОЛЬКО</u> если котел требует и принимает целевую температуру в помещении и сам регулирует температуру теплоносителя на основе встроенного режима кривых. Несовместимо с ПИД и ПЗА."
} }
}, },

View File

@@ -491,9 +491,6 @@
if (modified) { if (modified) {
parameters.method = "POST"; parameters.method = "POST";
parameters.body = JSON.stringify(newSettings); parameters.body = JSON.stringify(newSettings);
parameters.headers = {
"Content-Type": "application/json"
};
} }
const response = await fetch("/api/settings", parameters); const response = await fetch("/api/settings", parameters);

View File

@@ -104,7 +104,6 @@
<th scope="row" data-i18n>index.system.build.title</th> <th scope="row" data-i18n>index.system.build.title</th>
<td> <td>
Env: <b id="build-env"></b><br /> Env: <b id="build-env"></b><br />
<span data-i18n>index.system.build.commit</span>: <b id="build-commit"></b><br />
<span data-i18n>index.system.build.date</span>: <b id="build-date"></b><br /> <span data-i18n>index.system.build.date</span>: <b id="build-date"></b><br />
<span data-i18n>index.system.build.core</span>: <b id="build-core"></b><br /> <span data-i18n>index.system.build.core</span>: <b id="build-core"></b><br />
<span data-i18n>index.system.build.sdk</span>: <b id="build-sdk"></b> <span data-i18n>index.system.build.sdk</span>: <b id="build-sdk"></b>
@@ -207,7 +206,6 @@
setBusy('#main-busy', '#main-table', false); setBusy('#main-busy', '#main-table', false);
setValue('#build-version', result.build.version); setValue('#build-version', result.build.version);
setValue('#build-commit', result.build.commit);
setValue('#build-date', result.build.date); setValue('#build-date', result.build.date);
setValue('#build-env', result.build.env); setValue('#build-env', result.build.env);
setValue('#build-core', result.build.core); setValue('#build-core', result.build.core);

View File

@@ -113,13 +113,10 @@
<option value="24" data-i18n>sensors.types.otDhwBurnerHours</option> <option value="24" data-i18n>sensors.types.otDhwBurnerHours</option>
<option value="25" data-i18n>sensors.types.otHeatingPumpHours</option> <option value="25" data-i18n>sensors.types.otHeatingPumpHours</option>
<option value="26" data-i18n>sensors.types.otDhwPumpHours</option> <option value="26" data-i18n>sensors.types.otDhwPumpHours</option>
<option value="27" data-i18n>sensors.types.otCoolingHours</option>
<option value="50" data-i18n>sensors.types.ntcTemp</option> <option value="50" data-i18n>sensors.types.ntcTemp</option>
<option value="51" data-i18n>sensors.types.dallasTemp</option> <option value="51" data-i18n>sensors.types.dallasTemp</option>
<option value="52" data-i18n>sensors.types.bluetooth</option> <option value="52" data-i18n>sensors.types.bluetooth</option>
<option value="53" data-i18n>sensors.types.dht11</option>
<option value="54" data-i18n>sensors.types.dht22</option>
<option value="253" data-i18n>sensors.types.heatSetpointTemp</option> <option value="253" data-i18n>sensors.types.heatSetpointTemp</option>
<option value="254" data-i18n>sensors.types.manual</option> <option value="254" data-i18n>sensors.types.manual</option>
<option value="255" data-i18n>sensors.types.notConfigured</option> <option value="255" data-i18n>sensors.types.notConfigured</option>
@@ -273,35 +270,27 @@
} }
switch(parseInt(event.target.value)) { switch(parseInt(event.target.value)) {
// NTC10K // ntc
case 50: case 50:
parentGpio.classList.remove("hidden"); parentGpio.classList.remove("hidden");
parentAddress.classList.add("hidden"); parentAddress.classList.add("hidden");
address.removeAttribute("pattern"); address.removeAttribute("pattern");
break; break;
// OneWire // dallas
case 51: case 51:
parentGpio.classList.remove("hidden"); parentGpio.classList.remove("hidden");
parentAddress.classList.remove("hidden"); parentAddress.classList.remove("hidden");
address.setAttribute("pattern", "([A-Fa-f0-9]{2}:){7}[A-Fa-f0-9]{2}"); address.setAttribute("pattern", "([A-Fa-f0-9]{2}:){7}[A-Fa-f0-9]{2}");
break; break;
// Bluetooth // ble
case 52: case 52:
parentGpio.classList.add("hidden"); parentGpio.classList.add("hidden");
parentAddress.classList.remove("hidden"); parentAddress.classList.remove("hidden");
address.setAttribute("pattern", "([A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2}"); address.setAttribute("pattern", "([A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2}");
break; break;
// DHT
case 53:
case 54:
parentGpio.classList.remove("hidden");
parentAddress.classList.add("hidden");
address.removeAttribute("pattern");
break;
// other // other
default: default:
parentGpio.classList.add("hidden"); parentGpio.classList.add("hidden");

View File

@@ -126,8 +126,8 @@
</label> </label>
<label> <label>
<input type="checkbox" name="system[webSerial][enabled]" value="true"> <input type="checkbox" name="system[telnet][enabled]" value="true">
<span data-i18n>settings.system.webSerial.enable</span> <span data-i18n>settings.system.telnet.enable</span>
</label> </label>
<label> <label>
@@ -156,6 +156,12 @@
<option value="115200">115200</option> <option value="115200">115200</option>
</select> </select>
</label> </label>
<label>
<span data-i18n>settings.system.telnet.port.title</span>
<input type="number" inputmode="numeric" name="system[telnet][port]" min="1" max="65535" step="1" required>
<small data-i18n>settings.system.telnet.port.note</small>
</label>
</div> </div>
<mark data-i18n>settings.note.restart</mark> <mark data-i18n>settings.note.restart</mark>
@@ -188,47 +194,20 @@
<div class="grid"> <div class="grid">
<label> <label>
<span data-i18n>settings.heating.turboFactor</span> <span data-i18n>settings.heating.hyst</span>
<input type="number" inputmode="decimal" name="heating[turboFactor]" min="1.5" max="10" step="0.1" required> <input type="number" inputmode="decimal" name="heating[hysteresis]" min="0" max="5" step="0.05" required>
</label> </label>
<label> <label>
<span data-i18n>settings.maxModulation</span> <span data-i18n>settings.heating.turboFactor</span>
<input type="number" inputmode="numeric" name="heating[maxModulation]" min="1" max="100" step="1" required> <input type="number" inputmode="decimal" name="heating[turboFactor]" min="1.5" max="10" step="0.1" required>
</label> </label>
</div> </div>
<hr /> <label>
<span data-i18n>settings.maxModulation</span>
<details> <input type="number" inputmode="numeric" name="heating[maxModulation]" min="1" max="100" step="1" required>
<summary><b data-i18n>settings.heating.hyst.title</b></summary> </label>
<div>
<fieldset>
<label>
<input type="checkbox" name="heating[hysteresis][enabled]" value="true">
<span data-i18n>settings.enable</span>
</label>
</fieldset>
<div class="grid">
<label>
<span data-i18n>settings.heating.hyst.value</span>
<input type="number" inputmode="decimal" name="heating[hysteresis][value]" min="0" max="5" step="0.05" required>
</label>
<label>
<span data-i18n>settings.heating.hyst.action.title</span>
<select name="heating[hysteresis][action]">
<option value="0" data-i18n>settings.heating.hyst.action.disableHeating</option>
<option value="1" data-i18n>settings.heating.hyst.action.set0target</option>
</select>
</label>
</div>
</div>
<small data-i18n>settings.heating.hyst.desc</small>
</details>
<hr /> <hr />
@@ -686,17 +665,12 @@
<span data-i18n>settings.ot.options.immergasFix</span> <span data-i18n>settings.ot.options.immergasFix</span>
</label> </label>
<label>
<input type="checkbox" name="opentherm[options][alwaysSendIndoorTemp]" value="true">
<span data-i18n>settings.ot.options.alwaysSendIndoorTemp</span>
</label>
<hr /> <hr />
<label> <label>
<input type="checkbox" name="opentherm[options][nativeOTC]" value="true"> <input type="checkbox" name="opentherm[options][nativeHeatingControl]" value="true">
<span data-i18n>settings.ot.nativeOTC.title</span><br /> <span data-i18n>settings.ot.nativeHeating.title</span><br />
<small data-i18n>settings.ot.nativeOTC.note</small> <small data-i18n>settings.ot.nativeHeating.note</small>
</label> </label>
</fieldset> </fieldset>
</div> </div>
@@ -1077,7 +1051,8 @@
setSelectValue("[name='system[logLevel]']", data.system.logLevel); setSelectValue("[name='system[logLevel]']", data.system.logLevel);
setCheckboxValue("[name='system[serial][enabled]']", data.system.serial.enabled); setCheckboxValue("[name='system[serial][enabled]']", data.system.serial.enabled);
setSelectValue("[name='system[serial][baudrate]']", data.system.serial.baudrate); setSelectValue("[name='system[serial][baudrate]']", data.system.serial.baudrate);
setCheckboxValue("[name='system[webSerial][enabled]']", data.system.webSerial.enabled); setCheckboxValue("[name='system[telnet][enabled]']", data.system.telnet.enabled);
setInputValue("[name='system[telnet][port]']", data.system.telnet.port);
setInputValue("[name='system[ntp][server]']", data.system.ntp.server); setInputValue("[name='system[ntp][server]']", data.system.ntp.server);
setInputValue("[name='system[ntp][timezone]']", data.system.ntp.timezone); setInputValue("[name='system[ntp][timezone]']", data.system.ntp.timezone);
setRadioValue("[name='system[unitSystem]']", data.system.unitSystem); setRadioValue("[name='system[unitSystem]']", data.system.unitSystem);
@@ -1115,9 +1090,8 @@
setCheckboxValue("[name='opentherm[options][autoFaultReset]']", data.opentherm.options.autoFaultReset); setCheckboxValue("[name='opentherm[options][autoFaultReset]']", data.opentherm.options.autoFaultReset);
setCheckboxValue("[name='opentherm[options][autoDiagReset]']", data.opentherm.options.autoDiagReset); setCheckboxValue("[name='opentherm[options][autoDiagReset]']", data.opentherm.options.autoDiagReset);
setCheckboxValue("[name='opentherm[options][setDateAndTime]']", data.opentherm.options.setDateAndTime); setCheckboxValue("[name='opentherm[options][setDateAndTime]']", data.opentherm.options.setDateAndTime);
setCheckboxValue("[name='opentherm[options][nativeOTC]']", data.opentherm.options.nativeOTC); setCheckboxValue("[name='opentherm[options][nativeHeatingControl]']", data.opentherm.options.nativeHeatingControl);
setCheckboxValue("[name='opentherm[options][immergasFix]']", data.opentherm.options.immergasFix); setCheckboxValue("[name='opentherm[options][immergasFix]']", data.opentherm.options.immergasFix);
setCheckboxValue("[name='opentherm[options][alwaysSendIndoorTemp]']", data.opentherm.options.alwaysSendIndoorTemp);
setBusy('#ot-settings-busy', '#ot-settings', false); setBusy('#ot-settings-busy', '#ot-settings', false);
// MQTT // MQTT
@@ -1164,9 +1138,7 @@
"min": data.system.unitSystem == 0 ? 1 : 33, "min": data.system.unitSystem == 0 ? 1 : 33,
"max": data.system.unitSystem == 0 ? 100 : 212 "max": data.system.unitSystem == 0 ? 100 : 212
}); });
setCheckboxValue("[name='heating[hysteresis][enabled]']", data.heating.hysteresis.enabled); setInputValue("[name='heating[hysteresis]']", data.heating.hysteresis);
setInputValue("[name='heating[hysteresis][value]']", data.heating.hysteresis.value);
setSelectValue("[name='heating[hysteresis][action]']", data.heating.hysteresis.action);
setInputValue("[name='heating[turboFactor]']", data.heating.turboFactor); setInputValue("[name='heating[turboFactor]']", data.heating.turboFactor);
setInputValue("[name='heating[maxModulation]']", data.heating.maxModulation); setInputValue("[name='heating[maxModulation]']", data.heating.maxModulation);
setInputValue("[name='heating[overheatProtection][highTemp]']", data.heating.overheatProtection.highTemp, { setInputValue("[name='heating[overheatProtection][highTemp]']", data.heating.overheatProtection.highTemp, {
@@ -1205,7 +1177,7 @@
setBusy('#dhw-settings-busy', '#dhw-settings', false); setBusy('#dhw-settings-busy', '#dhw-settings', false);
// Emergency mode // Emergency mode
if (data.opentherm.options.nativeOTC) { if (data.opentherm.options.nativeHeatingControl) {
setInputValue("[name='emergency[target]']", data.emergency.target, { setInputValue("[name='emergency[target]']", data.emergency.target, {
"min": data.system.unitSystem == 0 ? 5 : 41, "min": data.system.unitSystem == 0 ? 5 : 41,
"max": data.system.unitSystem == 0 ? 40 : 104 "max": data.system.unitSystem == 0 ? 40 : 104

View File

@@ -62,19 +62,19 @@
<form action="/api/upgrade" id="upgrade"> <form action="/api/upgrade" id="upgrade">
<fieldset class="primary"> <fieldset class="primary">
<label> <label for="firmware-file">
<span data-i18n>upgrade.fw</span>: <span data-i18n>upgrade.fw</span>:
<div class="grid"> <div class="grid">
<input type="file" name="fw" accept=".bin"> <input type="file" name="firmware" id="firmware-file" accept=".bin">
<button type="button" class="fwResult hidden" disabled></button> <button type="button" class="upgrade-firmware-result hidden" disabled></button>
</div> </div>
</label> </label>
<label> <label for="filesystem-file">
<span data-i18n>upgrade.fs</span>: <span data-i18n>upgrade.fs</span>:
<div class="grid"> <div class="grid">
<input type="file" name="fs" accept=".bin"> <input type="file" name="filesystem" id="filesystem-file" accept=".bin">
<button type="button" class="fsResult hidden" disabled></button> <button type="button" class="upgrade-filesystem-result hidden" disabled></button>
</div> </div>
</label> </label>
</fieldset> </fieldset>
@@ -108,123 +108,7 @@
lang.build(); lang.build();
setupRestoreBackupForm('#restore'); setupRestoreBackupForm('#restore');
setupUpgradeForm('#upgrade');
const upgradeForm = document.querySelector('#upgrade');
if (upgradeForm) {
upgradeForm.reset();
const statusToText = (status) => {
switch (status) {
case 0:
return "None";
case 1:
return "No file";
case 2:
return "Success";
case 3:
return "Prohibited";
case 4:
return "Size mismatch";
case 5:
return "Error on start";
case 6:
return "Error on write";
case 7:
return "Error on finish";
default:
return "Unknown";
}
};
upgradeForm.addEventListener('submit', async (event) => {
event.preventDefault();
hide('.fwResult');
hide('.fsResult');
let button = upgradeForm.querySelector('button[type="submit"]');
button.textContent = i18n('button.uploading');
button.setAttribute('disabled', true);
button.setAttribute('aria-busy', true);
try {
let fd = new FormData();
const fw = upgradeForm.querySelector("[name='fw']").files;
if (fw.length > 0) {
fd.append("fw_size", fw[0].size);
fd.append("fw", fw[0]);
}
const fs = upgradeForm.querySelector("[name='fs']").files;
if (fs.length > 0) {
fd.append("fs_size", fs[0].size);
fd.append("fs", fs[0]);
}
let response = await fetch(upgradeForm.action, {
method: "POST",
cache: "no-cache",
credentials: "include",
body: fd
});
if (response.status != 202 && response.status != 406) {
throw new Error('Response not valid');
}
const result = await response.json();
let resItem = upgradeForm.querySelector('.fwResult');
if (resItem && result.firmware.status > 1) {
resItem.textContent = statusToText(result.firmware.status);
resItem.classList.remove('hidden');
if (result.firmware.status == 2) {
resItem.classList.remove('failed');
resItem.classList.add('success');
} else {
resItem.classList.remove('success');
resItem.classList.add('failed');
if (result.firmware.error != "") {
resItem.textContent += `: ${result.firmware.error}`;
}
}
}
resItem = upgradeForm.querySelector('.fsResult');
if (resItem && result.filesystem.status > 1) {
resItem.textContent = statusToText(result.filesystem.status);
resItem.classList.remove('hidden');
if (result.filesystem.status == 2) {
resItem.classList.remove('failed');
resItem.classList.add('success');
} else {
resItem.classList.remove('success');
resItem.classList.add('failed');
if (result.filesystem.error != "") {
resItem.textContent += `: ${result.filesystem.error}`;
}
}
}
} catch (err) {
console.log(err);
button.textContent = i18n('button.error');
button.classList.add('failed');
} finally {
setTimeout(() => {
button.removeAttribute('aria-busy');
button.removeAttribute('disabled');
button.classList.remove('success', 'failed');
button.textContent = i18n(button.dataset.i18n);
upgradeForm.reset();
}, 10000);
}
});
}
}); });
</script> </script>
</body> </body>

View File

@@ -318,25 +318,19 @@ const setupRestoreBackupForm = (formSelector) => {
console.log("Backup: ", data); console.log("Backup: ", data);
if (data.settings != undefined) { if (data.settings != undefined) {
for (var key in data.settings) { let response = await fetch(url, {
let response = await fetch(url, { method: "POST",
method: "POST", cache: "no-cache",
cache: "no-cache", credentials: "include",
credentials: "include", headers: {
headers: { "Content-Type": "application/json"
"Content-Type": "application/json" },
}, body: JSON.stringify({"settings": data.settings})
body: JSON.stringify({ });
"settings": {
[key]: data.settings[key]
}
})
});
if (!response.ok) { if (!response.ok) {
onFailed(); onFailed();
return; return;
}
} }
} }

View File

@@ -1,16 +0,0 @@
import subprocess
Import("env")
try:
commit_hash = "undefined"
result = subprocess.check_output(
["git", "rev-parse", "--short", "HEAD"]
)
commit_hash = result.decode("utf-8").strip()
env.Append(
CPPDEFINES=[
("BUILD_COMMIT", '\\"{}\\"'.format(commit_hash))
]
)
except Exception as error:
print("Failed to get commit hash: {}".format(error))