15 Commits

Author SHA1 Message Date
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
29 changed files with 504 additions and 1431 deletions

22
.github/workflows/pio-dependabot.yaml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: PlatformIO Dependabot
on:
workflow_dispatch: # option to manually trigger the workflow
schedule:
# Runs every day at 00:00
- cron: "0 0 * * *"
permissions:
contents: write
pull-requests: write
jobs:
dependabot:
runs-on: ubuntu-latest
name: run PlatformIO Dependabot
steps:
- name: Checkout
uses: actions/checkout@v5
- name: run PlatformIO Dependabot
uses: peterus/platformio_dependabot@v1.2.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -72,7 +72,7 @@ All available information and instructions can be found in the wiki:
* [Leds on board](https://github.com/Laxilef/OTGateway/wiki/OT-adapters#leds-on-board) * [Leds on board](https://github.com/Laxilef/OTGateway/wiki/OT-adapters#leds-on-board)
## Gratitude ## Gratitude
* To the developers of the libraries used: [OpenTherm Library](https://github.com/ihormelnyk/opentherm_library), [ESP8266Scheduler](https://github.com/nrwiersma/ESP8266Scheduler), [ArduinoJson](https://github.com/bblanchon/ArduinoJson), [NimBLE-Arduino](https://github.com/h2zero/NimBLE-Arduino), [ArduinoMqttClient](https://github.com/arduino-libraries/ArduinoMqttClient), [ESPTelnet](https://github.com/LennartHennigs/ESPTelnet), [FileData](https://github.com/GyverLibs/FileData), [GyverPID](https://github.com/GyverLibs/GyverPID), [GyverBlinker](https://github.com/GyverLibs/GyverBlinker), [OneWireNg](https://github.com/pstolarz/OneWireNg) & [OneWire](https://github.com/PaulStoffregen/OneWire) * To the developers of the libraries used: [OpenTherm Library](https://github.com/ihormelnyk/opentherm_library), [ESP8266Scheduler](https://github.com/nrwiersma/ESP8266Scheduler), [ArduinoJson](https://github.com/bblanchon/ArduinoJson), [NimBLE-Arduino](https://github.com/h2zero/NimBLE-Arduino), [ArduinoMqttClient](https://github.com/arduino-libraries/ArduinoMqttClient), [ESPTelnet](https://github.com/LennartHennigs/ESPTelnet), [FileData](https://github.com/GyverLibs/FileData), [GyverPID](https://github.com/GyverLibs/GyverPID), [GyverBlinker](https://github.com/GyverLibs/GyverBlinker), [FileData](https://github.com/GyverLibs/FileData), [OneWireNg](https://github.com/pstolarz/OneWireNg) & [OneWire](https://github.com/PaulStoffregen/OneWire)
* To the [PlatformIO](https://platformio.org/) Team * To the [PlatformIO](https://platformio.org/) Team
* To the team and contributors of the [pioarduino](https://github.com/pioarduino/platform-espressif32) project * To the team and contributors of the [pioarduino](https://github.com/pioarduino/platform-espressif32) project
* To the [BrowserStack](https://www.browserstack.com/) team. This project is tested with BrowserStack. * To the [BrowserStack](https://www.browserstack.com/) team. This project is tested with BrowserStack.

View File

@@ -4,8 +4,8 @@
class CustomOpenTherm : public OpenTherm { class CustomOpenTherm : public OpenTherm {
public: public:
typedef std::function<void(unsigned int)> DelayCallback; typedef std::function<void(unsigned int)> DelayCallback;
typedef std::function<void(unsigned long, uint8_t)> BeforeSendRequestCallback; typedef std::function<void(unsigned long, byte)> BeforeSendRequestCallback;
typedef std::function<void(unsigned long, unsigned long, OpenThermResponseStatus, uint8_t)> AfterSendRequestCallback; typedef std::function<void(unsigned long, unsigned long, OpenThermResponseStatus, byte)> AfterSendRequestCallback;
CustomOpenTherm(int inPin = 4, int outPin = 5, bool isSlave = false, bool alwaysReceive = false) : OpenTherm(inPin, outPin, isSlave, alwaysReceive) {} CustomOpenTherm(int inPin = 4, int outPin = 5, bool isSlave = false, bool alwaysReceive = false) : OpenTherm(inPin, outPin, isSlave, alwaysReceive) {}
~CustomOpenTherm() {} ~CustomOpenTherm() {}
@@ -70,89 +70,51 @@ 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; bool sendServiceReset() {
const uint8_t responseCode = response & 0xFF; unsigned int data = 10;
if (responseRequestCode != requestCode || responseCode < 128) { data <<= 8;
return false; unsigned long response = this->sendRequest(buildRequest(
}
// reset
this->sendRequest(buildRequest(
OpenThermMessageType::WRITE_DATA, OpenThermMessageType::WRITE_DATA,
OpenThermMessageID::RemoteRequest, OpenThermMessageID::RemoteRequest,
0u << 8 data
)); ));
return true; return isValidResponse(response) && isValidResponseId(response, OpenThermMessageID::RemoteRequest);
} }
bool getStr(OpenThermMessageID id, char* buffer, uint16_t length = 50) { bool sendWaterFilling() {
if (buffer == nullptr || length == 0) { unsigned int data = 2;
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) {
response = this->sendRequest(buildRequest(
OpenThermMessageType::READ_DATA,
id,
static_cast<unsigned int>(index) << 8
));
if (!isValidResponse(response) || !isValidResponseId(response, id)) {
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; byte responseId = (response >> 16) & 0xFF;
return static_cast<uint8_t>(id) == responseId; return (byte)id == responseId;
} }
static uint8_t getResponseMessageTypeId(unsigned long response) { static uint8_t getResponseMessageTypeId(unsigned long response) {
@@ -163,10 +125,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

@@ -147,19 +147,8 @@ public:
return topic; return topic;
} }
template <class DT, class VT>
String getEntityIdWithPrefix(DT domain, VT value, char separator = '_') {
String topic = "";
topic.concat(domain);
topic.concat('.');
topic.concat(this->devicePrefix);
topic.concat(separator);
topic.concat(value);
return topic;
}
template <class T> template <class T>
String getUniqueIdWithPrefix(T value, char separator = '_') { String getObjectIdWithPrefix(T value, char separator = '_') {
String topic = ""; String topic = "";
topic.concat(this->devicePrefix); topic.concat(this->devicePrefix);
topic.concat(separator); topic.concat(separator);

View File

@@ -12,67 +12,66 @@ const char HA_ENTITY_SELECT[] PROGMEM = "select";
const char HA_ENTITY_SENSOR[] PROGMEM = "sensor"; const char HA_ENTITY_SENSOR[] PROGMEM = "sensor";
const char HA_ENTITY_SWITCH[] PROGMEM = "switch"; const char HA_ENTITY_SWITCH[] PROGMEM = "switch";
// https://www.home-assistant.io/integrations/mqtt/#supported-abbreviations-in-mqtt-discovery-messages const char HA_DEVICE[] PROGMEM = "device";
const char HA_DEFAULT_ENTITY_ID[] PROGMEM = "def_ent_id"; // "default_entity_id " const char HA_IDENTIFIERS[] PROGMEM = "identifiers";
const char HA_DEVICE[] PROGMEM = "dev"; // "device" const char HA_SW_VERSION[] PROGMEM = "sw_version";
const char HA_IDENTIFIERS[] PROGMEM = "ids"; // "identifiers" const char HA_MANUFACTURER[] PROGMEM = "manufacturer";
const char HA_SW_VERSION[] PROGMEM = "sw"; // "sw_version" const char HA_MODEL[] PROGMEM = "model";
const char HA_MANUFACTURER[] PROGMEM = "mf"; // "manufacturer"
const char HA_MODEL[] PROGMEM = "mdl"; // "model"
const char HA_NAME[] PROGMEM = "name"; const char HA_NAME[] PROGMEM = "name";
const char HA_CONF_URL[] PROGMEM = "cu"; // "configuration_url" const char HA_CONF_URL[] PROGMEM = "configuration_url";
const char HA_COMMAND_TOPIC[] PROGMEM = "cmd_t"; // "command_topic" const char HA_COMMAND_TOPIC[] PROGMEM = "command_topic";
const char HA_COMMAND_TEMPLATE[] PROGMEM = "cmd_tpl"; // "command_template" const char HA_COMMAND_TEMPLATE[] PROGMEM = "command_template";
const char HA_ENABLED_BY_DEFAULT[] PROGMEM = "en"; // "enabled_by_default" const char HA_ENABLED_BY_DEFAULT[] PROGMEM = "enabled_by_default";
const char HA_UNIQUE_ID[] PROGMEM = "uniq_id"; // "unique_id" const char HA_UNIQUE_ID[] PROGMEM = "unique_id";
const char HA_ENTITY_CATEGORY[] PROGMEM = "ent_cat"; // "entity_category" const char HA_OBJECT_ID[] PROGMEM = "object_id";
const char HA_ENTITY_CATEGORY[] PROGMEM = "entity_category";
const char HA_ENTITY_CATEGORY_DIAGNOSTIC[] PROGMEM = "diagnostic"; const char HA_ENTITY_CATEGORY_DIAGNOSTIC[] PROGMEM = "diagnostic";
const char HA_ENTITY_CATEGORY_CONFIG[] PROGMEM = "config"; const char HA_ENTITY_CATEGORY_CONFIG[] PROGMEM = "config";
const char HA_STATE_TOPIC[] PROGMEM = "stat_t"; // "state_topic" const char HA_STATE_TOPIC[] PROGMEM = "state_topic";
const char HA_VALUE_TEMPLATE[] PROGMEM = "val_tpl"; // "value_template" const char HA_VALUE_TEMPLATE[] PROGMEM = "value_template";
const char HA_OPTIONS[] PROGMEM = "ops"; // "options" const char HA_OPTIONS[] PROGMEM = "options";
const char HA_AVAILABILITY[] PROGMEM = "avty"; // "availability" const char HA_AVAILABILITY[] PROGMEM = "availability";
const char HA_AVAILABILITY_MODE[] PROGMEM = "avty_mode"; // "availability_mode" const char HA_AVAILABILITY_MODE[] PROGMEM = "availability_mode";
const char HA_TOPIC[] PROGMEM = "t"; // "topic" const char HA_TOPIC[] PROGMEM = "topic";
const char HA_DEVICE_CLASS[] PROGMEM = "dev_cla"; // "device_class" const char HA_DEVICE_CLASS[] PROGMEM = "device_class";
const char HA_UNIT_OF_MEASUREMENT[] PROGMEM = "unit_of_meas"; // "unit_of_measurement" const char HA_UNIT_OF_MEASUREMENT[] PROGMEM = "unit_of_measurement";
const char HA_UNIT_OF_MEASUREMENT_C[] PROGMEM = "°C"; const char HA_UNIT_OF_MEASUREMENT_C[] PROGMEM = "°C";
const char HA_UNIT_OF_MEASUREMENT_F[] PROGMEM = "°F"; const char HA_UNIT_OF_MEASUREMENT_F[] PROGMEM = "°F";
const char HA_UNIT_OF_MEASUREMENT_PERCENT[] PROGMEM = "%"; const char HA_UNIT_OF_MEASUREMENT_PERCENT[] PROGMEM = "%";
const char HA_UNIT_OF_MEASUREMENT_L_MIN[] PROGMEM = "L/min"; const char HA_UNIT_OF_MEASUREMENT_L_MIN[] PROGMEM = "L/min";
const char HA_UNIT_OF_MEASUREMENT_GAL_MIN[] PROGMEM = "gal/min"; const char HA_UNIT_OF_MEASUREMENT_GAL_MIN[] PROGMEM = "gal/min";
const char HA_ICON[] PROGMEM = "ic"; // "icon" const char HA_ICON[] PROGMEM = "icon";
const char HA_MIN[] PROGMEM = "min"; const char HA_MIN[] PROGMEM = "min";
const char HA_MAX[] PROGMEM = "max"; const char HA_MAX[] PROGMEM = "max";
const char HA_STEP[] PROGMEM = "step"; const char HA_STEP[] PROGMEM = "step";
const char HA_MODE[] PROGMEM = "mode"; const char HA_MODE[] PROGMEM = "mode";
const char HA_MODE_BOX[] PROGMEM = "box"; const char HA_MODE_BOX[] PROGMEM = "box";
const char HA_STATE_ON[] PROGMEM = "stat_on"; // "state_on" const char HA_STATE_ON[] PROGMEM = "state_on";
const char HA_STATE_OFF[] PROGMEM = "stat_off"; // "state_off" const char HA_STATE_OFF[] PROGMEM = "state_off";
const char HA_PAYLOAD_ON[] PROGMEM = "pl_on"; // "payload_on" const char HA_PAYLOAD_ON[] PROGMEM = "payload_on";
const char HA_PAYLOAD_OFF[] PROGMEM = "pl_off"; // "payload_off" const char HA_PAYLOAD_OFF[] PROGMEM = "payload_off";
const char HA_STATE_CLASS[] PROGMEM = "stat_cla"; // "state_class" const char HA_STATE_CLASS[] PROGMEM = "state_class";
const char HA_STATE_CLASS_MEASUREMENT[] PROGMEM = "measurement"; const char HA_STATE_CLASS_MEASUREMENT[] PROGMEM = "measurement";
const char HA_EXPIRE_AFTER[] PROGMEM = "exp_aft"; // "expire_after" const char HA_EXPIRE_AFTER[] PROGMEM = "expire_after";
const char HA_CURRENT_TEMPERATURE_TOPIC[] PROGMEM = "curr_temp_t"; // "current_temperature_topic" const char HA_CURRENT_TEMPERATURE_TOPIC[] PROGMEM = "current_temperature_topic";
const char HA_CURRENT_TEMPERATURE_TEMPLATE[] PROGMEM = "curr_temp_tpl"; // "current_temperature_template" const char HA_CURRENT_TEMPERATURE_TEMPLATE[] PROGMEM = "current_temperature_template";
const char HA_TEMPERATURE_COMMAND_TOPIC[] PROGMEM = "temp_cmd_t"; // "temperature_command_topic" const char HA_TEMPERATURE_COMMAND_TOPIC[] PROGMEM = "temperature_command_topic";
const char HA_TEMPERATURE_COMMAND_TEMPLATE[] PROGMEM = "temp_cmd_tpl"; // "temperature_command_template" const char HA_TEMPERATURE_COMMAND_TEMPLATE[] PROGMEM = "temperature_command_template";
const char HA_TEMPERATURE_STATE_TOPIC[] PROGMEM = "temp_stat_t"; // "temperature_state_topic" const char HA_TEMPERATURE_STATE_TOPIC[] PROGMEM = "temperature_state_topic";
const char HA_TEMPERATURE_STATE_TEMPLATE[] PROGMEM = "temp_stat_tpl"; // "temperature_state_template" const char HA_TEMPERATURE_STATE_TEMPLATE[] PROGMEM = "temperature_state_template";
const char HA_TEMPERATURE_UNIT[] PROGMEM = "temp_unit"; // "temperature_unit" const char HA_TEMPERATURE_UNIT[] PROGMEM = "temperature_unit";
const char HA_MODE_COMMAND_TOPIC[] PROGMEM = "mode_cmd_t"; // "mode_command_topic" const char HA_MODE_COMMAND_TOPIC[] PROGMEM = "mode_command_topic";
const char HA_MODE_COMMAND_TEMPLATE[] PROGMEM = "mode_cmd_tpl"; // "mode_command_template" const char HA_MODE_COMMAND_TEMPLATE[] PROGMEM = "mode_command_template";
const char HA_MODE_STATE_TOPIC[] PROGMEM = "mode_stat_t"; // "mode_state_topic" const char HA_MODE_STATE_TOPIC[] PROGMEM = "mode_state_topic";
const char HA_MODE_STATE_TEMPLATE[] PROGMEM = "mode_stat_tpl"; // "mode_state_template" const char HA_MODE_STATE_TEMPLATE[] PROGMEM = "mode_state_template";
const char HA_MODES[] PROGMEM = "modes"; const char HA_MODES[] PROGMEM = "modes";
const char HA_ACTION_TOPIC[] PROGMEM = "act_t"; // "action_topic" const char HA_ACTION_TOPIC[] PROGMEM = "action_topic";
const char HA_ACTION_TEMPLATE[] PROGMEM = "act_tpl"; // "action_template" const char HA_ACTION_TEMPLATE[] PROGMEM = "action_template";
const char HA_MIN_TEMP[] PROGMEM = "min_temp"; const char HA_MIN_TEMP[] PROGMEM = "min_temp";
const char HA_MAX_TEMP[] PROGMEM = "max_temp"; const char HA_MAX_TEMP[] PROGMEM = "max_temp";
const char HA_TEMP_STEP[] PROGMEM = "temp_step"; const char HA_TEMP_STEP[] PROGMEM = "temp_step";
const char HA_PRESET_MODE_COMMAND_TOPIC[] PROGMEM = "pr_mode_cmd_t"; // "preset_mode_command_topic" const char HA_PRESET_MODE_COMMAND_TOPIC[] PROGMEM = "preset_mode_command_topic";
const char HA_PRESET_MODE_COMMAND_TEMPLATE[] PROGMEM = "pr_mode_cmd_tpl"; // "preset_mode_command_template" const char HA_PRESET_MODE_COMMAND_TEMPLATE[] PROGMEM = "preset_mode_command_template";
const char HA_PRESET_MODE_STATE_TOPIC[] PROGMEM = "pr_mode_stat_t"; // "preset_mode_state_topic" const char HA_PRESET_MODE_STATE_TOPIC[] PROGMEM = "preset_mode_state_topic";
const char HA_PRESET_MODE_VALUE_TEMPLATE[] PROGMEM = "pr_mode_val_tpl"; // "preset_mode_value_template" const char HA_PRESET_MODE_VALUE_TEMPLATE[] PROGMEM = "preset_mode_value_template";
const char HA_PRESET_MODES[] PROGMEM = "pr_modes"; // "preset_modes" const char HA_PRESET_MODES[] PROGMEM = "preset_modes";

View File

@@ -35,7 +35,7 @@ namespace NetworkUtils {
return this; return this;
} }
NetworkMgr* setApCredentials(const char* ssid, const char* password = nullptr, uint8_t channel = 0) { NetworkMgr* setApCredentials(const char* ssid, const char* password = nullptr, byte channel = 0) {
this->apName = ssid; this->apName = ssid;
this->apPassword = password; this->apPassword = password;
this->apChannel = channel; this->apChannel = channel;
@@ -43,7 +43,7 @@ namespace NetworkUtils {
return this; return this;
} }
NetworkMgr* setStaCredentials(const char* ssid = nullptr, const char* password = nullptr, uint8_t channel = 0) { NetworkMgr* setStaCredentials(const char* ssid = nullptr, const char* password = nullptr, byte channel = 0) {
this->staSsid = ssid; this->staSsid = ssid;
this->staPassword = password; this->staPassword = password;
this->staChannel = channel; this->staChannel = channel;
@@ -140,7 +140,7 @@ namespace NetworkUtils {
return this->staPassword; return this->staPassword;
} }
uint8_t getStaChannel() { byte getStaChannel() {
return this->staChannel; return this->staChannel;
} }
@@ -377,7 +377,7 @@ namespace NetworkUtils {
} }
} }
static uint8_t rssiToSignalQuality(short int rssi) { static byte rssiToSignalQuality(short int rssi) {
return constrain(map(rssi, -100, -50, 0, 100), 0, 100); return constrain(map(rssi, -100, -50, 0, 100), 0, 100);
} }
@@ -397,11 +397,11 @@ namespace NetworkUtils {
const char* hostname = "esp"; const char* hostname = "esp";
const char* apName = "ESP"; const char* apName = "ESP";
const char* apPassword = nullptr; const char* apPassword = nullptr;
uint8_t apChannel = 1; byte apChannel = 1;
const char* staSsid = nullptr; const char* staSsid = nullptr;
const char* staPassword = nullptr; const char* staPassword = nullptr;
uint8_t staChannel = 0; byte staChannel = 0;
bool useDhcp = true; bool useDhcp = true;
IPAddress staticIp; IPAddress staticIp;

View File

@@ -17,12 +17,12 @@ core_dir = .pio
version = 1.5.6 version = 1.5.6
framework = arduino framework = arduino
lib_deps = lib_deps =
bblanchon/ArduinoJson@^7.4.2 bblanchon/ArduinoJson@^7.3.0
;ihormelnyk/OpenTherm Library@^1.1.5 ;ihormelnyk/OpenTherm Library@^1.1.5
https://github.com/Laxilef/opentherm_library#esp32_timer https://github.com/Laxilef/opentherm_library#esp32_timer
arduino-libraries/ArduinoMqttClient@^0.1.8 arduino-libraries/ArduinoMqttClient@^0.1.8
lennarthennigs/ESP Telnet@^2.2.3 lennarthennigs/ESP Telnet@^2.2
gyverlibs/FileData@^1.0.3 gyverlibs/FileData@^1.0.2
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 https://github.com/pstolarz/Arduino-Temperature-Control-Library.git#OneWireNg
@@ -92,13 +92,13 @@ check_flags = ${env.check_flags}
;platform_packages = ;platform_packages =
; framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.5 ; framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.5
; 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 ; 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
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.34/platform-espressif32.zip platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.30-2/platform-espressif32.zip
platform_packages = ${env.platform_packages} platform_packages = ${env.platform_packages}
board_build.partitions = esp32_partitions.csv board_build.partitions = esp32_partitions.csv
lib_deps = lib_deps =
${env.lib_deps} ${env.lib_deps}
laxilef/ESP32Scheduler@^1.0.1 laxilef/ESP32Scheduler@^1.0.1
nimble_lib = h2zero/NimBLE-Arduino@2.3.7 nimble_lib = h2zero/NimBLE-Arduino@^2.1.0
lib_ignore = lib_ignore =
extra_scripts = extra_scripts =
post:tools/esp32.py post:tools/esp32.py
@@ -234,7 +234,7 @@ build_flags =
${esp32_defaults.build_flags} ${esp32_defaults.build_flags}
-D ARDUINO_USB_MODE=0 -D ARDUINO_USB_MODE=0
-D ARDUINO_USB_CDC_ON_BOOT=1 -D ARDUINO_USB_CDC_ON_BOOT=1
-D MYNEWT_VAL_BLE_EXT_ADV=1 -D CONFIG_BT_NIMBLE_EXT_ADV=1
-D USE_BLE=1 -D USE_BLE=1
-D DEFAULT_OT_IN_GPIO=35 -D DEFAULT_OT_IN_GPIO=35
-D DEFAULT_OT_OUT_GPIO=36 -D DEFAULT_OT_OUT_GPIO=36
@@ -260,7 +260,7 @@ build_unflags =
build_type = ${esp32_defaults.build_type} build_type = ${esp32_defaults.build_type}
build_flags = build_flags =
${esp32_defaults.build_flags} ${esp32_defaults.build_flags}
-D MYNEWT_VAL_BLE_EXT_ADV=1 -D CONFIG_BT_NIMBLE_EXT_ADV=1
-D USE_BLE=1 -D USE_BLE=1
-D DEFAULT_OT_IN_GPIO=8 -D DEFAULT_OT_IN_GPIO=8
-D DEFAULT_OT_OUT_GPIO=10 -D DEFAULT_OT_OUT_GPIO=10
@@ -294,10 +294,6 @@ build_flags =
check_tool = ${esp32_defaults.check_tool} check_tool = ${esp32_defaults.check_tool}
check_flags = ${esp32_defaults.check_flags} check_flags = ${esp32_defaults.check_flags}
[env:nodemcu_32_160mhz]
extends = env:nodemcu_32
board_build.f_cpu = 160000000L ; set frequency to 160MHz
[env:d1_mini32] [env:d1_mini32]
platform = ${esp32_defaults.platform} platform = ${esp32_defaults.platform}
platform_packages = ${esp32_defaults.platform_packages} platform_packages = ${esp32_defaults.platform_packages}
@@ -366,7 +362,7 @@ build_unflags =
build_type = ${esp32_defaults.build_type} build_type = ${esp32_defaults.build_type}
build_flags = build_flags =
${esp32_defaults.build_flags} ${esp32_defaults.build_flags}
-D MYNEWT_VAL_BLE_EXT_ADV=1 -D CONFIG_BT_NIMBLE_EXT_ADV=1
-D USE_BLE=1 -D USE_BLE=1
-D DEFAULT_OT_IN_GPIO=3 -D DEFAULT_OT_IN_GPIO=3
-D DEFAULT_OT_OUT_GPIO=1 -D DEFAULT_OT_OUT_GPIO=1

View File

@@ -3,8 +3,8 @@
class HaHelper : public HomeAssistantHelper { class HaHelper : public HomeAssistantHelper {
public: public:
static const uint8_t TEMP_SOURCE_HEATING = 0; static const byte TEMP_SOURCE_HEATING = 0;
static const uint8_t TEMP_SOURCE_INDOOR = 1; static const byte TEMP_SOURCE_INDOOR = 1;
static const char AVAILABILITY_OT_CONN[]; static const char AVAILABILITY_OT_CONN[];
static const char AVAILABILITY_SENSOR_CONN[]; static const char AVAILABILITY_SENSOR_CONN[];
@@ -261,13 +261,8 @@ public:
} }
// object id's // object id's
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(objId.c_str()); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(objId.c_str());
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix( doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
sSensor.type == Sensors::Type::MANUAL
? FPSTR(HA_ENTITY_NUMBER)
: FPSTR(HA_ENTITY_SENSOR),
objId.c_str()
);
const String& configTopic = this->makeConfigTopic( const String& configTopic = this->makeConfigTopic(
sSensor.type == Sensors::Type::MANUAL ? FPSTR(HA_ENTITY_NUMBER) : FPSTR(HA_ENTITY_SENSOR), sSensor.type == Sensors::Type::MANUAL ? FPSTR(HA_ENTITY_NUMBER) : FPSTR(HA_ENTITY_SENSOR),
@@ -328,8 +323,8 @@ public:
String objId = Sensors::makeObjectIdWithSuffix(sSensor.name, F("connected")); String objId = Sensors::makeObjectIdWithSuffix(sSensor.name, F("connected"));
// object id's // object id's
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(objId.c_str()); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(objId.c_str());
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BINARY_SENSOR), objId.c_str()); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
// state topic // state topic
doc[FPSTR(HA_STATE_TOPIC)] = this->getDeviceTopic( doc[FPSTR(HA_STATE_TOPIC)] = this->getDeviceTopic(
@@ -375,8 +370,8 @@ public:
String objId = Sensors::makeObjectIdWithSuffix(sSensor.name, F("signal_quality")); String objId = Sensors::makeObjectIdWithSuffix(sSensor.name, F("signal_quality"));
// object id's // object id's
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(objId.c_str()); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(objId.c_str());
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_SENSOR), objId.c_str()); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
// state topic // state topic
doc[FPSTR(HA_STATE_TOPIC)] = this->getDeviceTopic( doc[FPSTR(HA_STATE_TOPIC)] = this->getDeviceTopic(
@@ -412,6 +407,7 @@ public:
} }
bool deleteSignalQualityDynamicSensor(Sensors::Settings& sSensor) { bool deleteSignalQualityDynamicSensor(Sensors::Settings& sSensor) {
JsonDocument doc;
const String& configTopic = this->makeConfigTopic( const String& configTopic = this->makeConfigTopic(
FPSTR(HA_ENTITY_SENSOR), FPSTR(HA_ENTITY_SENSOR),
Sensors::makeObjectIdWithSuffix(sSensor.name, F("signal_quality")).c_str() Sensors::makeObjectIdWithSuffix(sSensor.name, F("signal_quality")).c_str()
@@ -425,8 +421,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("heating_turbo")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("heating_turbo"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_SWITCH), F("heating_turbo")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_NAME)] = F("Turbo heating"); doc[FPSTR(HA_NAME)] = F("Turbo heating");
doc[FPSTR(HA_ICON)] = F("mdi:rocket-launch-outline"); doc[FPSTR(HA_ICON)] = F("mdi:rocket-launch-outline");
@@ -443,34 +439,12 @@ 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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("heating_hysteresis")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("heating_hysteresis"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("heating_hysteresis")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE); doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE);
@@ -484,9 +458,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;
@@ -501,8 +475,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("heating_turbo_factor")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("heating_turbo_factor"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("heating_turbo_factor")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = F("power_factor"); doc[FPSTR(HA_DEVICE_CLASS)] = F("power_factor");
doc[FPSTR(HA_NAME)] = F("Heating turbo factor"); doc[FPSTR(HA_NAME)] = F("Heating turbo factor");
@@ -525,8 +499,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("heating_min_temp")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("heating_min_temp"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("heating_min_temp")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE); doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE);
@@ -559,8 +533,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("heating_max_temp")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("heating_max_temp"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("heating_max_temp")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE); doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE);
@@ -594,8 +568,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("dhw_min_temp")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("dhw_min_temp"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("dhw_min_temp")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE); doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE);
@@ -628,8 +602,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("dhw_max_temp")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("dhw_max_temp"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("dhw_max_temp")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE); doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE);
@@ -663,8 +637,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("pid")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("pid"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_SWITCH), F("pid")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_NAME)] = F("PID"); doc[FPSTR(HA_NAME)] = F("PID");
doc[FPSTR(HA_ICON)] = F("mdi:chart-bar-stacked"); doc[FPSTR(HA_ICON)] = F("mdi:chart-bar-stacked");
@@ -685,8 +659,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("pid_p")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("pid_p"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("pid_p")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_NAME)] = F("PID factor P"); doc[FPSTR(HA_NAME)] = F("PID factor P");
doc[FPSTR(HA_ICON)] = F("mdi:alpha-p-circle-outline"); doc[FPSTR(HA_ICON)] = F("mdi:alpha-p-circle-outline");
@@ -708,8 +682,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("pid_i")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("pid_i"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("pid_i")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_NAME)] = F("PID factor I"); doc[FPSTR(HA_NAME)] = F("PID factor I");
doc[FPSTR(HA_ICON)] = F("mdi:alpha-i-circle-outline"); doc[FPSTR(HA_ICON)] = F("mdi:alpha-i-circle-outline");
@@ -731,8 +705,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("pid_d")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("pid_d"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("pid_d")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_NAME)] = F("PID factor D"); doc[FPSTR(HA_NAME)] = F("PID factor D");
doc[FPSTR(HA_ICON)] = F("mdi:alpha-d-circle-outline"); doc[FPSTR(HA_ICON)] = F("mdi:alpha-d-circle-outline");
@@ -754,8 +728,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("pid_dt")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("pid_dt"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("pid_dt")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = F("duration"); doc[FPSTR(HA_DEVICE_CLASS)] = F("duration");
doc[FPSTR(HA_UNIT_OF_MEASUREMENT)] = F("s"); doc[FPSTR(HA_UNIT_OF_MEASUREMENT)] = F("s");
@@ -779,8 +753,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("pid_min_temp")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("pid_min_temp"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("pid_min_temp")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE); doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE);
@@ -813,8 +787,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("pid_max_temp")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("pid_max_temp"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("pid_max_temp")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE); doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE);
@@ -848,8 +822,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("equitherm")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("equitherm"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_SWITCH), F("equitherm")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_NAME)] = F("Equitherm"); doc[FPSTR(HA_NAME)] = F("Equitherm");
doc[FPSTR(HA_ICON)] = F("mdi:sun-snowflake-variant"); doc[FPSTR(HA_ICON)] = F("mdi:sun-snowflake-variant");
@@ -870,8 +844,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("equitherm_slope")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("equitherm_slope"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("equitherm_slope")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_NAME)] = F("Equitherm slope"); doc[FPSTR(HA_NAME)] = F("Equitherm slope");
doc[FPSTR(HA_ICON)] = F("mdi:slope-uphill"); doc[FPSTR(HA_ICON)] = F("mdi:slope-uphill");
@@ -893,8 +867,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("equitherm_exponent")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("equitherm_exponent"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("equitherm_exponent")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_NAME)] = F("Equitherm exponent"); doc[FPSTR(HA_NAME)] = F("Equitherm exponent");
doc[FPSTR(HA_ICON)] = F("mdi:exponent"); doc[FPSTR(HA_ICON)] = F("mdi:exponent");
@@ -916,8 +890,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("equitherm_shift")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("equitherm_shift"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("equitherm_shift")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE); doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE);
doc[FPSTR(HA_NAME)] = F("Equitherm shift"); doc[FPSTR(HA_NAME)] = F("Equitherm shift");
@@ -943,8 +917,8 @@ public:
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = F("{{ iif(value_json.pid.enabled, 'offline', 'online') }}"); doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = F("{{ iif(value_json.pid.enabled, 'offline', 'online') }}");
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all"); doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("equitherm_target_diff_factor")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("equitherm_target_diff_factor"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("equitherm_target_diff_factor")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_NAME)] = F("Equitherm target diff factor"); doc[FPSTR(HA_NAME)] = F("Equitherm target diff factor");
doc[FPSTR(HA_ICON)] = F("mdi:chart-timeline-variant-shimmer"); doc[FPSTR(HA_ICON)] = F("mdi:chart-timeline-variant-shimmer");
@@ -966,8 +940,8 @@ public:
bool publishStatusState(bool enabledByDefault = true) { bool publishStatusState(bool enabledByDefault = true) {
JsonDocument doc; JsonDocument doc;
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("status")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("status"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BINARY_SENSOR), F("status")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_DEVICE_CLASS)] = F("problem"); doc[FPSTR(HA_DEVICE_CLASS)] = F("problem");
doc[FPSTR(HA_NAME)] = F("Status"); doc[FPSTR(HA_NAME)] = F("Status");
@@ -984,8 +958,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("emergency")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("emergency"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BINARY_SENSOR), F("emergency")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_DEVICE_CLASS)] = F("problem"); doc[FPSTR(HA_DEVICE_CLASS)] = F("problem");
doc[FPSTR(HA_NAME)] = F("Emergency"); doc[FPSTR(HA_NAME)] = F("Emergency");
@@ -1002,8 +976,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("ot_status")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("ot_status"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BINARY_SENSOR), F("ot_status")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_DEVICE_CLASS)] = F("connectivity"); doc[FPSTR(HA_DEVICE_CLASS)] = F("connectivity");
doc[FPSTR(HA_NAME)] = F("Opentherm status"); doc[FPSTR(HA_NAME)] = F("Opentherm status");
@@ -1023,8 +997,9 @@ public:
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true); doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true);
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all"); doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("heating")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("heating"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BINARY_SENSOR), F("heating")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
//doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_DEVICE_CLASS)] = F("running"); doc[FPSTR(HA_DEVICE_CLASS)] = F("running");
doc[FPSTR(HA_NAME)] = F("Heating"); doc[FPSTR(HA_NAME)] = F("Heating");
doc[FPSTR(HA_ICON)] = F("mdi:radiator"); doc[FPSTR(HA_ICON)] = F("mdi:radiator");
@@ -1043,8 +1018,9 @@ public:
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true); doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true);
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all"); doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("dhw")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("dhw"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BINARY_SENSOR), F("dhw")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
//doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_DEVICE_CLASS)] = F("running"); doc[FPSTR(HA_DEVICE_CLASS)] = F("running");
doc[FPSTR(HA_NAME)] = F("DHW"); doc[FPSTR(HA_NAME)] = F("DHW");
doc[FPSTR(HA_ICON)] = F("mdi:faucet"); doc[FPSTR(HA_ICON)] = F("mdi:faucet");
@@ -1063,8 +1039,9 @@ public:
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true); doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true);
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all"); doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("flame")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("flame"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BINARY_SENSOR), F("flame")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
//doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_DEVICE_CLASS)] = F("running"); doc[FPSTR(HA_DEVICE_CLASS)] = F("running");
doc[FPSTR(HA_NAME)] = F("Flame"); doc[FPSTR(HA_NAME)] = F("Flame");
doc[FPSTR(HA_ICON)] = F("mdi:gas-burner"); doc[FPSTR(HA_ICON)] = F("mdi:gas-burner");
@@ -1083,8 +1060,8 @@ public:
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true); doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true);
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all"); doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("fault")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("fault"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BINARY_SENSOR), F("fault")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_DEVICE_CLASS)] = F("problem"); doc[FPSTR(HA_DEVICE_CLASS)] = F("problem");
doc[FPSTR(HA_NAME)] = F("Fault"); doc[FPSTR(HA_NAME)] = F("Fault");
@@ -1104,8 +1081,8 @@ public:
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true); doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true);
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all"); doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC)); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BINARY_SENSOR), FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC)); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_DEVICE_CLASS)] = F("problem"); doc[FPSTR(HA_DEVICE_CLASS)] = F("problem");
doc[FPSTR(HA_NAME)] = F("Diagnostic"); doc[FPSTR(HA_NAME)] = F("Diagnostic");
@@ -1122,8 +1099,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("ext_pump")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("ext_pump"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BINARY_SENSOR), F("ext_pump")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_DEVICE_CLASS)] = F("running"); doc[FPSTR(HA_DEVICE_CLASS)] = F("running");
doc[FPSTR(HA_NAME)] = F("External pump"); doc[FPSTR(HA_NAME)] = F("External pump");
@@ -1143,8 +1120,8 @@ public:
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = F("{{ iif(value_json.slave.connected and value_json.slave.fault.active, 'online', 'offline') }}"); doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = F("{{ iif(value_json.slave.connected and value_json.slave.fault.active, 'online', 'offline') }}");
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all"); doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("fault_code")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("fault_code"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_SENSOR), F("fault_code")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_NAME)] = F("Fault code"); doc[FPSTR(HA_NAME)] = F("Fault code");
doc[FPSTR(HA_ICON)] = F("mdi:cog-box"); doc[FPSTR(HA_ICON)] = F("mdi:cog-box");
@@ -1163,8 +1140,8 @@ public:
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = F("{{ iif(value_json.slave.connected and value_json.slave.fault.active or value_json.slave.diag.active, 'online', 'offline') }}"); doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = F("{{ iif(value_json.slave.connected and value_json.slave.fault.active or value_json.slave.diag.active, 'online', 'offline') }}");
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all"); doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("diagnostic_code")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("diagnostic_code"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_SENSOR), F("diagnostic_code")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_NAME)] = F("Diagnostic code"); doc[FPSTR(HA_NAME)] = F("Diagnostic code");
doc[FPSTR(HA_ICON)] = F("mdi:information-box"); doc[FPSTR(HA_ICON)] = F("mdi:information-box");
@@ -1180,8 +1157,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(FPSTR(S_RSSI)); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(FPSTR(S_RSSI));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_SENSOR), FPSTR(S_RSSI)); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_DEVICE_CLASS)] = F("signal_strength"); doc[FPSTR(HA_DEVICE_CLASS)] = F("signal_strength");
doc[FPSTR(HA_STATE_CLASS)] = FPSTR(HA_STATE_CLASS_MEASUREMENT); doc[FPSTR(HA_STATE_CLASS)] = FPSTR(HA_STATE_CLASS_MEASUREMENT);
@@ -1200,8 +1177,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("uptime")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("uptime"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_SENSOR), F("uptime")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_DEVICE_CLASS)] = F("duration"); doc[FPSTR(HA_DEVICE_CLASS)] = F("duration");
doc[FPSTR(HA_STATE_CLASS)] = F("total_increasing"); doc[FPSTR(HA_STATE_CLASS)] = F("total_increasing");
@@ -1217,12 +1194,12 @@ public:
} }
bool publishClimateHeating(UnitSystem unit = UnitSystem::METRIC, uint8_t minTemp = 20, uint8_t maxTemp = 90, bool enabledByDefault = true) { bool publishClimateHeating(UnitSystem unit = UnitSystem::METRIC, byte minTemp = 20, byte maxTemp = 90, 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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("heating")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("heating"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_CLIMATE), F("heating")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_NAME)] = F("Heating"); doc[FPSTR(HA_NAME)] = F("Heating");
doc[FPSTR(HA_ICON)] = F("mdi:radiator"); doc[FPSTR(HA_ICON)] = F("mdi:radiator");
@@ -1269,12 +1246,12 @@ public:
return this->publish(this->makeConfigTopic(FPSTR(HA_ENTITY_CLIMATE), F("heating"), '_').c_str(), doc); return this->publish(this->makeConfigTopic(FPSTR(HA_ENTITY_CLIMATE), F("heating"), '_').c_str(), doc);
} }
bool publishClimateDhw(UnitSystem unit = UnitSystem::METRIC, uint8_t minTemp = 40, uint8_t maxTemp = 60, bool enabledByDefault = true) { bool publishClimateDhw(UnitSystem unit = UnitSystem::METRIC, byte minTemp = 40, byte maxTemp = 60, 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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("dhw")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("dhw"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_CLIMATE), F("dhw")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_NAME)] = F("DHW"); doc[FPSTR(HA_NAME)] = F("DHW");
doc[FPSTR(HA_ICON)] = F("mdi:faucet"); doc[FPSTR(HA_ICON)] = F("mdi:faucet");
@@ -1318,8 +1295,8 @@ public:
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();
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(FPSTR(S_RESTART)); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(FPSTR(S_RESTART));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BUTTON), FPSTR(S_RESTART)); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_RESTART); doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_RESTART);
doc[FPSTR(HA_NAME)] = F("Restart"); doc[FPSTR(HA_NAME)] = F("Restart");
@@ -1338,8 +1315,8 @@ public:
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = F("{{ iif(value_json.slave.fault.active, 'online', 'offline') }}"); doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = F("{{ iif(value_json.slave.fault.active, 'online', 'offline') }}");
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all"); doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("reset_fault")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("reset_fault"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BUTTON), F("reset_fault")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_RESTART); doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_RESTART);
doc[FPSTR(HA_NAME)] = F("Reset fault"); doc[FPSTR(HA_NAME)] = F("Reset fault");
@@ -1358,8 +1335,8 @@ public:
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = F("{{ iif(value_json.slave.diag.active, 'online', 'offline') }}"); doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = F("{{ iif(value_json.slave.diag.active, 'online', 'offline') }}");
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all"); doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("reset_diagnostic")); doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("reset_diagnostic"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BUTTON), F("reset_diagnostic")); doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG); doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_RESTART); doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_RESTART);
doc[FPSTR(HA_NAME)] = F("Reset diagnostic"); doc[FPSTR(HA_NAME)] = F("Reset diagnostic");

View File

@@ -319,7 +319,7 @@ protected:
emergencyFlags |= 0b00000010; emergencyFlags |= 0b00000010;
} }
if (settings.opentherm.options.nativeOTC) { if (settings.opentherm.options.nativeHeatingControl) {
emergencyFlags |= 0b00000100; emergencyFlags |= 0b00000100;
} }
} }
@@ -609,12 +609,7 @@ protected:
if (GPIO_IS_VALID(settings.externalPump.gpio)) { if (GPIO_IS_VALID(settings.externalPump.gpio)) {
configuredGpio = settings.externalPump.gpio; configuredGpio = settings.externalPump.gpio;
pinMode(configuredGpio, OUTPUT); pinMode(configuredGpio, OUTPUT);
digitalWrite( digitalWrite(configuredGpio, LOW);
configuredGpio,
settings.externalPump.invertState
? HIGH
: LOW
);
} else if (configuredGpio != GPIO_IS_NOT_CONFIGURED) { } else if (configuredGpio != GPIO_IS_NOT_CONFIGURED) {
configuredGpio = GPIO_IS_NOT_CONFIGURED; configuredGpio = GPIO_IS_NOT_CONFIGURED;
@@ -642,12 +637,7 @@ protected:
if (!settings.externalPump.use) { if (!settings.externalPump.use) {
if (vars.externalPump.state) { if (vars.externalPump.state) {
digitalWrite( digitalWrite(configuredGpio, LOW);
configuredGpio,
settings.externalPump.invertState
? HIGH
: LOW
);
vars.externalPump.state = false; vars.externalPump.state = false;
vars.externalPump.lastEnabledTime = millis(); vars.externalPump.lastEnabledTime = millis();
@@ -660,12 +650,7 @@ protected:
if (vars.externalPump.state && !this->heatingEnabled) { if (vars.externalPump.state && !this->heatingEnabled) {
if (this->extPumpStartReason == MainTask::PumpStartReason::HEATING && millis() - this->heatingDisabledTime > (settings.externalPump.postCirculationTime * 1000u)) { if (this->extPumpStartReason == MainTask::PumpStartReason::HEATING && millis() - this->heatingDisabledTime > (settings.externalPump.postCirculationTime * 1000u)) {
digitalWrite( digitalWrite(configuredGpio, LOW);
configuredGpio,
settings.externalPump.invertState
? HIGH
: LOW
);
vars.externalPump.state = false; vars.externalPump.state = false;
vars.externalPump.lastEnabledTime = millis(); vars.externalPump.lastEnabledTime = millis();
@@ -673,12 +658,7 @@ protected:
Log.sinfoln(FPSTR(L_EXTPUMP), F("Disabled: expired post circulation time")); Log.sinfoln(FPSTR(L_EXTPUMP), F("Disabled: expired post circulation time"));
} else if (this->extPumpStartReason == MainTask::PumpStartReason::ANTISTUCK && millis() - this->externalPumpStartTime >= (settings.externalPump.antiStuckTime * 1000u)) { } else if (this->extPumpStartReason == MainTask::PumpStartReason::ANTISTUCK && millis() - this->externalPumpStartTime >= (settings.externalPump.antiStuckTime * 1000u)) {
digitalWrite( digitalWrite(configuredGpio, LOW);
configuredGpio,
settings.externalPump.invertState
? HIGH
: LOW
);
vars.externalPump.state = false; vars.externalPump.state = false;
vars.externalPump.lastEnabledTime = millis(); vars.externalPump.lastEnabledTime = millis();
@@ -694,12 +674,7 @@ protected:
this->externalPumpStartTime = millis(); this->externalPumpStartTime = millis();
this->extPumpStartReason = MainTask::PumpStartReason::HEATING; this->extPumpStartReason = MainTask::PumpStartReason::HEATING;
digitalWrite( digitalWrite(configuredGpio, HIGH);
configuredGpio,
settings.externalPump.invertState
? LOW
: HIGH
);
Log.sinfoln(FPSTR(L_EXTPUMP), F("Enabled: heating on")); Log.sinfoln(FPSTR(L_EXTPUMP), F("Enabled: heating on"));
@@ -708,12 +683,7 @@ protected:
this->externalPumpStartTime = millis(); this->externalPumpStartTime = millis();
this->extPumpStartReason = MainTask::PumpStartReason::ANTISTUCK; this->extPumpStartReason = MainTask::PumpStartReason::ANTISTUCK;
digitalWrite( digitalWrite(configuredGpio, HIGH);
configuredGpio,
settings.externalPump.invertState
? LOW
: HIGH
);
Log.sinfoln(FPSTR(L_EXTPUMP), F("Enabled: anti stuck")); Log.sinfoln(FPSTR(L_EXTPUMP), F("Enabled: anti stuck"));
} }

View File

@@ -486,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);
@@ -559,7 +558,7 @@ protected:
} }
bool publishNonStaticHaEntities(bool force = false) { bool publishNonStaticHaEntities(bool force = false) {
static uint8_t _heatingMinTemp, _heatingMaxTemp, _dhwMinTemp, _dhwMaxTemp = 0; static byte _heatingMinTemp, _heatingMaxTemp, _dhwMinTemp, _dhwMaxTemp = 0;
static bool _indoorTempControl, _dhwSupport = false; static bool _indoorTempControl, _dhwSupport = false;
bool published = false; bool published = false;

View File

@@ -19,8 +19,8 @@ protected:
CustomOpenTherm* instance = nullptr; CustomOpenTherm* instance = nullptr;
unsigned long instanceCreatedTime = 0; unsigned long instanceCreatedTime = 0;
uint8_t instanceInGpio = 0; byte instanceInGpio = 0;
uint8_t instanceOutGpio = 0; byte instanceOutGpio = 0;
bool initialized = false; bool initialized = false;
unsigned long connectedTime = 0; unsigned long connectedTime = 0;
unsigned long disconnectedTime = 0; unsigned long disconnectedTime = 0;
@@ -31,7 +31,7 @@ protected:
unsigned long heatingSetTempTime = 0; unsigned long heatingSetTempTime = 0;
unsigned long dhwSetTempTime = 0; unsigned long dhwSetTempTime = 0;
unsigned long ch2SetTempTime = 0; unsigned long ch2SetTempTime = 0;
uint8_t configuredRxLedGpio = GPIO_IS_NOT_CONFIGURED; byte configuredRxLedGpio = GPIO_IS_NOT_CONFIGURED;
#if defined(ARDUINO_ARCH_ESP32) #if defined(ARDUINO_ARCH_ESP32)
const char* getTaskName() override { const char* getTaskName() override {
@@ -90,7 +90,7 @@ protected:
Log.sinfoln(FPSTR(L_OT), F("Started. GPIO IN: %hhu, GPIO OUT: %hhu"), settings.opentherm.inGpio, settings.opentherm.outGpio); Log.sinfoln(FPSTR(L_OT), F("Started. GPIO IN: %hhu, GPIO OUT: %hhu"), settings.opentherm.inGpio, settings.opentherm.outGpio);
this->instance->setAfterSendRequestCallback([this](unsigned long request, unsigned long response, OpenThermResponseStatus status, uint8_t attempt) { this->instance->setAfterSendRequestCallback([this](unsigned long request, unsigned long response, OpenThermResponseStatus status, byte attempt) {
Log.sverboseln( Log.sverboseln(
FPSTR(L_OT), FPSTR(L_OT),
F("ID: %4d Request: %8lx Response: %8lx Msg type: %s Attempt: %2d Status: %s"), F("ID: %4d Request: %8lx Response: %8lx Msg type: %s Attempt: %2d Status: %s"),
@@ -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,
@@ -238,7 +236,7 @@ protected:
vars.slave.heating.active = CustomOpenTherm::isCentralHeatingActive(response); vars.slave.heating.active = CustomOpenTherm::isCentralHeatingActive(response);
vars.slave.dhw.active = settings.opentherm.options.dhwSupport ? CustomOpenTherm::isHotWaterActive(response) : false; vars.slave.dhw.active = settings.opentherm.options.dhwSupport ? CustomOpenTherm::isHotWaterActive(response) : false;
vars.slave.flame = CustomOpenTherm::isFlameOn(response); vars.slave.flame = CustomOpenTherm::isFlameOn(response);
vars.slave.cooling.active = CustomOpenTherm::isCoolingActive(response); vars.slave.cooling = CustomOpenTherm::isCoolingActive(response);
vars.slave.ch2.active = CustomOpenTherm::isCh2Active(response); vars.slave.ch2.active = CustomOpenTherm::isCh2Active(response);
vars.slave.fault.active = CustomOpenTherm::isFault(response); vars.slave.fault.active = CustomOpenTherm::isFault(response);
@@ -252,7 +250,7 @@ protected:
Log.snoticeln( Log.snoticeln(
FPSTR(L_OT), F("Received boiler status. Heating: %hhu; DHW: %hhu; flame: %hhu; cooling: %hhu; channel 2: %hhu; fault: %hhu; diag: %hhu"), FPSTR(L_OT), F("Received boiler status. Heating: %hhu; DHW: %hhu; flame: %hhu; cooling: %hhu; channel 2: %hhu; fault: %hhu; diag: %hhu"),
vars.slave.heating.active, vars.slave.dhw.active, vars.slave.heating.active, vars.slave.dhw.active,
vars.slave.flame, vars.slave.cooling.active, vars.slave.ch2.active, vars.slave.fault.active, vars.slave.diag.active vars.slave.flame, vars.slave.cooling, vars.slave.ch2.active, vars.slave.fault.active, vars.slave.diag.active
); );
} }
@@ -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();
@@ -321,8 +318,6 @@ protected:
vars.slave.dhw.enabled = false; vars.slave.dhw.enabled = false;
vars.slave.dhw.active = false; vars.slave.dhw.active = false;
vars.slave.flame = false; vars.slave.flame = false;
vars.slave.cooling.active = false;
vars.slave.cooling.setpoint = 0;
vars.slave.fault.active = false; vars.slave.fault.active = false;
vars.slave.fault.code = 0; vars.slave.fault.code = 0;
vars.slave.diag.active = false; vars.slave.diag.active = false;
@@ -680,21 +675,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;
@@ -708,22 +688,6 @@ protected:
this->prevUpdateNonEssentialVars = millis(); this->prevUpdateNonEssentialVars = millis();
} }
// Set cooling setpoint = heating max modulation
if (settings.opentherm.options.coolingSupport) {
if (this->setCoolingSetpoint(settings.heating.maxModulation)) {
Log.snoticeln(
FPSTR(L_OT), F("Set cooling setpoint: %hhu%% (response: %hhu%%)"),
settings.heating.maxModulation, vars.slave.cooling.setpoint
);
} else {
Log.swarningln(
FPSTR(L_OT), F("Failed set cooling setpoint: %hhu%% (response: %hhu%%)"),
settings.heating.maxModulation, vars.slave.cooling.setpoint
);
}
}
// Set max modulation level // Set max modulation level
uint8_t targetMaxModulation = vars.slave.modulation.max; uint8_t targetMaxModulation = vars.slave.modulation.max;
if (vars.slave.heating.active) { if (vars.slave.heating.active) {
@@ -810,7 +774,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 +798,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 +822,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 +846,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 +870,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 +893,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 +920,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 +944,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 +968,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 +992,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 +1016,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 +1062,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 +1168,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 +1182,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 +1191,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 +1212,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 +1231,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 +1246,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 +1255,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 +1266,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 +1283,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 +1293,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 +1321,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 +1358,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 +1452,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() {
@@ -1647,26 +1568,6 @@ protected:
return CustomOpenTherm::getUInt(response) == request; return CustomOpenTherm::getUInt(response) == request;
} }
bool setCoolingSetpoint(const uint8_t value) {
const unsigned int request = CustomOpenTherm::toFloat(value);
const unsigned long response = this->instance->sendRequest(CustomOpenTherm::buildRequest(
OpenThermRequestType::WRITE_DATA,
OpenThermMessageID::CoolingControl,
request
));
if (!CustomOpenTherm::isValidResponse(response)) {
return false;
} else if (!CustomOpenTherm::isValidResponseId(response, OpenThermMessageID::CoolingControl)) {
return false;
}
vars.slave.cooling.setpoint = CustomOpenTherm::getFloat(response);
return CustomOpenTherm::getUInt(response) == request;
}
bool setMaxModulationLevel(const uint8_t value) { bool setMaxModulationLevel(const uint8_t value) {
const unsigned int request = CustomOpenTherm::toFloat(value); const unsigned int request = CustomOpenTherm::toFloat(value);
const unsigned long response = this->instance->sendRequest(CustomOpenTherm::buildRequest( const unsigned long response = this->instance->sendRequest(CustomOpenTherm::buildRequest(
@@ -1708,7 +1609,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 +1629,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 +2131,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 +2145,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 +2169,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 +2193,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 +2247,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 +2311,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 +2335,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 +2436,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;
} }

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) {
@@ -204,8 +204,7 @@ protected:
}*/ }*/
float error = pidRegulator.setpoint - pidRegulator.input; float error = pidRegulator.setpoint - pidRegulator.input;
bool hasDeadband = settings.pid.deadband.enabled bool hasDeadband = (error > -(settings.pid.deadband.thresholdHigh))
&& (error > -(settings.pid.deadband.thresholdHigh))
&& (error < settings.pid.deadband.thresholdLow); && (error < settings.pid.deadband.thresholdLow);
if (hasDeadband) { if (hasDeadband) {

View File

@@ -34,7 +34,6 @@ 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,
@@ -150,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++) {
@@ -164,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;
@@ -330,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 false;
} }
float value = 0.0f; float value = 0.0f;
@@ -364,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

@@ -8,45 +8,6 @@
extern FileData fsSensorsSettings; extern FileData fsSensorsSettings;
#if USE_BLE
class BluetoothClientCallbacks : public NimBLEClientCallbacks {
public:
BluetoothClientCallbacks(uint8_t sensorId) : sensorId(sensorId) {}
void onConnect(NimBLEClient* pClient) {
auto& sSensor = Sensors::settings[this->sensorId];
Log.sinfoln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': connected to %s"),
sensorId, sSensor.name, pClient->getPeerAddress().toString().c_str()
);
}
void onDisconnect(NimBLEClient* pClient, int reason) {
auto& sSensor = Sensors::settings[this->sensorId];
Log.sinfoln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': disconnected, reason %i"),
sensorId, sSensor.name, reason
);
}
void onConnectFail(NimBLEClient* pClient, int reason) {
auto& sSensor = Sensors::settings[this->sensorId];
Log.sinfoln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': failed to connect, reason %i"),
sensorId, sSensor.name, reason
);
pClient->cancelConnect();
}
protected:
uint8_t sensorId;
};
#endif
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) {
@@ -80,7 +41,6 @@ protected:
std::unordered_map<uint8_t, bool> dallasPolling; std::unordered_map<uint8_t, bool> dallasPolling;
std::unordered_map<uint8_t, unsigned long> dallasLastPollingTime; std::unordered_map<uint8_t, unsigned long> dallasLastPollingTime;
#if USE_BLE #if USE_BLE
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;
#endif #endif
@@ -425,7 +385,7 @@ protected:
continue; continue;
} }
const float sensorResistance = value > 1 const float sensorResistance = value > 0.001f
? DEFAULT_NTC_REF_RESISTANCE / (DEFAULT_NTC_VREF / (float) value - 1.0f) ? DEFAULT_NTC_REF_RESISTANCE / (DEFAULT_NTC_VREF / (float) value - 1.0f)
: 0.0f; : 0.0f;
const float rawTemp = 1.0f / ( const float rawTemp = 1.0f / (
@@ -445,35 +405,47 @@ protected:
#if USE_BLE #if USE_BLE
void cleanBleInstances() { void cleanBleInstances() {
#if USE_BLE
if (!NimBLEDevice::isInitialized()) { if (!NimBLEDevice::isInitialized()) {
return; return;
} }
for (auto& [sensorId, pClient]: this->bleClients) { for (auto client : NimBLEDevice::getConnectedClients()) {
if (pClient == nullptr) { auto address = client->getPeerAddress();
continue; bool used = false;
for (uint8_t sensorId = 0; sensorId <= Sensors::getMaxSensorId(); sensorId++) {
auto& sSensor = Sensors::settings[sensorId];
if (!sSensor.enabled || sSensor.type != Sensors::Type::BLUETOOTH || sSensor.purpose == Sensors::Purpose::NOT_CONFIGURED) {
continue;
}
auto pAddress = address.getVal();
uint8_t addr[] = {
pAddress[5], pAddress[4], pAddress[3],
pAddress[2], pAddress[1], pAddress[0]
};
if (isEqualAddress(addr, sSensor.address, sizeof(addr))) {
used = true;
break;
}
} }
auto& sSensor = Sensors::settings[sensorId]; if (!used) {
const auto sAddress = NimBLEAddress(sSensor.address, 0);
if (sAddress.isNull() || !sSensor.enabled || sSensor.type != Sensors::Type::BLUETOOTH || sSensor.purpose == Sensors::Purpose::NOT_CONFIGURED) {
Log.sinfoln( Log.sinfoln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s', deleted unused client"), FPSTR(L_SENSORS_BLE), F("Deleted unused client connected to %s"),
sensorId, sSensor.name address.toString().c_str()
); );
NimBLEDevice::deleteClient(pClient); NimBLEDevice::deleteClient(client);
pClient = nullptr;
} }
} }
#endif
} }
void pollingBleSensors() { void pollingBleSensors() {
if (!Sensors::getAmountByType(Sensors::Type::BLUETOOTH, true)) {
return;
}
if (!NimBLEDevice::isInitialized() && millis() > 5000) { if (!NimBLEDevice::isInitialized() && millis() > 5000) {
Log.sinfoln(FPSTR(L_SENSORS_BLE), F("Initialized")); Log.sinfoln(FPSTR(L_SENSORS_BLE), F("Initialized"));
BLEDevice::init(""); BLEDevice::init("");
@@ -488,47 +460,38 @@ protected:
continue; continue;
} }
const auto address = NimBLEAddress(sSensor.address, 0); auto client = this->getBleClient(sensorId);
if (address.isNull()) { if (client == nullptr) {
continue; continue;
} }
auto pClient = this->getBleClient(sensorId); if (!client->isConnected()) {
if (pClient == nullptr) {
continue;
}
if (pClient->getPeerAddress() != address) {
if (pClient->isConnected()) {
if (!pClient->disconnect()) {
continue;
}
}
pClient->setPeerAddress(address);
}
if (!pClient->isConnected()) {
this->bleSubscribed[sensorId] = false; this->bleSubscribed[sensorId] = false;
this->bleLastSetDtTime[sensorId] = 0; this->bleLastSetDtTime[sensorId] = 0;
if (pClient->connect(false, true, true)) { if (client->connect()) {
Log.sinfoln( Log.sinfoln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': trying connecting to %s..."), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': connected to %s"),
sensorId, sSensor.name, pClient->getPeerAddress().toString().c_str() sensorId, sSensor.name, client->getPeerAddress().toString().c_str()
); );
}
continue; } else {
Log.swarningln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': failed connecting to %s"),
sensorId, sSensor.name, client->getPeerAddress().toString().c_str()
);
continue;
}
} }
if (!this->bleSubscribed[sensorId]) { if (!this->bleSubscribed[sensorId]) {
if (this->subscribeToBleDevice(sensorId, pClient)) { if (this->subscribeToBleDevice(sensorId, client)) {
this->bleSubscribed[sensorId] = true; this->bleSubscribed[sensorId] = true;
} else { } else {
this->bleSubscribed[sensorId] = false; this->bleSubscribed[sensorId] = false;
pClient->disconnect(); client->disconnect();
continue; continue;
} }
} }
@@ -540,7 +503,7 @@ protected:
struct tm ti; struct tm ti;
if (getLocalTime(&ti)) { if (getLocalTime(&ti)) {
if (this->setDateOnBleSensor(pClient, &ti)) { if (this->setDateOnBleSensor(client, &ti)) {
Log.sinfoln( Log.sinfoln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s', successfully set date: %02d.%02d.%04d %02d:%02d:%02d"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s', successfully set date: %02d.%02d.%04d %02d:%02d:%02d"),
sensorId, sSensor.name, sensorId, sSensor.name,
@@ -573,28 +536,48 @@ protected:
return nullptr; return nullptr;
} }
if (this->bleClients[sensorId] && this->bleClients[sensorId] != nullptr) { uint8_t addr[6] = {
return this->bleClients[sensorId]; sSensor.address[0], sSensor.address[1], sSensor.address[2],
} sSensor.address[3], sSensor.address[4], sSensor.address[5]
};
const auto address = NimBLEAddress(addr, 0);
auto pClient = NimBLEDevice::createClient(); NimBLEClient* pClient = NimBLEDevice::getClientByPeerAddress(address);
if (pClient == nullptr) { if (pClient == nullptr) {
return nullptr; pClient = NimBLEDevice::getDisconnectedClient();
} }
//pClient->setConnectionParams(BLE_GAP_CONN_ITVL_MS(10), BLE_GAP_CONN_ITVL_MS(100), 10, 150); if (pClient == nullptr) {
pClient->setConnectTimeout(30000); if (NimBLEDevice::getCreatedClientCount() >= NIMBLE_MAX_CONNECTIONS) {
pClient->setSelfDelete(false, false); return nullptr;
pClient->setClientCallbacks(new BluetoothClientCallbacks(sensorId), true); }
this->bleClients[sensorId] = pClient; pClient = NimBLEDevice::createClient();
if (pClient == nullptr) {
return nullptr;
}
/**
* Set initial connection parameters:
* These settings are safe for 3 clients to connect reliably, can go faster if you have less
* connections. Timeout should be a multiple of the interval, minimum is 100ms.
* Min interval: 12 * 1.25ms = 15, Max interval: 12 * 1.25ms = 15, 0 latency, 1000 * 10ms = 10000ms timeout
*/
pClient->setConnectionParams(12, 12, 0, 1000);
pClient->setConnectTimeout(5000);
pClient->setSelfDelete(false, true);
}
if (!pClient->isConnected()) {
pClient->setPeerAddress(address);
}
return pClient; return pClient;
} }
bool subscribeToBleDevice(const uint8_t sensorId, NimBLEClient* pClient) { bool subscribeToBleDevice(const uint8_t sensorId, NimBLEClient* pClient) {
auto& sSensor = Sensors::settings[sensorId]; auto& sSensor = Sensors::settings[sensorId];
auto pAddress = pClient->getPeerAddress().toString(); auto pAddress = pClient->getPeerAddress().toString().c_str();
NimBLERemoteService* pService = nullptr; NimBLERemoteService* pService = nullptr;
NimBLERemoteCharacteristic* pChar = nullptr; NimBLERemoteCharacteristic* pChar = nullptr;
@@ -605,13 +588,13 @@ protected:
if (!pService) { if (!pService) {
Log.straceln( Log.straceln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': failed to find env service (%s) on device %s"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': failed to find env service (%s) on device %s"),
sensorId, sSensor.name, serviceUuid.toString().c_str(), pAddress.c_str() sensorId, sSensor.name, serviceUuid.toString().c_str(), pAddress
); );
} else { } else {
Log.straceln( Log.straceln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': found env service (%s) on device %s"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': found env service (%s) on device %s"),
sensorId, sSensor.name, serviceUuid.toString().c_str(), pAddress.c_str() sensorId, sSensor.name, serviceUuid.toString().c_str(), pAddress
); );
// 0x2A6E - Notify temperature x0.01C (pvvx) // 0x2A6E - Notify temperature x0.01C (pvvx)
@@ -623,7 +606,7 @@ protected:
if (pChar && (pChar->canNotify() || pChar->canIndicate())) { if (pChar && (pChar->canNotify() || pChar->canIndicate())) {
Log.straceln( Log.straceln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': found temp char (%s) in env service on device %s"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': found temp char (%s) in env service on device %s"),
sensorId, sSensor.name, charUuid.toString().c_str(), pAddress.c_str() sensorId, sSensor.name, charUuid.toString().c_str(), pAddress
); );
pChar->unsubscribe(); pChar->unsubscribe();
@@ -678,14 +661,14 @@ protected:
Log.straceln( Log.straceln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': subscribed to temp char (%s) in env service on device %s"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': subscribed to temp char (%s) in env service on device %s"),
sensorId, sSensor.name, sensorId, sSensor.name,
charUuid.toString().c_str(), pAddress.c_str() charUuid.toString().c_str(), pAddress
); );
} else { } else {
Log.swarningln( Log.swarningln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': failed to subscribe to temp char (%s) in env service on device %s"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': failed to subscribe to temp char (%s) in env service on device %s"),
sensorId, sSensor.name, sensorId, sSensor.name,
charUuid.toString().c_str(), pAddress.c_str() charUuid.toString().c_str(), pAddress
); );
} }
} }
@@ -700,7 +683,7 @@ protected:
if (pChar && (pChar->canNotify() || pChar->canIndicate())) { if (pChar && (pChar->canNotify() || pChar->canIndicate())) {
Log.straceln( Log.straceln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': found temp char (%s) in env service on device %s"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': found temp char (%s) in env service on device %s"),
sensorId, sSensor.name, charUuid.toString().c_str(), pAddress.c_str() sensorId, sSensor.name, charUuid.toString().c_str(), pAddress
); );
pChar->unsubscribe(); pChar->unsubscribe();
@@ -755,14 +738,14 @@ protected:
Log.straceln( Log.straceln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': subscribed to temp char (%s) in env service on device %s"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': subscribed to temp char (%s) in env service on device %s"),
sensorId, sSensor.name, sensorId, sSensor.name,
charUuid.toString().c_str(), pAddress.c_str() charUuid.toString().c_str(), pAddress
); );
} else { } else {
Log.swarningln( Log.swarningln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': failed to subscribe to temp char (%s) in env service on device %s"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': failed to subscribe to temp char (%s) in env service on device %s"),
sensorId, sSensor.name, sensorId, sSensor.name,
charUuid.toString().c_str(), pAddress.c_str() charUuid.toString().c_str(), pAddress
); );
} }
} }
@@ -771,7 +754,7 @@ protected:
if (!tempNotifyCreated) { if (!tempNotifyCreated) {
Log.swarningln( Log.swarningln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': not found supported temp chars in env service on device %s"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': not found supported temp chars in env service on device %s"),
sensorId, sSensor.name, pAddress.c_str() sensorId, sSensor.name, pAddress
); );
pClient->disconnect(); pClient->disconnect();
@@ -789,7 +772,7 @@ protected:
if (pChar && (pChar->canNotify() || pChar->canIndicate())) { if (pChar && (pChar->canNotify() || pChar->canIndicate())) {
Log.straceln( Log.straceln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': found humidity char (%s) in env service on device %s"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': found humidity char (%s) in env service on device %s"),
sensorId, sSensor.name, charUuid.toString().c_str(), pAddress.c_str() sensorId, sSensor.name, charUuid.toString().c_str(), pAddress
); );
pChar->unsubscribe(); pChar->unsubscribe();
@@ -844,14 +827,14 @@ protected:
Log.straceln( Log.straceln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': subscribed to humidity char (%s) in env service on device %s"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': subscribed to humidity char (%s) in env service on device %s"),
sensorId, sSensor.name, sensorId, sSensor.name,
charUuid.toString().c_str(), pAddress.c_str() charUuid.toString().c_str(), pAddress
); );
} else { } else {
Log.swarningln( Log.swarningln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': failed to subscribe to humidity char (%s) in env service on device %s"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': failed to subscribe to humidity char (%s) in env service on device %s"),
sensorId, sSensor.name, sensorId, sSensor.name,
charUuid.toString().c_str(), pAddress.c_str() charUuid.toString().c_str(), pAddress
); );
} }
} }
@@ -860,7 +843,7 @@ protected:
if (!humidityNotifyCreated) { if (!humidityNotifyCreated) {
Log.swarningln( Log.swarningln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': not found supported humidity chars in env service on device %s"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': not found supported humidity chars in env service on device %s"),
sensorId, sSensor.name, pAddress.c_str() sensorId, sSensor.name, pAddress
); );
} }
} }
@@ -874,13 +857,13 @@ protected:
if (!pService) { if (!pService) {
Log.straceln( Log.straceln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': failed to find battery service (%s) on device %s"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': failed to find battery service (%s) on device %s"),
sensorId, sSensor.name, serviceUuid.toString().c_str(), pAddress.c_str() sensorId, sSensor.name, serviceUuid.toString().c_str(), pAddress
); );
} else { } else {
Log.straceln( Log.straceln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': found battery service (%s) on device %s"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': found battery service (%s) on device %s"),
sensorId, sSensor.name, serviceUuid.toString().c_str(), pAddress.c_str() sensorId, sSensor.name, serviceUuid.toString().c_str(), pAddress
); );
// 0x2A19 - Notify the battery charge level 0..99% (pvvx) // 0x2A19 - Notify the battery charge level 0..99% (pvvx)
@@ -892,7 +875,7 @@ protected:
if (pChar && (pChar->canNotify() || pChar->canIndicate())) { if (pChar && (pChar->canNotify() || pChar->canIndicate())) {
Log.straceln( Log.straceln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': found battery char (%s) in battery service on device %s"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': found battery char (%s) in battery service on device %s"),
sensorId, sSensor.name, charUuid.toString().c_str(), pAddress.c_str() sensorId, sSensor.name, charUuid.toString().c_str(), pAddress
); );
pChar->unsubscribe(); pChar->unsubscribe();
@@ -947,14 +930,14 @@ protected:
Log.straceln( Log.straceln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': subscribed to battery char (%s) in battery service on device %s"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': subscribed to battery char (%s) in battery service on device %s"),
sensorId, sSensor.name, sensorId, sSensor.name,
charUuid.toString().c_str(), pAddress.c_str() charUuid.toString().c_str(), pAddress
); );
} else { } else {
Log.swarningln( Log.swarningln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': failed to subscribe to battery char (%s) in battery service on device %s"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': failed to subscribe to battery char (%s) in battery service on device %s"),
sensorId, sSensor.name, sensorId, sSensor.name,
charUuid.toString().c_str(), pAddress.c_str() charUuid.toString().c_str(), pAddress
); );
} }
} }
@@ -963,7 +946,7 @@ protected:
if (!batteryNotifyCreated) { if (!batteryNotifyCreated) {
Log.swarningln( Log.swarningln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': not found supported battery chars in battery service on device %s"), FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': not found supported battery chars in battery service on device %s"),
sensorId, sSensor.name, pAddress.c_str() sensorId, sSensor.name, pAddress
); );
} }
} }

View File

@@ -12,13 +12,13 @@ struct NetworkSettings {
struct { struct {
char ssid[33] = DEFAULT_AP_SSID; char ssid[33] = DEFAULT_AP_SSID;
char password[65] = DEFAULT_AP_PASSWORD; char password[65] = DEFAULT_AP_PASSWORD;
uint8_t channel = 6; byte channel = 6;
} ap; } ap;
struct { struct {
char ssid[33] = DEFAULT_STA_SSID; char ssid[33] = DEFAULT_STA_SSID;
char password[65] = DEFAULT_STA_PASSWORD; char password[65] = DEFAULT_STA_PASSWORD;
uint8_t channel = 0; byte channel = 0;
} sta; } sta;
} networkSettings; } networkSettings;
@@ -42,7 +42,7 @@ struct Settings {
} ntp; } ntp;
UnitSystem unitSystem = UnitSystem::METRIC; UnitSystem unitSystem = UnitSystem::METRIC;
uint8_t statusLedGpio = DEFAULT_STATUS_LED_GPIO; byte statusLedGpio = DEFAULT_STATUS_LED_GPIO;
} system; } system;
struct { struct {
@@ -54,9 +54,9 @@ struct Settings {
struct { struct {
UnitSystem unitSystem = UnitSystem::METRIC; UnitSystem unitSystem = UnitSystem::METRIC;
uint8_t inGpio = DEFAULT_OT_IN_GPIO; byte inGpio = DEFAULT_OT_IN_GPIO;
uint8_t outGpio = DEFAULT_OT_OUT_GPIO; byte outGpio = DEFAULT_OT_OUT_GPIO;
uint8_t rxLedGpio = DEFAULT_OT_RX_LED_GPIO; byte rxLedGpio = DEFAULT_OT_RX_LED_GPIO;
uint8_t memberId = 0; uint8_t memberId = 0;
uint8_t flags = 0; uint8_t flags = 0;
float minPower = 0.0f; float minPower = 0.0f;
@@ -78,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;
@@ -104,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; byte minTemp = DEFAULT_HEATING_MIN_TEMP;
uint8_t maxTemp = DEFAULT_HEATING_MAX_TEMP; byte 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;
@@ -129,8 +123,8 @@ struct Settings {
struct { struct {
bool enabled = true; bool enabled = true;
float target = DEFAULT_DHW_TARGET_TEMP; float target = DEFAULT_DHW_TARGET_TEMP;
uint8_t minTemp = DEFAULT_DHW_MIN_TEMP; byte minTemp = DEFAULT_DHW_MIN_TEMP;
uint8_t maxTemp = DEFAULT_DHW_MAX_TEMP; byte maxTemp = DEFAULT_DHW_MAX_TEMP;
uint8_t maxModulation = 100; uint8_t maxModulation = 100;
struct { struct {
@@ -168,8 +162,7 @@ struct Settings {
struct { struct {
bool use = false; bool use = false;
uint8_t gpio = DEFAULT_EXT_PUMP_GPIO; byte gpio = DEFAULT_EXT_PUMP_GPIO;
bool invertState = false;
unsigned short postCirculationTime = 600; unsigned short postCirculationTime = 600;
unsigned int antiStuckInterval = 2592000; unsigned int antiStuckInterval = 2592000;
unsigned short antiStuckTime = 300; unsigned short antiStuckTime = 300;
@@ -178,15 +171,15 @@ struct Settings {
struct { struct {
struct { struct {
bool enabled = false; bool enabled = false;
uint8_t gpio = GPIO_IS_NOT_CONFIGURED; byte gpio = GPIO_IS_NOT_CONFIGURED;
bool invertState = false; byte invertState = false;
unsigned short thresholdTime = 60; unsigned short thresholdTime = 60;
} input; } input;
struct { struct {
bool enabled = false; bool enabled = false;
uint8_t gpio = GPIO_IS_NOT_CONFIGURED; byte gpio = GPIO_IS_NOT_CONFIGURED;
bool invertState = false; byte invertState = false;
unsigned short thresholdTime = 60; unsigned short thresholdTime = 60;
bool onFault = true; bool onFault = true;
bool onLossConnection = true; bool onLossConnection = true;
@@ -337,14 +330,10 @@ struct Variables {
bool connected = false; bool connected = false;
bool flame = false; bool flame = false;
bool cooling = false;
float pressure = 0.0f; float pressure = 0.0f;
float heatExchangerTemp = 0.0f; float heatExchangerTemp = 0.0f;
struct {
bool active = false;
uint8_t setpoint = 0;
} cooling;
struct { struct {
bool active = false; bool active = false;
uint8_t code = 0; uint8_t code = 0;
@@ -389,7 +378,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

@@ -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];

View File

@@ -34,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";
@@ -110,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";
@@ -142,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";
@@ -193,7 +191,6 @@ const char S_STA[] PROGMEM = "sta";
const char S_STATE[] PROGMEM = "state"; const char S_STATE[] PROGMEM = "state";
const char S_STATIC_CONFIG[] PROGMEM = "staticConfig"; const char S_STATIC_CONFIG[] PROGMEM = "staticConfig";
const char S_STATUS_LED_GPIO[] PROGMEM = "statusLedGpio"; const char S_STATUS_LED_GPIO[] PROGMEM = "statusLedGpio";
const char S_SETPOINT[] PROGMEM = "setpoint";
const char S_SETPOINT_TEMP[] PROGMEM = "setpointTemp"; const char S_SETPOINT_TEMP[] PROGMEM = "setpointTemp";
const char S_SUBNET[] PROGMEM = "subnet"; const char S_SUBNET[] PROGMEM = "subnet";
const char S_SUMMER_WINTER_MODE[] PROGMEM = "summerWinterMode"; const char S_SUMMER_WINTER_MODE[] PROGMEM = "summerWinterMode";

View File

@@ -72,7 +72,7 @@ time_t mkgmtime(const struct tm *ptm) {
inline bool isDigit(const char* ptr) { inline bool isDigit(const char* ptr) {
char* endPtr; char* endPtr;
auto tmp = strtol(ptr, &endPtr, 10); strtol(ptr, &endPtr, 10);
return *endPtr == 0; return *endPtr == 0;
} }
@@ -468,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;
@@ -492,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;
@@ -547,7 +543,6 @@ void settingsToJson(const Settings& src, JsonVariant dst, bool safe = false) {
auto externalPump = dst[FPSTR(S_EXTERNAL_PUMP)].to<JsonObject>(); auto externalPump = dst[FPSTR(S_EXTERNAL_PUMP)].to<JsonObject>();
externalPump[FPSTR(S_USE)] = src.externalPump.use; externalPump[FPSTR(S_USE)] = src.externalPump.use;
externalPump[FPSTR(S_GPIO)] = src.externalPump.gpio; externalPump[FPSTR(S_GPIO)] = src.externalPump.gpio;
externalPump[FPSTR(S_INVERT_STATE)] = src.externalPump.invertState;
externalPump[FPSTR(S_POST_CIRCULATION_TIME)] = roundf(src.externalPump.postCirculationTime / 60, 0); externalPump[FPSTR(S_POST_CIRCULATION_TIME)] = roundf(src.externalPump.postCirculationTime / 60, 0);
externalPump[FPSTR(S_ANTI_STUCK_INTERVAL)] = roundf(src.externalPump.antiStuckInterval / 86400, 0); externalPump[FPSTR(S_ANTI_STUCK_INTERVAL)] = roundf(src.externalPump.antiStuckInterval / 86400, 0);
externalPump[FPSTR(S_ANTI_STUCK_TIME)] = roundf(src.externalPump.antiStuckTime / 60, 0); externalPump[FPSTR(S_ANTI_STUCK_TIME)] = roundf(src.externalPump.antiStuckTime / 60, 0);
@@ -1005,20 +1000,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;
@@ -1038,6 +1024,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>();
@@ -1128,7 +1115,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;
@@ -1181,7 +1168,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;
@@ -1326,41 +1313,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>();
@@ -1373,7 +1334,7 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
if (!src[FPSTR(S_HEATING)][FPSTR(S_MIN_TEMP)].isNull()) { if (!src[FPSTR(S_HEATING)][FPSTR(S_MIN_TEMP)].isNull()) {
unsigned char value = src[FPSTR(S_HEATING)][FPSTR(S_MIN_TEMP)].as<unsigned char>(); unsigned char value = src[FPSTR(S_HEATING)][FPSTR(S_MIN_TEMP)].as<unsigned char>();
if (value != dst.heating.minTemp && value >= vars.slave.heating.minTemp && value < vars.slave.heating.maxTemp && value != dst.heating.maxTemp) { if (value != dst.heating.minTemp && value >= vars.slave.heating.minTemp && value < vars.slave.heating.maxTemp && value != dst.heating.minTemp) {
dst.heating.minTemp = value; dst.heating.minTemp = value;
changed = true; changed = true;
} }
@@ -1382,7 +1343,7 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
if (!src[FPSTR(S_HEATING)][FPSTR(S_MAX_TEMP)].isNull()) { if (!src[FPSTR(S_HEATING)][FPSTR(S_MAX_TEMP)].isNull()) {
unsigned char value = src[FPSTR(S_HEATING)][FPSTR(S_MAX_TEMP)].as<unsigned char>(); unsigned char value = src[FPSTR(S_HEATING)][FPSTR(S_MAX_TEMP)].as<unsigned char>();
if (value != dst.heating.maxTemp && value > vars.slave.heating.minTemp && value <= vars.slave.heating.maxTemp && value != dst.heating.minTemp) { if (value != dst.heating.maxTemp && value > vars.slave.heating.minTemp && value <= vars.slave.heating.maxTemp && value != dst.heating.maxTemp) {
dst.heating.maxTemp = value; dst.heating.maxTemp = value;
changed = true; changed = true;
} }
@@ -1541,15 +1502,6 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
} }
} }
if (src[FPSTR(S_EXTERNAL_PUMP)][FPSTR(S_INVERT_STATE)].is<bool>()) {
bool value = src[FPSTR(S_EXTERNAL_PUMP)][FPSTR(S_INVERT_STATE)].as<bool>();
if (value != dst.externalPump.invertState) {
dst.externalPump.invertState = value;
changed = true;
}
}
if (!src[FPSTR(S_EXTERNAL_PUMP)][FPSTR(S_POST_CIRCULATION_TIME)].isNull()) { if (!src[FPSTR(S_EXTERNAL_PUMP)][FPSTR(S_POST_CIRCULATION_TIME)].isNull()) {
unsigned short value = src[FPSTR(S_EXTERNAL_PUMP)][FPSTR(S_POST_CIRCULATION_TIME)].as<unsigned short>(); unsigned short value = src[FPSTR(S_EXTERNAL_PUMP)][FPSTR(S_POST_CIRCULATION_TIME)].as<unsigned short>();
@@ -1714,7 +1666,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,
@@ -1739,7 +1691,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;
@@ -1932,7 +1884,6 @@ 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):
@@ -1953,7 +1904,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::BLUETOOTH && dst.type == Sensors::Type::NTC_10K_TEMP) {
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;
@@ -1989,20 +1940,12 @@ bool jsonToSensorSettings(const uint8_t sensorId, const JsonVariantConst src, Se
); );
if (parsed == 8) { if (parsed == 8) {
for (uint8_t i = 0; i < parsed; i++) { for (uint8_t i = 0; i < 8; i++) {
if (dst.address[i] != tmp[i]) { if (dst.address[i] != tmp[i]) {
dst.address[i] = tmp[i]; dst.address[i] = tmp[i];
changed = true; changed = true;
} }
} }
} else {
// reset
for (uint8_t i = 0; i < sizeof(dst.address); i++) {
dst.address[i] = 0x00;
}
changed = true;
} }
} else if (dst.type == Sensors::Type::BLUETOOTH) { } else if (dst.type == Sensors::Type::BLUETOOTH) {
@@ -2015,20 +1958,12 @@ bool jsonToSensorSettings(const uint8_t sensorId, const JsonVariantConst src, Se
); );
if (parsed == 6) { if (parsed == 6) {
for (uint8_t i = 0; i < parsed; i++) { for (uint8_t i = 0; i < 6; i++) {
if (dst.address[i] != tmp[i]) { if (dst.address[i] != tmp[i]) {
dst.address[i] = tmp[i]; dst.address[i] = tmp[i];
changed = true; changed = true;
} }
} }
} else {
// reset
for (uint8_t i = 0; i < sizeof(dst.address); i++) {
dst.address[i] = 0x00;
}
changed = true;
} }
} }
} }
@@ -2132,13 +2067,10 @@ 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;
slave[FPSTR(S_COOLING)] = src.slave.cooling;
auto sCooling = slave[FPSTR(S_COOLING)].to<JsonObject>();
sCooling[FPSTR(S_ACTIVE)] = src.slave.cooling.active;
sCooling[FPSTR(S_SETPOINT)] = src.slave.cooling.setpoint;
auto sModulation = slave[FPSTR(S_MODULATION)].to<JsonObject>(); auto sModulation = slave[FPSTR(S_MODULATION)].to<JsonObject>();
sModulation[FPSTR(S_MIN)] = src.slave.modulation.min; sModulation[FPSTR(S_MIN)] = src.slave.modulation.min;

View File

@@ -109,8 +109,7 @@
"sConnected": "OpenTherm 通讯状态", "sConnected": "OpenTherm 通讯状态",
"sFlame": "火焰", "sFlame": "火焰",
"sCoolingActive": "制冷", "sCooling": "制冷",
"sCoolingSetpoint": "冷却设定点",
"sFaultActive": "报警状态", "sFaultActive": "报警状态",
"sFaultCode": "报警代码", "sFaultCode": "报警代码",
"sDiagActive": "诊断状态", "sDiagActive": "诊断状态",
@@ -243,7 +242,6 @@
"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 传感器",
@@ -357,16 +355,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 模式系数"
}, },
@@ -381,26 +370,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": "室外温度"
} }
}, },
@@ -458,13 +432,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气候补偿功能不兼容。"
} }
}, },
@@ -481,7 +454,6 @@
"extPump": { "extPump": {
"use": "使用外置循环泵", "use": "使用外置循环泵",
"gpio": "继电器 GPIO引脚", "gpio": "继电器 GPIO引脚",
"invertState": "切换 GPIO 状态",
"postCirculationTime": "后循环时间 <small>(分钟)</small>", "postCirculationTime": "后循环时间 <small>(分钟)</small>",
"antiStuckInterval": "防卡死间隔时间<small>(天)</small>", "antiStuckInterval": "防卡死间隔时间<small>(天)</small>",
"antiStuckTime": "防卡死运行时长<small>(分钟)</small>" "antiStuckTime": "防卡死运行时长<small>(分钟)</small>"

View File

@@ -109,8 +109,7 @@
"sConnected": "OpenTherm connection", "sConnected": "OpenTherm connection",
"sFlame": "Flame", "sFlame": "Flame",
"sCoolingActive": "Cooling", "sCooling": "Cooling",
"sCoolingSetpoint": "Cooling setpoint",
"sFaultActive": "Fault", "sFaultActive": "Fault",
"sFaultCode": "Fault code", "sFaultCode": "Fault code",
"sDiagActive": "Diagnostic", "sDiagActive": "Diagnostic",
@@ -243,7 +242,6 @@
"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",
@@ -357,16 +355,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."
}, },
@@ -387,7 +376,7 @@
}, },
"exponent": { "exponent": {
"title": "Exponent", "title": "Exponent",
"note": "Radiator efficiency. Typical values: <code>1.1</code> - Floor heating, <code>1.2</code> - Cast iron, <code>1.3</code> - Panel radiators, <code>1.4</code> - Convectors." "note": "Radiator efficiency. Typical values: 1.1 - Floor heating, 1.2 - Cast iron, 1.3 - Panel radiators, 1.4 - Convectors."
}, },
"shift": { "shift": {
"title": "Shift", "title": "Shift",
@@ -395,7 +384,7 @@
}, },
"targetDiffFactor": { "targetDiffFactor": {
"title": "T factor", "title": "T factor",
"note": "Not used if PID is enabled. Adds to the setpoint the difference between the target and current indoor temp: <code>setpoint = setpoint + ((target - indoor) * T)</code>." "note": "Not used if PID is enabled"
}, },
"chart": { "chart": {
"targetTemp": "Target indoor temperature", "targetTemp": "Target indoor temperature",
@@ -458,13 +447,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."
} }
}, },
@@ -481,7 +469,6 @@
"extPump": { "extPump": {
"use": "Use external pump", "use": "Use external pump",
"gpio": "Relay GPIO", "gpio": "Relay GPIO",
"invertState": "Invert GPIO state",
"postCirculationTime": "Post circulation time <small>(min)</small>", "postCirculationTime": "Post circulation time <small>(min)</small>",
"antiStuckInterval": "Anti stuck interval <small>(days)</small>", "antiStuckInterval": "Anti stuck interval <small>(days)</small>",
"antiStuckTime": "Anti stuck time <small>(min)</small>" "antiStuckTime": "Anti stuck time <small>(min)</small>"

View File

@@ -109,8 +109,7 @@
"sConnected": "Connessione OpenTherm", "sConnected": "Connessione OpenTherm",
"sFlame": "Fiamma", "sFlame": "Fiamma",
"sCoolingActive": "Raffrescamento", "sCooling": "Raffrescamento",
"sCoolingSetpoint": "Raffrescamento setpoint",
"sFaultActive": "Anomalia", "sFaultActive": "Anomalia",
"sFaultCode": "Codice anomalia", "sFaultCode": "Codice anomalia",
"sDiagActive": "Diagnostica", "sDiagActive": "Diagnostica",
@@ -243,7 +242,6 @@
"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",
@@ -357,16 +355,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."
}, },
@@ -383,23 +372,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: 1.1 - Riscaldamento a pavimento, 1.2 - Radiatori in ghisa, 1.3 - Radiatori a pannelli, 1.4 - 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"
}, },
"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"
} }
}, },
@@ -458,13 +447,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."
} }
}, },
@@ -481,7 +469,6 @@
"extPump": { "extPump": {
"use": "Usa pompa/circolatore esterno", "use": "Usa pompa/circolatore esterno",
"gpio": "GPIO relè", "gpio": "GPIO relè",
"invertState": "Inverti stato GPIO",
"postCirculationTime": "Tempo di post circolazione <small>(min)</small>", "postCirculationTime": "Tempo di post circolazione <small>(min)</small>",
"antiStuckInterval": "Intervallo antiblocco <small>(days)</small>", "antiStuckInterval": "Intervallo antiblocco <small>(days)</small>",
"antiStuckTime": "Tempo antiblocco <small>(min)</small>" "antiStuckTime": "Tempo antiblocco <small>(min)</small>"

View File

@@ -1,494 +0,0 @@
{
"values": {
"logo": "OpenTherm Gateway",
"nav": {
"license": "Licentie",
"source": "Broncode",
"help": "Help",
"issues": "Problemen & vragen",
"releases": "Releases"
},
"dbm": "dBm",
"kw": "kW",
"time": {
"days": "d.",
"hours": "u.",
"min": "min.",
"sec": "sec."
},
"button": {
"upgrade": "Upgraden",
"restart": "Herstarten",
"save": "Opslaan",
"saved": "Opgeslagen",
"refresh": "Vernieuwen",
"restore": "Herstellen",
"restored": "Hersteld",
"backup": "Back-up",
"wait": "Even wachten...",
"uploading": "Uploaden...",
"success": "Succes",
"error": "Fout"
},
"index": {
"title": "OpenTherm Gateway",
"section": {
"network": "Netwerk",
"system": "Systeem"
},
"system": {
"build": {
"title": "Build",
"version": "Versie",
"date": "Datum",
"core": "Core",
"sdk": "SDK"
},
"uptime": "Uptime",
"memory": {
"title": "Vrij geheugen",
"maxFreeBlock": "max. vrij blok",
"min": "min"
},
"board": "Board",
"chip": {
"model": "Chip",
"cores": "Kernen",
"freq": "frequentie"
},
"flash": {
"size": "Flash-grootte",
"realSize": "werkelijke grootte"
},
"lastResetReason": "Reden laatste herstart"
}
},
"dashboard": {
"name": "Dashboard",
"title": "Dashboard - OpenTherm Gateway",
"section": {
"control": "Bediening",
"states": "Statussen",
"sensors": "Sensoren",
"diag": "OpenTherm diagnose"
},
"thermostat": {
"heating": "Verwarming",
"dhw": "Warm water",
"temp.current": "Huidig",
"enable": "Inschakelen",
"turbo": "Turbomodus"
},
"notify": {
"fault": {
"title": "Ketelstoring is actief!",
"note": "Het wordt aanbevolen de ketel te inspecteren en de documentatie te raadplegen om de storingscode te interpreteren:"
},
"diag": {
"title": "Keteldiagnose is actief!",
"note": "Heeft uw ketel misschien een inspectie nodig? Het wordt aanbevolen de documentatie te raadplegen om de diagnosecode te interpreteren:"
},
"reset": "Probeer te resetten"
},
"states": {
"mNetworkConnected": "Netwerkverbinding",
"mMqttConnected": "MQTT-verbinding",
"mEmergencyState": "Noodmodus",
"mExtPumpState": "Externe pomp",
"mCascadeControlInput": "Cascaderegeling (ingang)",
"mCascadeControlOutput": "Cascaderegeling (uitgang)",
"sConnected": "OpenTherm-verbinding",
"sFlame": "Vlam",
"sCoolingActive": "Koeling",
"sCoolingSetpoint": "Koelinstelpunt",
"sFaultActive": "Storing",
"sFaultCode": "Storingscode",
"sDiagActive": "Diagnose",
"sDiagCode": "Diagnosecode",
"mHeatEnabled": "Verwarming ingeschakeld",
"mHeatBlocking": "Verwarming geblokkeerd",
"mHeatOverheat": "Verwarming oververhit",
"sHeatActive": "Verwarming actief",
"mHeatSetpointTemp": "Insteltemperatuur verwarming",
"mHeatTargetTemp": "Doeltemperatuur verwarming",
"mHeatCurrTemp": "Huidige temperatuur verwarming",
"mHeatRetTemp": "Retourtemperatuur verwarming",
"mHeatIndoorTemp": "Verwarming, binnentemperatuur",
"mHeatOutdoorTemp": "Verwarming, buitentemperatuur",
"mDhwEnabled": "Warm water ingeschakeld",
"mDhwOverheat": "Warm water oververhit",
"sDhwActive": "Warm water actief",
"mDhwTargetTemp": "Doeltemperatuur warm water",
"mDhwCurrTemp": "Huidige temperatuur warm water",
"mDhwRetTemp": "Retourtemperatuur warm water"
},
"sensors": {
"values": {
"temp": "Temperatuur",
"humidity": "Luchtvochtigheid",
"battery": "Batterij",
"rssi": "RSSI"
}
}
},
"network": {
"title": "Netwerk - OpenTherm Gateway",
"name": "Netwerkinstellingen",
"section": {
"static": "Statische instellingen",
"availableNetworks": "Beschikbare netwerken",
"staSettings": "WiFi-instellingen",
"apSettings": "AP-instellingen"
},
"scan": {
"pos": "#",
"info": "Info"
},
"wifi": {
"ssid": "SSID",
"password": "Wachtwoord",
"channel": "Kanaal",
"signal": "Signaal",
"connected": "Verbonden"
},
"params": {
"hostname": "Hostnaam",
"dhcp": "Gebruik DHCP",
"mac": "MAC",
"ip": "IP",
"subnet": "Subnet",
"gateway": "Gateway",
"dns": "DNS"
},
"sta": {
"channel.note": "zet op 0 voor automatische selectie"
}
},
"sensors": {
"title": "Sensorinstellingen - OpenTherm Gateway",
"name": "Sensorinstellingen",
"enabled": "Ingeschakeld",
"sensorName": {
"title": "Sensornaam",
"note": "Mag alleen bevatten: a-z, A-Z, 0-9, _ en spatie"
},
"purpose": "Doel",
"purposes": {
"outdoorTemp": "Buitentemperatuur",
"indoorTemp": "Binnentemperatuur",
"heatTemp": "Verwarming, temperatuur",
"heatRetTemp": "Verwarming, retourtemperatuur",
"dhwTemp": "Warm water, temperatuur",
"dhwRetTemp": "Warm water, retourtemperatuur",
"dhwFlowRate": "Warm water, doorstroomsnelheid",
"exhaustTemp": "Rookgastemperatuur",
"modLevel": "Modulatieniveau (in procenten)",
"number": "Getal (ruw)",
"powerFactor": "Vermogen (in procent)",
"power": "Vermogen (in kWt)",
"fanSpeed": "Ventilatorsnelheid",
"co2": "CO2",
"pressure": "Druk",
"humidity": "Luchtvochtigheid",
"temperature": "Temperatuur",
"notConfigured": "Niet geconfigureerd"
},
"type": "Type/bron",
"types": {
"otOutdoorTemp": "OpenTherm, buitentemp.",
"otHeatTemp": "OpenTherm, verwarming, temp.",
"otHeatRetTemp": "OpenTherm, verwarming, retourtemp.",
"otDhwTemp": "OpenTherm, warm water, temperatuur",
"otDhwTemp2": "OpenTherm, warm water, temperatuur 2",
"otDhwFlowRate": "OpenTherm, warm water, doorstroomsnelheid",
"otCh2Temp": "OpenTherm, kanaal 2, temp.",
"otExhaustTemp": "OpenTherm, rookgastemp.",
"otHeatExchangerTemp": "OpenTherm, warmtewisselaar temp.",
"otPressure": "OpenTherm, druk",
"otModLevel": "OpenTherm, modulatieniveau",
"otCurrentPower": "OpenTherm, huidig vermogen",
"otExhaustCo2": "OpenTherm, rookgas CO2",
"otExhaustFanSpeed": "OpenTherm, rookgasventilator snelheid",
"otSupplyFanSpeed": "OpenTherm, toevoerventilator snelheid",
"otSolarStorageTemp": "OpenTherm, zonneboiler opslagtemp.",
"otSolarCollectorTemp": "OpenTherm, zonnecollector temp.",
"otFanSpeedSetpoint": "OpenTherm, instelpunt ventilatorsnelheid",
"otFanSpeedCurrent": "OpenTherm, huidige ventilatorsnelheid",
"otBurnerStarts": "OpenTherm, aantal branderstarts",
"otDhwBurnerStarts": "OpenTherm, aantal branderstarts (warm water)",
"otHeatingPumpStarts": "OpenTherm, aantal pompstarts (verwarming)",
"otDhwPumpStarts": "OpenTherm, aantal pompstarts (warm water)",
"otBurnerHours": "OpenTherm, aantal branderuren",
"otDhwBurnerHours": "OpenTherm, aantal branderuren (warm water)",
"otHeatingPumpHours": "OpenTherm, aantal pompuren (verwarming)",
"otDhwPumpHours": "OpenTherm, aantal pompuren (warm water)",
"otCoolingHours": "OpenTherm, aantal cooling",
"ntcTemp": "NTC-sensor",
"dallasTemp": "DALLAS-sensor",
"bluetooth": "BLE-sensor",
"heatSetpointTemp": "Verwarming, insteltemperatuur",
"manual": "Handmatig via MQTT/API",
"notConfigured": "Niet geconfigureerd"
},
"gpio": "GPIO",
"address": {
"title": "Sensoradres",
"note": "Laat leeg voor automatische detectie van DALLAS-sensoren. Voor BLE-apparaten is een MAC-adres vereist."
},
"correction": {
"desc": "Correctie van waarden",
"offset": "Compensatie (offset)",
"factor": "Vermenigvuldiger"
},
"filtering": {
"desc": "Filteren van waarden",
"enabled": {
"title": "Filteren ingeschakeld",
"note": "Kan handig zijn bij veel scherpe ruis in de grafieken. Het gebruikte filter is \"Voortschrijdend gemiddelde\"."
},
"factor": {
"title": "Filterfactor",
"note": "Hoe lager de waarde, hoe vloeiender en <u>langer</u> de verandering in numerieke waarden."
}
}
},
"settings": {
"title": "Instellingen - OpenTherm Gateway",
"name": "Instellingen",
"section": {
"portal": "Portaalinstellingen",
"system": "Systeeminstellingen",
"diag": "Diagnose",
"heating": "Verwarmingsinstellingen",
"dhw": "Warmwaterinstellingen",
"emergency": "Instellingen noodmodus",
"equitherm": "Equitherm-instellingen",
"pid": "PID-instellingen",
"ot": "OpenTherm-instellingen",
"mqtt": "MQTT-instellingen",
"extPump": "Instellingen externe pomp",
"cascadeControl": "Instellingen cascaderegeling"
},
"enable": "Inschakelen",
"note": {
"restart": "Na het wijzigen van deze instellingen moet het apparaat opnieuw worden opgestart om de wijzigingen door te voeren.",
"blankNotUse": "leeg - niet gebruiken",
"bleDevice": "BLE-apparaat kan <u>alleen</u> worden gebruikt met sommige ESP32-boards met BLE-ondersteuning!"
},
"temp": {
"min": "Minimumtemperatuur",
"max": "Maximumtemperatuur"
},
"maxModulation": "Max. modulatieniveau",
"ohProtection": {
"title": "Oververhittingsbeveiliging",
"desc": "<b>Let op:</b> Deze functie kan handig zijn als de ingebouwde oververhittingsbeveiliging van de ketel niet of niet correct werkt en de warmtedrager kookt. Om uit te schakelen, stel 0 in als <b>hoge</b> en <b>lage</b> temperatuur.",
"highTemp": {
"title": "Drempelwaarde hoge temperatuur",
"note": "Drempelwaarde waarbij de brander geforceerd wordt uitgeschakeld"
},
"lowTemp": {
"title": "Drempelwaarde lage temperatuur",
"note": "Drempelwaarde waarbij de brander weer ingeschakeld kan worden"
}
},
"freezeProtection": {
"title": "Vorstbeveiliging",
"desc": "De verwarming wordt geforceerd ingeschakeld als de temperatuur van de warmtedrager of de binnentemperatuur onder de <b>Lage temperatuur</b> daalt gedurende de <b>Wachttijd</b>.",
"lowTemp": "Drempelwaarde lage temperatuur",
"thresholdTime": "Wachttijd <small>(sec)</small>"
},
"portal": {
"login": "Gebruikersnaam",
"password": "Wachtwoord",
"auth": "Authenticatie vereisen",
"mdns": "Gebruik mDNS"
},
"system": {
"unit": "Eenheidssysteem",
"metric": "Metrisch <small>(celsius, liters, bar)</small>",
"imperial": "Imperiaal <small>(fahrenheit, gallons, psi)</small>",
"statusLedGpio": "Status LED GPIO",
"logLevel": "Logniveau",
"serial": {
"enable": "Seriële poort ingeschakeld",
"baud": "Baudrate seriële poort"
},
"telnet": {
"enable": "Telnet ingeschakeld",
"port": {
"title": "Telnet-poort",
"note": "Standaard: 23"
}
},
"ntp": {
"server": "NTP-server",
"timezone": "Tijdzone",
"timezonePresets": "Selecteer voorinstelling..."
}
},
"heating": {
"hyst": {
"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."
},
"emergency": {
"desc": "Noodmodus wordt automatisch geactiveerd wanneer «PID» of «Equitherm» het instelpunt van de warmtedrager niet kan berekenen:<br />- als «Equitherm» is ingeschakeld en de buitentemperatuursensor is losgekoppeld;<br />- als «PID» of OT-optie <i>«Natuurlijke verwarmingsregeling»</i> is ingeschakeld en de binnentemperatuursensor is losgekoppeld.<br /><b>Let op:</b> Bij een netwerk- of MQTT-storing krijgen sensoren van het type <i>«Handmatig via MQTT/API»</i> de status ONVERBONDEN.",
"target": {
"title": "Doeltemperatuur",
"note": "<b>Belangrijk:</b> <u>Doel binnentemperatuur</u> als OT-optie <i>«Natuurlijke verwarmingsregeling»</i> is ingeschakeld.<br />In alle andere gevallen, de <u>doel warmtedragertemperatuur</u>."
},
"treshold": "Drempeltijd <small>(sec)</small>"
},
"equitherm": {
"slope": {
"title": "Helling",
"note": "Compensatie voor warmteverlies. Hoofdafstelparameter."
},
"exponent": {
"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": {
"p": "P-factor",
"i": "I-factor",
"d": "D-factor",
"dt": "DT <small>in seconden</small>",
"limits": {
"title": "Limieten",
"note": "<b>Belangrijk:</b> Bij gelijktijdig gebruik van «Equitherm» en «PID» beperken de min- en maxtemperaturen de invloed op de resulterende «Equitherm»-temperatuur.<br />Dus, als de min-temperatuur is ingesteld op -15 en de max-temperatuur op 15, zal het uiteindelijke instelpunt van de warmtedrager liggen tussen <code>equitherm_resultaat - 15</code> en <code>equitherm_resultaat + 15</code>."
},
"deadband": {
"title": "Deadband",
"note": "Deadband is een bereik rond de doeltemperatuur waarbinnen de PID-regeling minder actief wordt. Binnen dit bereik kan het algoritme de intensiteit verminderen of aanpassingen pauzeren om overreactie op kleine schommelingen te voorkomen.<br /><br />Bijvoorbeeld, met een doeltemperatuur van 22°, een onderdrempel van 1.0 en een bovendrempel van 0.5, werkt de deadband tussen 21° en 22.5°. Als de I-coëfficiënt 0.0005 is en de I-vermenigvuldiger 0.05, dan wordt de I-coëfficiënt binnen de deadband: <code>0.0005 * 0.05 = 0.000025</code>",
"p_multiplier": "Vermenigvuldiger voor P-factor",
"i_multiplier": "Vermenigvuldiger voor I-factor",
"d_multiplier": "Vermenigvuldiger voor D-factor",
"thresholdHigh": "Bovendrempel",
"thresholdLow": "Onderdrempel"
}
},
"ot": {
"advanced": "Geavanceerde instellingen",
"inGpio": "In GPIO",
"outGpio": "Uit GPIO",
"ledGpio": "RX LED GPIO",
"memberId": "Master member ID",
"flags": "Master flags",
"minPower": {
"title": "Min. ketelvermogen <small>(kW)</small>",
"note": "Deze waarde is bij 0-1% modulatieniveau van de ketel. Typisch te vinden in de ketelspecificatie als \"minimum nuttig warmtevermogen\"."
},
"maxPower": {
"title": "Max. ketelvermogen <small>(kW)</small>",
"note": "<b>0</b> - probeer automatisch te detecteren. Typisch te vinden in de ketelspecificatie als \"maximum nuttig warmtevermogen\"."
},
"options": {
"title": "Opties (aanvullende instellingen)",
"desc": "Opties kunnen de logica van de ketel veranderen. Niet alle opties zijn gedocumenteerd in het protocol, dus dezelfde optie kan verschillende effecten hebben op verschillende ketels.<br /><b>Let op:</b> Het is niet nodig om iets te veranderen als alles goed werkt.",
"dhwSupport": "Warm water ondersteuning",
"coolingSupport": "Koeling ondersteuning",
"summerWinterMode": "Zomer/wintermodus",
"heatingStateToSummerWinterMode": "Verwarmingsstatus als zomer/wintermodus",
"ch2AlwaysEnabled": "CH2 altijd ingeschakeld",
"heatingToCh2": "Dupliceer verwarming naar CH2",
"dhwToCh2": "Dupliceer warm water naar CH2",
"dhwBlocking": "Blokkering warm water",
"dhwStateAsDhwBlocking": "Status warm water als blokkering warm water",
"maxTempSyncWithTargetTemp": "Synchroniseer max. verwarmingstemp. met doeltemp.",
"getMinMaxTemp": "Haal min/max temp. op van ketel",
"ignoreDiagState": "Negeer diagnosestatus",
"autoFaultReset": "Automatische storingsreset <small>(niet aanbevolen!)</small>",
"autoDiagReset": "Automatische diagnosereset <small>(niet aanbevolen!)</small>",
"setDateAndTime": "Stel datum & tijd in op ketel",
"immergasFix": "Fix voor Immergas-ketels",
"alwaysSendIndoorTemp": "Stuur huidige binnentemp naar ketel"
},
"nativeOTC": {
"title": "Native warmtedrager temperatuur berekeningsmodus",
"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": {
"homeAssistantDiscovery": "Home Assistant Discovery",
"server": "Server",
"port": "Poort",
"user": "Gebruiker",
"password": "Wachtwoord",
"prefix": "Prefix",
"interval": "Publicatie-interval <small>(sec)</small>"
},
"extPump": {
"use": "Gebruik externe pomp",
"gpio": "Relais GPIO",
"invertState": "Inverteer GPIO-status",
"postCirculationTime": "Nacirculatietijd <small>(min)</small>",
"antiStuckInterval": "Anti-vastloopinterval <small>(dagen)</small>",
"antiStuckTime": "Anti-vastlooptijd <small>(min)</small>"
},
"cascadeControl": {
"input": {
"desc": "Kan worden gebruikt om de verwarming alleen in te schakelen als een andere ketel defect is. De besturing van de andere ketel moet de status van de GPIO-ingang wijzigen in geval van een storing.",
"enable": "Ingang ingeschakeld",
"gpio": "GPIO",
"invertState": "Inverteer GPIO-status",
"thresholdTime": "Drempeltijd statuswijziging <small>(sec)</small>"
},
"output": {
"desc": "Kan worden gebruikt om een andere ketel in te schakelen <u>via een relais</u>.",
"enable": "Uitgang ingeschakeld",
"gpio": "GPIO",
"invertState": "Inverteer GPIO-status",
"thresholdTime": "Drempeltijd statuswijziging <small>(sec)</small>",
"events": {
"desc": "Gebeurtenissen",
"onFault": "Als de storingsstatus actief is",
"onLossConnection": "Als de verbinding via Opentherm is verbroken",
"onEnabledHeating": "Als de verwarming is ingeschakeld"
}
}
}
},
"upgrade": {
"title": "Upgrade - OpenTherm Gateway",
"name": "Upgrade",
"section": {
"backupAndRestore": "Back-up & herstel",
"backupAndRestore.desc": "In deze sectie kunt u een back-up van ALLE instellingen opslaan en herstellen.",
"upgrade": "Upgrade",
"upgrade.desc": "In deze sectie kunt u de firmware en het bestandssysteem van uw apparaat upgraden.<br />De nieuwste releases kunnen worden gedownload van de <a href=\"https://github.com/Laxilef/OTGateway/releases\" target=\"_blank\">Releases-pagina</a> van de projectrepository."
},
"note": {
"disclaimer1": "Na een succesvolle upgrade van het bestandssysteem worden ALLE instellingen teruggezet naar de standaardwaarden! Sla een back-up op voordat u gaat upgraden.",
"disclaimer2": "Na een succesvolle upgrade zal het apparaat automatisch herstarten na 15 seconden."
},
"settingsFile": "Instellingenbestand",
"fw": "Firmware",
"fs": "Bestandssysteem"
}
}
}

View File

@@ -109,8 +109,7 @@
"sConnected": "Подключение к OpenTherm", "sConnected": "Подключение к OpenTherm",
"sFlame": "Пламя", "sFlame": "Пламя",
"sCoolingActive": "Охлаждение", "sCooling": "Охлаждение",
"sCoolingSetpoint": "Охлаждение, уставка",
"sFaultActive": "Ошибка", "sFaultActive": "Ошибка",
"sFaultCode": "Код ошибки", "sFaultCode": "Код ошибки",
"sDiagActive": "Диагностика", "sDiagActive": "Диагностика",
@@ -243,7 +242,6 @@
"otDhwBurnerHours": "OpenTherm, кол-во часов работы горелки (ГВС)", "otDhwBurnerHours": "OpenTherm, кол-во часов работы горелки (ГВС)",
"otHeatingPumpHours": "OpenTherm, кол-во часов работы насоса (отопление)", "otHeatingPumpHours": "OpenTherm, кол-во часов работы насоса (отопление)",
"otDhwPumpHours": "OpenTherm, кол-во часов работы насоса (ГВС)", "otDhwPumpHours": "OpenTherm, кол-во часов работы насоса (ГВС)",
"otCoolingHours": "OpenTherm, кол-во часов работы охлаждения",
"ntcTemp": "NTC датчик", "ntcTemp": "NTC датчик",
"dallasTemp": "DALLAS датчик", "dallasTemp": "DALLAS датчик",
@@ -357,16 +355,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": "Коэфф. турбо режима"
}, },
@@ -387,7 +376,7 @@
}, },
"exponent": { "exponent": {
"title": "Экспонента", "title": "Экспонента",
"note": "Эффективность радиатора. Типичные значения: <code>1.1</code> - Тёплый пол, <code>1.2</code> - Чугунные радиаторы, <code>1.3</code> - Панельные радиаторы, <code>1.4</code> - Конвекторы." "note": "Эффективность радиатора. Типичные значения: 1.1 - Тёплый пол, 1.2 - Чугунные радиаторы, 1.3 - Панельные радиаторы, 1.4 - Конвекторы."
}, },
"shift": { "shift": {
"title": "Смещение", "title": "Смещение",
@@ -395,7 +384,7 @@
}, },
"targetDiffFactor": { "targetDiffFactor": {
"title": "Коэффициент T", "title": "Коэффициент T",
"note": "Не используется, если ПИД включен. Добавляет разницу между целевой и текущей температурой в помещении: <code>setpoint = setpoint + ((target - indoor) * T)</code>." "note": "Не используется, если ПИД включен"
}, },
"chart": { "chart": {
"targetTemp": "Целевая внутренняя температура", "targetTemp": "Целевая внутренняя температура",
@@ -458,13 +447,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> если котел требует и принимает целевую температуру в помещении и сам регулирует температуру теплоносителя на основе встроенного режима кривых. Несовместимо с ПИД и ПЗА."
} }
}, },
@@ -481,7 +469,6 @@
"extPump": { "extPump": {
"use": "Использовать доп. насос", "use": "Использовать доп. насос",
"gpio": "GPIO реле", "gpio": "GPIO реле",
"invertState": "Инвертировать состояние GPIO",
"postCirculationTime": "Время постциркуляции <small>(в минутах)</small>", "postCirculationTime": "Время постциркуляции <small>(в минутах)</small>",
"antiStuckInterval": "Интервал защиты от блокировки <small>(в днях)</small>", "antiStuckInterval": "Интервал защиты от блокировки <small>(в днях)</small>",
"antiStuckTime": "Время работы насоса <small>(в минутах)</small>" "antiStuckTime": "Время работы насоса <small>(в минутах)</small>"

View File

@@ -23,7 +23,6 @@
<option value="en" selected>EN</option> <option value="en" selected>EN</option>
<option value="cn">CN</option> <option value="cn">CN</option>
<option value="it">IT</option> <option value="it">IT</option>
<option value="nl">NL</option>
<option value="ru">RU</option> <option value="ru">RU</option>
</select> </select>
</li> </li>
@@ -154,14 +153,9 @@
<th scope="row" data-i18n>dashboard.states.sFlame</th> <th scope="row" data-i18n>dashboard.states.sFlame</th>
<td><i class="sFlame"></i></td> <td><i class="sFlame"></i></td>
</tr> </tr>
<tr> <tr>
<th scope="row" data-i18n>dashboard.states.sCoolingActive</th> <th scope="row" data-i18n>dashboard.states.sCooling</th>
<td><i class="sCoolingActive"></i></td> <td><i class="sCooling"></i></td>
</tr>
<tr>
<th scope="row" data-i18n>dashboard.states.sCoolingSetpoint</th>
<td><b class="sCoolingSetpoint"></b> %</td>
</tr> </tr>
@@ -563,9 +557,7 @@
result.slave.connected ? "green" : "red" result.slave.connected ? "green" : "red"
); );
setState('.sFlame', result.slave.flame); setState('.sFlame', result.slave.flame);
setState('.sCooling', result.slave.cooling);
setState('.sCoolingActive', result.slave.cooling.active);
setValue('.sCoolingSetpoint', result.slave.cooling.setpoint);
setValue('.sModMin', result.slave.modulation.min); setValue('.sModMin', result.slave.modulation.min);
setValue('.sModMax', result.slave.modulation.max); setValue('.sModMax', result.slave.modulation.max);

View File

@@ -23,7 +23,6 @@
<option value="en" selected>EN</option> <option value="en" selected>EN</option>
<option value="cn">CN</option> <option value="cn">CN</option>
<option value="it">IT</option> <option value="it">IT</option>
<option value="nl">NL</option>
<option value="ru">RU</option> <option value="ru">RU</option>
</select> </select>
</li> </li>

View File

@@ -23,7 +23,6 @@
<option value="en" selected>EN</option> <option value="en" selected>EN</option>
<option value="cn">CN</option> <option value="cn">CN</option>
<option value="it">IT</option> <option value="it">IT</option>
<option value="nl">NL</option>
<option value="ru">RU</option> <option value="ru">RU</option>
</select> </select>
</li> </li>

View File

@@ -23,7 +23,6 @@
<option value="en" selected>EN</option> <option value="en" selected>EN</option>
<option value="cn">CN</option> <option value="cn">CN</option>
<option value="it">IT</option> <option value="it">IT</option>
<option value="nl">NL</option>
<option value="ru">RU</option> <option value="ru">RU</option>
</select> </select>
</li> </li>
@@ -113,7 +112,6 @@
<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>

View File

@@ -23,7 +23,6 @@
<option value="en" selected>EN</option> <option value="en" selected>EN</option>
<option value="cn">CN</option> <option value="cn">CN</option>
<option value="it">IT</option> <option value="it">IT</option>
<option value="nl">NL</option>
<option value="ru">RU</option> <option value="ru">RU</option>
</select> </select>
</li> </li>
@@ -106,7 +105,7 @@
<option disabled selected data-i18n>settings.system.ntp.timezonePresets</option> <option disabled selected data-i18n>settings.system.ntp.timezonePresets</option>
</select> </select>
</div> </div>
</label> </label>
</fieldset> </fieldset>
<fieldset> <fieldset>
@@ -194,47 +193,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 />
@@ -692,17 +664,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>
@@ -786,11 +753,6 @@
<input type="checkbox" name="externalPump[use]" value="true"> <input type="checkbox" name="externalPump[use]" value="true">
<span data-i18n>settings.extPump.use</span> <span data-i18n>settings.extPump.use</span>
</label> </label>
<label>
<input type="checkbox" name="externalPump[invertState]" value="true">
<span data-i18n>settings.externalPump.invertState</span>
</label>
</fieldset> </fieldset>
<div class="grid"> <div class="grid">
@@ -954,7 +916,7 @@
datasets: [{ datasets: [{
borderColor: (context) => { borderColor: (context) => {
const chart = context.chart; const chart = context.chart;
const { ctx, chartArea } = chart; const {ctx, chartArea} = chart;
if (!chartArea) { if (!chartArea) {
return; return;
@@ -1122,9 +1084,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
@@ -1141,7 +1102,6 @@
// Extpump // Extpump
setCheckboxValue("[name='externalPump[use]']", data.externalPump.use); setCheckboxValue("[name='externalPump[use]']", data.externalPump.use);
setInputValue("[name='externalPump[gpio]']", data.externalPump.gpio < 255 ? data.externalPump.gpio : ''); setInputValue("[name='externalPump[gpio]']", data.externalPump.gpio < 255 ? data.externalPump.gpio : '');
setCheckboxValue("[name='externalPump[invertState]']", data.externalPump.invertState);
setInputValue("[name='externalPump[postCirculationTime]']", data.externalPump.postCirculationTime); setInputValue("[name='externalPump[postCirculationTime]']", data.externalPump.postCirculationTime);
setInputValue("[name='externalPump[antiStuckInterval]']", data.externalPump.antiStuckInterval); setInputValue("[name='externalPump[antiStuckInterval]']", data.externalPump.antiStuckInterval);
setInputValue("[name='externalPump[antiStuckTime]']", data.externalPump.antiStuckTime); setInputValue("[name='externalPump[antiStuckTime]']", data.externalPump.antiStuckTime);
@@ -1171,9 +1131,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, {
@@ -1212,7 +1170,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

@@ -23,7 +23,6 @@
<option value="en" selected>EN</option> <option value="en" selected>EN</option>
<option value="cn">CN</option> <option value="cn">CN</option>
<option value="it">IT</option> <option value="it">IT</option>
<option value="nl">NL</option>
<option value="ru">RU</option> <option value="ru">RU</option>
</select> </select>
</li> </li>