38 Commits

Author SHA1 Message Date
Yurii
131ad2fdfd refactor: after merge 2025-12-09 19:26:08 +03:00
Yurii
28099f2d07 Merge branch 'master' into new-equitherm 2025-12-09 19:19:30 +03:00
Yurii
00baf10b9f chore: removed platformio_dependabot 2025-12-09 18:18:10 +03:00
Yurii
6f8c8567a0 chore: bump pioarduino/platform-espressif32 from 3.3.2 to 3.3.4 2025-11-15 13:08:43 +03:00
Yurii
e573ce582f fix: generation of default_entity_id for HA fixed 2025-11-12 20:21:39 +03:00
Yurii
0b60734a3b refactor: using abbreviations for HA 2025-11-12 20:18:16 +03:00
Yurii
ec50d5ecbb flx: typo 2025-11-03 01:09:13 +03:00
Yurii
32e0a06c19 Merge branch 'master' into new-equitherm 2025-11-03 00:04:57 +03:00
Yurii
d4603aa0de fix: compatibility with HA 2025.10+ fixed #189 2025-11-02 23:43:02 +03:00
Yurii
b9010643f0 feat: added GPIO inversion setting for extpump 2025-10-31 21:08:35 +03:00
Yurii
5667199988 refactor: reset BLE/DALLAS address if not valid 2025-10-14 07:38:30 +03:00
Yurii
cf81ff5856 refactor: improved work with BLE sensors 2025-10-10 05:35:57 +03:00
Yurii
78b5a12e90 feat: setting the cooling setpoint if cooling support is enabled 2025-10-09 22:57:04 +03:00
Yurii
cc5bbb7a87 refactor: refactoring after #184 2025-10-09 08:22:07 +03:00
Douwe
dda79151f3 feat: added Dutch locale #184
* Create nl.json

* Update nl.json
2025-10-09 08:19:55 +03:00
Yurii
1375d8c7a5 chore: bump pioarduino/platform-espressif32 from 3.3.1 to 3.3.2 2025-10-09 08:16:04 +03:00
Yurii
d4addf887f refactor: improved work with BLE sensors 2025-10-09 08:13:33 +03:00
Yurii
9d77256051 refactor: not initialize Bluetooth if BLE sensors are not used 2025-10-03 20:56:04 +03:00
Yurii
d3e7a13e1f fix: rollback NimBLE-Arduino from 2.3.6 to 2.3.3 2025-10-03 20:54:42 +03:00
Yurii
14826c10cd chore: `byte to uint8_t` 2025-09-23 04:03:36 +03:00
Yurii
28a5218b7c fix: various fixes
Found by PVS-Studio
2025-09-23 04:02:40 +03:00
Yurii
ff89c6d478 chore: added additional description of the `T` parameter for Equitherm 2025-09-19 20:07:31 +03:00
Yurii
d867c355ed style: HTML code formatting 2025-09-19 19:25:24 +03:00
Yurii
e751c3aba0 fix: decimation for Equitherm chart fixed; chartjs updated 2025-09-19 02:09:12 +03:00
Yurii
30b55f1946 Merge branch 'master' into new-equitherm 2025-09-19 00:45:07 +03:00
Yurii
5544f43162 Merge branch 'master' into new-equitherm 2025-06-30 02:42:33 +03:00
Yurii
06c2ddcf96 Merge branch 'master' into new-equitherm 2025-05-21 01:20:55 +03:00
Yurii
0bb05006f4 Merge branch 'master' into new-equitherm 2025-05-19 23:45:13 +03:00
Yurii
5046bc0e8f Merge branch 'master' into new-equitherm 2025-05-19 22:49:09 +03:00
P43YM
0d3adad446 refactor: added notes for equitherm parameters 2025-03-18 09:38:09 +03:00
Yurii
587678f184 Merge branch 'master' into new-equitherm 2025-03-06 04:52:12 +03:00
Yurii
72235286c0 chore: resolve conflicts 2025-03-06 04:50:02 +03:00
Yurii
ee868b22ce chore: remove unused files 2025-03-04 21:31:44 +03:00
Yurii
8046a7e13f refactor: cosmetic changes 2025-03-03 04:03:08 +03:00
Yurii
0ec1fc5f24 chore: fix typo 2025-03-03 02:26:09 +03:00
Yurii
061136b13e refactor: cosmetic changes (equitherm chart) 2025-03-03 02:05:33 +03:00
Yurii
3e61dabeab refactor: refactoring after #144 2025-03-02 22:44:53 +03:00
P43YM
e5f4281d4c feat: new equitherm algorithm and chart for it (#144) 2025-02-28 23:21:55 +03:00
31 changed files with 1389 additions and 484 deletions

View File

@@ -1,22 +0,0 @@
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

@@ -27,6 +27,9 @@ let paths = {
'src_data/scripts/i18n.min.js',
'src_data/scripts/lang.js',
'src_data/scripts/utils.js'
],
'chart.js': [
'src_data/scripts/chart.js'
]
}
},

View File

@@ -4,8 +4,8 @@
class CustomOpenTherm : public OpenTherm {
public:
typedef std::function<void(unsigned int)> DelayCallback;
typedef std::function<void(unsigned long, byte)> BeforeSendRequestCallback;
typedef std::function<void(unsigned long, unsigned long, OpenThermResponseStatus, byte)> AfterSendRequestCallback;
typedef std::function<void(unsigned long, uint8_t)> BeforeSendRequestCallback;
typedef std::function<void(unsigned long, unsigned long, OpenThermResponseStatus, uint8_t)> AfterSendRequestCallback;
CustomOpenTherm(int inPin = 4, int outPin = 5, bool isSlave = false, bool alwaysReceive = false) : OpenTherm(inPin, outPin, isSlave, alwaysReceive) {}
~CustomOpenTherm() {}
@@ -106,15 +106,14 @@ public:
return isValidResponse(response) && isValidResponseId(response, OpenThermMessageID::RemoteRequest);
}
static bool isCh2Active(unsigned long response)
{
static bool isCh2Active(unsigned long response) {
return response & 0x20;
}
static bool isValidResponseId(unsigned long response, OpenThermMessageID id) {
byte responseId = (response >> 16) & 0xFF;
uint8_t responseId = (response >> 16) & 0xFF;
return (byte)id == responseId;
return (uint8_t)id == responseId;
}
static uint8_t getResponseMessageTypeId(unsigned long response) {

View File

@@ -1,63 +0,0 @@
#include <Arduino.h>
#if defined(EQUITHERM_INTEGER)
// расчёты с целыми числами
typedef int datatype;
#else
// расчёты с float числами
typedef float datatype;
#endif
class Equitherm {
public:
datatype targetTemp = 0;
datatype indoorTemp = 0;
datatype outdoorTemp = 0;
float Kn = 0.0;
float Kk = 0.0;
float Kt = 0.0;
Equitherm() = default;
// kn, kk, kt
Equitherm(float new_kn, float new_kk, float new_kt) {
Kn = new_kn;
Kk = new_kk;
Kt = new_kt;
}
// лимит выходной величины
void setLimits(unsigned short min_output, unsigned short max_output) {
_minOut = min_output;
_maxOut = max_output;
}
// возвращает новое значение при вызове
datatype getResult() {
datatype output = getResultN() + getResultK() + getResultT();
output = constrain(output, _minOut, _maxOut); // ограничиваем выход
return output;
}
private:
unsigned short _minOut = 20, _maxOut = 90;
// температура контура отопления в зависимости от наружной температуры
datatype getResultN() {
float a = (-0.21 * Kn) - 0.06; // a = -0,21k — 0,06
float b = (6.04 * Kn) + 1.98; // b = 6,04k + 1,98
float c = (-5.06 * Kn) + 18.06; // с = -5,06k + 18,06
float x = (-0.2 * outdoorTemp) + 5; // x = -0.2*t1 + 5
return (a * x * x) + (b * x) + c; // Tn = ax2 + bx + c
}
// поправка на желаемую комнатную температуру
datatype getResultK() {
return (targetTemp - 20) * Kk;
}
// Расчет поправки (ошибки) термостата
datatype getResultT() {
return constrain((targetTemp - indoorTemp), -3, 3) * Kt;
}
};

View File

@@ -147,8 +147,19 @@ public:
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>
String getObjectIdWithPrefix(T value, char separator = '_') {
String getUniqueIdWithPrefix(T value, char separator = '_') {
String topic = "";
topic.concat(this->devicePrefix);
topic.concat(separator);

View File

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

View File

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

View File

@@ -92,13 +92,13 @@ check_flags = ${env.check_flags}
;platform_packages =
; 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
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.31/platform-espressif32.zip
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.34/platform-espressif32.zip
platform_packages = ${env.platform_packages}
board_build.partitions = esp32_partitions.csv
lib_deps =
${env.lib_deps}
laxilef/ESP32Scheduler@^1.0.1
nimble_lib = h2zero/NimBLE-Arduino@^2.3.6
nimble_lib = h2zero/NimBLE-Arduino@2.3.3
lib_ignore =
extra_scripts =
post:tools/esp32.py

View File

@@ -3,8 +3,8 @@
class HaHelper : public HomeAssistantHelper {
public:
static const byte TEMP_SOURCE_HEATING = 0;
static const byte TEMP_SOURCE_INDOOR = 1;
static const uint8_t TEMP_SOURCE_HEATING = 0;
static const uint8_t TEMP_SOURCE_INDOOR = 1;
static const char AVAILABILITY_OT_CONN[];
static const char AVAILABILITY_SENSOR_CONN[];
@@ -261,8 +261,13 @@ public:
}
// object id's
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(objId.c_str());
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(objId.c_str());
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(
sSensor.type == Sensors::Type::MANUAL
? FPSTR(HA_ENTITY_NUMBER)
: FPSTR(HA_ENTITY_SENSOR),
objId.c_str()
);
const String& configTopic = this->makeConfigTopic(
sSensor.type == Sensors::Type::MANUAL ? FPSTR(HA_ENTITY_NUMBER) : FPSTR(HA_ENTITY_SENSOR),
@@ -323,8 +328,8 @@ public:
String objId = Sensors::makeObjectIdWithSuffix(sSensor.name, F("connected"));
// object id's
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(objId.c_str());
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(objId.c_str());
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BINARY_SENSOR), objId.c_str());
// state topic
doc[FPSTR(HA_STATE_TOPIC)] = this->getDeviceTopic(
@@ -370,8 +375,8 @@ public:
String objId = Sensors::makeObjectIdWithSuffix(sSensor.name, F("signal_quality"));
// object id's
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(objId.c_str());
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(objId.c_str());
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_SENSOR), objId.c_str());
// state topic
doc[FPSTR(HA_STATE_TOPIC)] = this->getDeviceTopic(
@@ -407,7 +412,6 @@ public:
}
bool deleteSignalQualityDynamicSensor(Sensors::Settings& sSensor) {
JsonDocument doc;
const String& configTopic = this->makeConfigTopic(
FPSTR(HA_ENTITY_SENSOR),
Sensors::makeObjectIdWithSuffix(sSensor.name, F("signal_quality")).c_str()
@@ -421,8 +425,8 @@ public:
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->getObjectIdWithPrefix(F("heating_turbo"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("heating_turbo"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_SWITCH), F("heating_turbo"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_NAME)] = F("Turbo heating");
doc[FPSTR(HA_ICON)] = F("mdi:rocket-launch-outline");
@@ -443,8 +447,8 @@ public:
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->getObjectIdWithPrefix(F("heating_hysteresis"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("heating_hysteresis"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("heating_hysteresis"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE);
@@ -475,8 +479,8 @@ public:
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->getObjectIdWithPrefix(F("heating_turbo_factor"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("heating_turbo_factor"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("heating_turbo_factor"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = F("power_factor");
doc[FPSTR(HA_NAME)] = F("Heating turbo factor");
@@ -499,8 +503,8 @@ public:
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->getObjectIdWithPrefix(F("heating_min_temp"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("heating_min_temp"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("heating_min_temp"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE);
@@ -533,8 +537,8 @@ public:
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->getObjectIdWithPrefix(F("heating_max_temp"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("heating_max_temp"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("heating_max_temp"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE);
@@ -568,8 +572,8 @@ public:
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->getObjectIdWithPrefix(F("dhw_min_temp"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("dhw_min_temp"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("dhw_min_temp"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE);
@@ -602,8 +606,8 @@ public:
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->getObjectIdWithPrefix(F("dhw_max_temp"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("dhw_max_temp"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("dhw_max_temp"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE);
@@ -637,8 +641,8 @@ public:
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->getObjectIdWithPrefix(F("pid"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("pid"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_SWITCH), F("pid"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_NAME)] = F("PID");
doc[FPSTR(HA_ICON)] = F("mdi:chart-bar-stacked");
@@ -659,8 +663,8 @@ public:
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->getObjectIdWithPrefix(F("pid_p"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("pid_p"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("pid_p"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_NAME)] = F("PID factor P");
doc[FPSTR(HA_ICON)] = F("mdi:alpha-p-circle-outline");
@@ -682,8 +686,8 @@ public:
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->getObjectIdWithPrefix(F("pid_i"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("pid_i"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("pid_i"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_NAME)] = F("PID factor I");
doc[FPSTR(HA_ICON)] = F("mdi:alpha-i-circle-outline");
@@ -705,8 +709,8 @@ public:
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->getObjectIdWithPrefix(F("pid_d"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("pid_d"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("pid_d"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_NAME)] = F("PID factor D");
doc[FPSTR(HA_ICON)] = F("mdi:alpha-d-circle-outline");
@@ -728,8 +732,8 @@ public:
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->getObjectIdWithPrefix(F("pid_dt"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("pid_dt"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("pid_dt"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = F("duration");
doc[FPSTR(HA_UNIT_OF_MEASUREMENT)] = F("s");
@@ -753,8 +757,8 @@ public:
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->getObjectIdWithPrefix(F("pid_min_temp"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("pid_min_temp"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("pid_min_temp"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE);
@@ -787,8 +791,8 @@ public:
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->getObjectIdWithPrefix(F("pid_max_temp"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("pid_max_temp"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("pid_max_temp"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE);
@@ -822,8 +826,8 @@ public:
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->getObjectIdWithPrefix(F("equitherm"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("equitherm"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_SWITCH), F("equitherm"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_NAME)] = F("Equitherm");
doc[FPSTR(HA_ICON)] = F("mdi:sun-snowflake-variant");
@@ -840,19 +844,19 @@ public:
return this->publish(this->makeConfigTopic(FPSTR(HA_ENTITY_SWITCH), F("equitherm")).c_str(), doc);
}
bool publishInputEquithermFactorN(bool enabledByDefault = true) {
bool publishInputEquithermSlope(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->getObjectIdWithPrefix(F("equitherm_n"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("equitherm_slope"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("equitherm_slope"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_NAME)] = F("Equitherm factor N");
doc[FPSTR(HA_ICON)] = F("mdi:alpha-n-circle-outline");
doc[FPSTR(HA_NAME)] = F("Equitherm slope");
doc[FPSTR(HA_ICON)] = F("mdi:slope-uphill");
doc[FPSTR(HA_STATE_TOPIC)] = this->settingsTopic.c_str();
doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.equitherm.n_factor|float(0)|round(3) }}");
doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.equitherm.slope|float(0)|round(3) }}");
doc[FPSTR(HA_COMMAND_TOPIC)] = this->setSettingsTopic.c_str();
doc[FPSTR(HA_COMMAND_TEMPLATE)] = F("{\"equitherm\": {\"n_factor\" : {{ value }}}}");
doc[FPSTR(HA_COMMAND_TEMPLATE)] = F("{\"equitherm\": {\"slope\" : {{ value }}}}");
doc[FPSTR(HA_MIN)] = 0.001f;
doc[FPSTR(HA_MAX)] = 10;
doc[FPSTR(HA_STEP)] = 0.001f;
@@ -860,64 +864,88 @@ public:
doc[FPSTR(HA_EXPIRE_AFTER)] = this->expireAfter;
doc.shrinkToFit();
return this->publish(this->makeConfigTopic(FPSTR(HA_ENTITY_NUMBER), F("equitherm_n_factor")).c_str(), doc);
return this->publish(this->makeConfigTopic(FPSTR(HA_ENTITY_NUMBER), F("equitherm_slope")).c_str(), doc);
}
bool publishInputEquithermFactorK(bool enabledByDefault = true) {
bool publishInputEquithermExponent(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->getObjectIdWithPrefix(F("equitherm_k"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("equitherm_exponent"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("equitherm_exponent"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_NAME)] = F("Equitherm factor K");
doc[FPSTR(HA_ICON)] = F("mdi:alpha-k-circle-outline");
doc[FPSTR(HA_NAME)] = F("Equitherm exponent");
doc[FPSTR(HA_ICON)] = F("mdi:exponent");
doc[FPSTR(HA_STATE_TOPIC)] = this->settingsTopic.c_str();
doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.equitherm.k_factor|float(0)|round(2) }}");
doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.equitherm.exponent|float(0)|round(3) }}");
doc[FPSTR(HA_COMMAND_TOPIC)] = this->setSettingsTopic.c_str();
doc[FPSTR(HA_COMMAND_TEMPLATE)] = F("{\"equitherm\": {\"k_factor\" : {{ value }}}}");
doc[FPSTR(HA_MIN)] = 0;
doc[FPSTR(HA_MAX)] = 10;
doc[FPSTR(HA_COMMAND_TEMPLATE)] = F("{\"equitherm\": {\"exponent\" : {{ value }}}}");
doc[FPSTR(HA_MIN)] = 0.1;
doc[FPSTR(HA_MAX)] = 2;
doc[FPSTR(HA_STEP)] = 0.001f;
doc[FPSTR(HA_MODE)] = FPSTR(HA_MODE_BOX);
doc[FPSTR(HA_EXPIRE_AFTER)] = this->expireAfter;
doc.shrinkToFit();
return this->publish(this->makeConfigTopic(FPSTR(HA_ENTITY_NUMBER), F("equitherm_exponent")).c_str(), doc);
}
bool publishInputEquithermShift(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("equitherm_shift"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_NUMBER), F("equitherm_shift"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_TEMPERATURE);
doc[FPSTR(HA_NAME)] = F("Equitherm shift");
doc[FPSTR(HA_ICON)] = F("mdi:chart-areaspline");
doc[FPSTR(HA_STATE_TOPIC)] = this->settingsTopic.c_str();
doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.equitherm.shift|float(0)|round(2) }}");
doc[FPSTR(HA_COMMAND_TOPIC)] = this->setSettingsTopic.c_str();
doc[FPSTR(HA_COMMAND_TEMPLATE)] = F("{\"equitherm\": {\"shift\" : {{ value }}}}");
doc[FPSTR(HA_MIN)] = -15;
doc[FPSTR(HA_MAX)] = 15;
doc[FPSTR(HA_STEP)] = 0.01f;
doc[FPSTR(HA_MODE)] = FPSTR(HA_MODE_BOX);
doc[FPSTR(HA_EXPIRE_AFTER)] = this->expireAfter;
doc.shrinkToFit();
return this->publish(this->makeConfigTopic(FPSTR(HA_ENTITY_NUMBER), F("equitherm_k_factor")).c_str(), doc);
return this->publish(this->makeConfigTopic(FPSTR(HA_ENTITY_NUMBER), F("equitherm_shift")).c_str(), doc);
}
bool publishInputEquithermFactorT(bool enabledByDefault = true) {
bool publishInputEquithermTargetDiffFactor(bool enabledByDefault = true) {
JsonDocument doc;
doc[FPSTR(HA_AVAILABILITY)][0][FPSTR(HA_TOPIC)] = this->statusTopic.c_str();
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = this->settingsTopic.c_str();
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_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("equitherm_t"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(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_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_NAME)] = F("Equitherm factor T");
doc[FPSTR(HA_ICON)] = F("mdi:alpha-t-circle-outline");
doc[FPSTR(HA_NAME)] = F("Equitherm target diff factor");
doc[FPSTR(HA_ICON)] = F("mdi:chart-timeline-variant-shimmer");
doc[FPSTR(HA_STATE_TOPIC)] = this->settingsTopic.c_str();
doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.equitherm.t_factor|float(0)|round(2) }}");
doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.equitherm.targetDiffFactor|float(0)|round(3) }}");
doc[FPSTR(HA_COMMAND_TOPIC)] = this->setSettingsTopic.c_str();
doc[FPSTR(HA_COMMAND_TEMPLATE)] = F("{\"equitherm\": {\"t_factor\" : {{ value }}}}");
doc[FPSTR(HA_COMMAND_TEMPLATE)] = F("{\"equitherm\": {\"targetDiffFactor\" : {{ value }}}}");
doc[FPSTR(HA_MIN)] = 0;
doc[FPSTR(HA_MAX)] = 10;
doc[FPSTR(HA_STEP)] = 0.01f;
doc[FPSTR(HA_STEP)] = 0.001f;
doc[FPSTR(HA_MODE)] = FPSTR(HA_MODE_BOX);
doc[FPSTR(HA_EXPIRE_AFTER)] = this->expireAfter;
doc.shrinkToFit();
return this->publish(this->makeConfigTopic(FPSTR(HA_ENTITY_NUMBER), F("equitherm_t_factor")).c_str(), doc);
return this->publish(this->makeConfigTopic(FPSTR(HA_ENTITY_NUMBER), F("equitherm_target_diff_factor")).c_str(), doc);
}
bool publishStatusState(bool enabledByDefault = true) {
JsonDocument doc;
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("status"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("status"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BINARY_SENSOR), F("status"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_DEVICE_CLASS)] = F("problem");
doc[FPSTR(HA_NAME)] = F("Status");
@@ -934,8 +962,8 @@ public:
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->getObjectIdWithPrefix(F("emergency"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("emergency"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BINARY_SENSOR), F("emergency"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_DEVICE_CLASS)] = F("problem");
doc[FPSTR(HA_NAME)] = F("Emergency");
@@ -952,8 +980,8 @@ public:
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->getObjectIdWithPrefix(F("ot_status"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("ot_status"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BINARY_SENSOR), F("ot_status"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_DEVICE_CLASS)] = F("connectivity");
doc[FPSTR(HA_NAME)] = F("Opentherm status");
@@ -973,9 +1001,8 @@ public:
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true);
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(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_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("heating"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BINARY_SENSOR), F("heating"));
doc[FPSTR(HA_DEVICE_CLASS)] = F("running");
doc[FPSTR(HA_NAME)] = F("Heating");
doc[FPSTR(HA_ICON)] = F("mdi:radiator");
@@ -994,9 +1021,8 @@ public:
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true);
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(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_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("dhw"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BINARY_SENSOR), F("dhw"));
doc[FPSTR(HA_DEVICE_CLASS)] = F("running");
doc[FPSTR(HA_NAME)] = F("DHW");
doc[FPSTR(HA_ICON)] = F("mdi:faucet");
@@ -1015,9 +1041,8 @@ public:
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true);
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(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_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("flame"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BINARY_SENSOR), F("flame"));
doc[FPSTR(HA_DEVICE_CLASS)] = F("running");
doc[FPSTR(HA_NAME)] = F("Flame");
doc[FPSTR(HA_ICON)] = F("mdi:gas-burner");
@@ -1036,8 +1061,8 @@ public:
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true);
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("fault"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("fault"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BINARY_SENSOR), F("fault"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_DEVICE_CLASS)] = F("problem");
doc[FPSTR(HA_NAME)] = F("Fault");
@@ -1057,8 +1082,8 @@ public:
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = JsonString(AVAILABILITY_OT_CONN, true);
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(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_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_DEVICE_CLASS)] = F("problem");
doc[FPSTR(HA_NAME)] = F("Diagnostic");
@@ -1075,8 +1100,8 @@ public:
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->getObjectIdWithPrefix(F("ext_pump"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("ext_pump"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BINARY_SENSOR), F("ext_pump"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_DEVICE_CLASS)] = F("running");
doc[FPSTR(HA_NAME)] = F("External pump");
@@ -1096,8 +1121,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_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("fault_code"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("fault_code"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_SENSOR), F("fault_code"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_NAME)] = F("Fault code");
doc[FPSTR(HA_ICON)] = F("mdi:cog-box");
@@ -1116,8 +1141,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_MODE)] = F("all");
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("diagnostic_code"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("diagnostic_code"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_SENSOR), F("diagnostic_code"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_NAME)] = F("Diagnostic code");
doc[FPSTR(HA_ICON)] = F("mdi:information-box");
@@ -1133,8 +1158,8 @@ public:
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->getObjectIdWithPrefix(FPSTR(S_RSSI));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(FPSTR(S_RSSI));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_SENSOR), FPSTR(S_RSSI));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_DEVICE_CLASS)] = F("signal_strength");
doc[FPSTR(HA_STATE_CLASS)] = FPSTR(HA_STATE_CLASS_MEASUREMENT);
@@ -1153,8 +1178,8 @@ public:
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->getObjectIdWithPrefix(F("uptime"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("uptime"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_SENSOR), F("uptime"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_DIAGNOSTIC);
doc[FPSTR(HA_DEVICE_CLASS)] = F("duration");
doc[FPSTR(HA_STATE_CLASS)] = F("total_increasing");
@@ -1170,12 +1195,12 @@ public:
}
bool publishClimateHeating(UnitSystem unit = UnitSystem::METRIC, byte minTemp = 20, byte maxTemp = 90, bool enabledByDefault = true) {
bool publishClimateHeating(UnitSystem unit = UnitSystem::METRIC, uint8_t minTemp = 20, uint8_t maxTemp = 90, 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->getObjectIdWithPrefix(F("heating"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("heating"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_CLIMATE), F("heating"));
doc[FPSTR(HA_NAME)] = F("Heating");
doc[FPSTR(HA_ICON)] = F("mdi:radiator");
@@ -1222,12 +1247,12 @@ public:
return this->publish(this->makeConfigTopic(FPSTR(HA_ENTITY_CLIMATE), F("heating"), '_').c_str(), doc);
}
bool publishClimateDhw(UnitSystem unit = UnitSystem::METRIC, byte minTemp = 40, byte maxTemp = 60, bool enabledByDefault = true) {
bool publishClimateDhw(UnitSystem unit = UnitSystem::METRIC, uint8_t minTemp = 40, uint8_t maxTemp = 60, 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->getObjectIdWithPrefix(F("dhw"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("dhw"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_CLIMATE), F("dhw"));
doc[FPSTR(HA_NAME)] = F("DHW");
doc[FPSTR(HA_ICON)] = F("mdi:faucet");
@@ -1271,8 +1296,8 @@ public:
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->getObjectIdWithPrefix(FPSTR(S_RESTART));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(FPSTR(S_RESTART));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BUTTON), FPSTR(S_RESTART));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_RESTART);
doc[FPSTR(HA_NAME)] = F("Restart");
@@ -1291,8 +1316,8 @@ public:
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_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("reset_fault"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("reset_fault"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BUTTON), F("reset_fault"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_RESTART);
doc[FPSTR(HA_NAME)] = F("Reset fault");
@@ -1311,8 +1336,8 @@ public:
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_ENABLED_BY_DEFAULT)] = enabledByDefault;
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectIdWithPrefix(F("reset_diagnostic"));
doc[FPSTR(HA_OBJECT_ID)] = doc[FPSTR(HA_UNIQUE_ID)];
doc[FPSTR(HA_UNIQUE_ID)] = this->getUniqueIdWithPrefix(F("reset_diagnostic"));
doc[FPSTR(HA_DEFAULT_ENTITY_ID)] = this->getEntityIdWithPrefix(FPSTR(HA_ENTITY_BUTTON), F("reset_diagnostic"));
doc[FPSTR(HA_ENTITY_CATEGORY)] = FPSTR(HA_ENTITY_CATEGORY_CONFIG);
doc[FPSTR(HA_DEVICE_CLASS)] = FPSTR(S_RESTART);
doc[FPSTR(HA_NAME)] = F("Reset diagnostic");

View File

@@ -609,7 +609,12 @@ protected:
if (GPIO_IS_VALID(settings.externalPump.gpio)) {
configuredGpio = settings.externalPump.gpio;
pinMode(configuredGpio, OUTPUT);
digitalWrite(configuredGpio, LOW);
digitalWrite(
configuredGpio,
settings.externalPump.invertState
? HIGH
: LOW
);
} else if (configuredGpio != GPIO_IS_NOT_CONFIGURED) {
configuredGpio = GPIO_IS_NOT_CONFIGURED;
@@ -637,7 +642,12 @@ protected:
if (!settings.externalPump.use) {
if (vars.externalPump.state) {
digitalWrite(configuredGpio, LOW);
digitalWrite(
configuredGpio,
settings.externalPump.invertState
? HIGH
: LOW
);
vars.externalPump.state = false;
vars.externalPump.lastEnabledTime = millis();
@@ -650,7 +660,12 @@ protected:
if (vars.externalPump.state && !this->heatingEnabled) {
if (this->extPumpStartReason == MainTask::PumpStartReason::HEATING && millis() - this->heatingDisabledTime > (settings.externalPump.postCirculationTime * 1000u)) {
digitalWrite(configuredGpio, LOW);
digitalWrite(
configuredGpio,
settings.externalPump.invertState
? HIGH
: LOW
);
vars.externalPump.state = false;
vars.externalPump.lastEnabledTime = millis();
@@ -658,7 +673,12 @@ protected:
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)) {
digitalWrite(configuredGpio, LOW);
digitalWrite(
configuredGpio,
settings.externalPump.invertState
? HIGH
: LOW
);
vars.externalPump.state = false;
vars.externalPump.lastEnabledTime = millis();
@@ -674,7 +694,12 @@ protected:
this->externalPumpStartTime = millis();
this->extPumpStartReason = MainTask::PumpStartReason::HEATING;
digitalWrite(configuredGpio, HIGH);
digitalWrite(
configuredGpio,
settings.externalPump.invertState
? LOW
: HIGH
);
Log.sinfoln(FPSTR(L_EXTPUMP), F("Enabled: heating on"));
@@ -683,7 +708,12 @@ protected:
this->externalPumpStartTime = millis();
this->extPumpStartReason = MainTask::PumpStartReason::ANTISTUCK;
digitalWrite(configuredGpio, HIGH);
digitalWrite(
configuredGpio,
settings.externalPump.invertState
? LOW
: HIGH
);
Log.sinfoln(FPSTR(L_EXTPUMP), F("Enabled: anti stuck"));
}

View File

@@ -502,9 +502,10 @@ protected:
// equitherm
this->haHelper->publishSwitchEquitherm();
this->haHelper->publishInputEquithermFactorN(false);
this->haHelper->publishInputEquithermFactorK(false);
this->haHelper->publishInputEquithermFactorT(false);
this->haHelper->publishInputEquithermSlope(false);
this->haHelper->publishInputEquithermExponent(false);
this->haHelper->publishInputEquithermShift(false);
this->haHelper->publishInputEquithermTargetDiffFactor(false);
// states
this->haHelper->publishStatusState();
@@ -557,7 +558,7 @@ protected:
}
bool publishNonStaticHaEntities(bool force = false) {
static byte _heatingMinTemp, _heatingMaxTemp, _dhwMinTemp, _dhwMaxTemp = 0;
static uint8_t _heatingMinTemp, _heatingMaxTemp, _dhwMinTemp, _dhwMaxTemp = 0;
static bool _indoorTempControl, _dhwSupport = false;
bool published = false;

View File

@@ -19,8 +19,8 @@ protected:
CustomOpenTherm* instance = nullptr;
unsigned long instanceCreatedTime = 0;
byte instanceInGpio = 0;
byte instanceOutGpio = 0;
uint8_t instanceInGpio = 0;
uint8_t instanceOutGpio = 0;
bool initialized = false;
unsigned long connectedTime = 0;
unsigned long disconnectedTime = 0;
@@ -31,7 +31,7 @@ protected:
unsigned long heatingSetTempTime = 0;
unsigned long dhwSetTempTime = 0;
unsigned long ch2SetTempTime = 0;
byte configuredRxLedGpio = GPIO_IS_NOT_CONFIGURED;
uint8_t configuredRxLedGpio = GPIO_IS_NOT_CONFIGURED;
#if defined(ARDUINO_ARCH_ESP32)
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);
this->instance->setAfterSendRequestCallback([this](unsigned long request, unsigned long response, OpenThermResponseStatus status, byte attempt) {
this->instance->setAfterSendRequestCallback([this](unsigned long request, unsigned long response, OpenThermResponseStatus status, uint8_t attempt) {
Log.sverboseln(
FPSTR(L_OT),
F("ID: %4d Request: %8lx Response: %8lx Msg type: %s Attempt: %2d Status: %s"),
@@ -236,7 +236,7 @@ protected:
vars.slave.heating.active = CustomOpenTherm::isCentralHeatingActive(response);
vars.slave.dhw.active = settings.opentherm.options.dhwSupport ? CustomOpenTherm::isHotWaterActive(response) : false;
vars.slave.flame = CustomOpenTherm::isFlameOn(response);
vars.slave.cooling = CustomOpenTherm::isCoolingActive(response);
vars.slave.cooling.active = CustomOpenTherm::isCoolingActive(response);
vars.slave.ch2.active = CustomOpenTherm::isCh2Active(response);
vars.slave.fault.active = CustomOpenTherm::isFault(response);
@@ -250,7 +250,7 @@ protected:
Log.snoticeln(
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.flame, vars.slave.cooling, vars.slave.ch2.active, vars.slave.fault.active, vars.slave.diag.active
vars.slave.flame, vars.slave.cooling.active, vars.slave.ch2.active, vars.slave.fault.active, vars.slave.diag.active
);
}
@@ -318,6 +318,8 @@ protected:
vars.slave.dhw.enabled = false;
vars.slave.dhw.active = false;
vars.slave.flame = false;
vars.slave.cooling.active = false;
vars.slave.cooling.setpoint = 0;
vars.slave.fault.active = false;
vars.slave.fault.code = 0;
vars.slave.diag.active = false;
@@ -688,6 +690,22 @@ protected:
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
uint8_t targetMaxModulation = vars.slave.modulation.max;
if (vars.slave.heating.active) {
@@ -1568,6 +1586,26 @@ protected:
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) {
const unsigned int request = CustomOpenTherm::toFloat(value);
const unsigned long response = this->instance->sendRequest(CustomOpenTherm::buildRequest(

View File

@@ -1,7 +1,5 @@
#include <Equitherm.h>
#include <GyverPID.h>
Equitherm etRegulator;
GyverPID pidRegulator(0, 0, 0);
@@ -146,39 +144,32 @@ protected:
// if use equitherm
if (settings.equitherm.enabled) {
unsigned short minTemp = settings.heating.minTemp;
unsigned short maxTemp = settings.heating.maxTemp;
float targetTemp = settings.heating.target;
float indoorTemp = vars.master.heating.indoorTemp;
float outdoorTemp = vars.master.heating.outdoorTemp;
float tempDelta = settings.heating.target - vars.master.heating.outdoorTemp;
float maxPoint = settings.heating.target - (
settings.heating.maxTemp - settings.heating.target
) / settings.equitherm.slope;
if (settings.system.unitSystem == UnitSystem::IMPERIAL) {
minTemp = f2c(minTemp);
maxTemp = f2c(maxTemp);
targetTemp = f2c(targetTemp);
indoorTemp = f2c(indoorTemp);
outdoorTemp = f2c(outdoorTemp);
float sf = (settings.heating.maxTemp - settings.heating.target) / pow(
settings.heating.target - maxPoint,
1.0f / settings.equitherm.exponent
);
float etResult = settings.heating.target + settings.equitherm.shift + sf * (
tempDelta >= 0
? pow(tempDelta, 1.0f / settings.equitherm.exponent)
: -(pow(-(tempDelta), 1.0f / settings.equitherm.exponent))
);
// add diff
if (this->indoorSensorsConnected && !settings.pid.enabled && !settings.heating.turbo) {
etResult += constrain(
settings.heating.target - vars.master.heating.indoorTemp,
-3.0f,
3.0f
) * settings.equitherm.targetDiffFactor;
}
if (!this->indoorSensorsConnected || settings.pid.enabled) {
etRegulator.Kt = 0.0f;
etRegulator.indoorTemp = 0.0f;
} else {
etRegulator.Kt = settings.heating.turbo ? 0.0f : settings.equitherm.t_factor;
etRegulator.indoorTemp = indoorTemp;
}
etRegulator.setLimits(minTemp, maxTemp);
etRegulator.Kn = settings.equitherm.n_factor;
etRegulator.Kk = settings.equitherm.k_factor;
etRegulator.targetTemp = targetTemp;
etRegulator.outdoorTemp = outdoorTemp;
float etResult = etRegulator.getResult();
if (settings.system.unitSystem == UnitSystem::IMPERIAL) {
etResult = c2f(etResult);
}
// limit
etResult = constrain(etResult, settings.heating.minTemp, settings.heating.maxTemp);
if (fabsf(prevEtResult - etResult) > 0.09f) {
prevEtResult = etResult;

View File

@@ -334,7 +334,7 @@ public:
uint8_t valueId = (uint8_t) valueType;
if (!isValidValueId(valueId)) {
return false;
return 0;
}
float value = 0.0f;

View File

@@ -8,6 +8,45 @@
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 {
public:
SensorsTask(bool _enabled = false, unsigned long _interval = 0) : LeanTask(_enabled, _interval) {
@@ -41,6 +80,7 @@ protected:
std::unordered_map<uint8_t, bool> dallasPolling;
std::unordered_map<uint8_t, unsigned long> dallasLastPollingTime;
#if USE_BLE
std::unordered_map<uint8_t, NimBLEClient*> bleClients;
std::unordered_map<uint8_t, bool> bleSubscribed;
std::unordered_map<uint8_t, unsigned long> bleLastSetDtTime;
#endif
@@ -385,7 +425,7 @@ protected:
continue;
}
const float sensorResistance = value > 0.001f
const float sensorResistance = value > 1
? DEFAULT_NTC_REF_RESISTANCE / (DEFAULT_NTC_VREF / (float) value - 1.0f)
: 0.0f;
const float rawTemp = 1.0f / (
@@ -405,47 +445,35 @@ protected:
#if USE_BLE
void cleanBleInstances() {
#if USE_BLE
if (!NimBLEDevice::isInitialized()) {
return;
}
for (auto client : NimBLEDevice::getConnectedClients()) {
auto address = client->getPeerAddress();
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;
}
for (auto& [sensorId, pClient]: this->bleClients) {
if (pClient == nullptr) {
continue;
}
if (!used) {
auto& sSensor = Sensors::settings[sensorId];
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(
FPSTR(L_SENSORS_BLE), F("Deleted unused client connected to %s"),
address.toString().c_str()
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s', deleted unused client"),
sensorId, sSensor.name
);
NimBLEDevice::deleteClient(client);
NimBLEDevice::deleteClient(pClient);
pClient = nullptr;
}
}
#endif
}
void pollingBleSensors() {
if (!Sensors::getAmountByType(Sensors::Type::BLUETOOTH, true)) {
return;
}
if (!NimBLEDevice::isInitialized() && millis() > 5000) {
Log.sinfoln(FPSTR(L_SENSORS_BLE), F("Initialized"));
BLEDevice::init("");
@@ -460,38 +488,47 @@ protected:
continue;
}
auto client = this->getBleClient(sensorId);
if (client == nullptr) {
const auto address = NimBLEAddress(sSensor.address, 0);
if (address.isNull()) {
continue;
}
if (!client->isConnected()) {
auto pClient = this->getBleClient(sensorId);
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->bleLastSetDtTime[sensorId] = 0;
if (client->connect()) {
if (pClient->connect(false, true, true)) {
Log.sinfoln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': connected to %s"),
sensorId, sSensor.name, client->getPeerAddress().toString().c_str()
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': trying connecting to %s..."),
sensorId, sSensor.name, pClient->getPeerAddress().toString().c_str()
);
} else {
Log.swarningln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': failed connecting to %s"),
sensorId, sSensor.name, client->getPeerAddress().toString().c_str()
);
continue;
}
continue;
}
if (!this->bleSubscribed[sensorId]) {
if (this->subscribeToBleDevice(sensorId, client)) {
if (this->subscribeToBleDevice(sensorId, pClient)) {
this->bleSubscribed[sensorId] = true;
} else {
this->bleSubscribed[sensorId] = false;
client->disconnect();
pClient->disconnect();
continue;
}
}
@@ -503,7 +540,7 @@ protected:
struct tm ti;
if (getLocalTime(&ti)) {
if (this->setDateOnBleSensor(client, &ti)) {
if (this->setDateOnBleSensor(pClient, &ti)) {
Log.sinfoln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s', successfully set date: %02d.%02d.%04d %02d:%02d:%02d"),
sensorId, sSensor.name,
@@ -535,49 +572,29 @@ protected:
if (!sSensor.enabled || sSensor.type != Sensors::Type::BLUETOOTH || sSensor.purpose == Sensors::Purpose::NOT_CONFIGURED) {
return nullptr;
}
uint8_t addr[6] = {
sSensor.address[0], sSensor.address[1], sSensor.address[2],
sSensor.address[3], sSensor.address[4], sSensor.address[5]
};
const auto address = NimBLEAddress(addr, 0);
NimBLEClient* pClient = NimBLEDevice::getClientByPeerAddress(address);
if (this->bleClients[sensorId] && this->bleClients[sensorId] != nullptr) {
return this->bleClients[sensorId];
}
auto pClient = NimBLEDevice::createClient();
if (pClient == nullptr) {
pClient = NimBLEDevice::getDisconnectedClient();
return nullptr;
}
if (pClient == nullptr) {
if (NimBLEDevice::getCreatedClientCount() >= NIMBLE_MAX_CONNECTIONS) {
return nullptr;
}
//pClient->setConnectionParams(BLE_GAP_CONN_ITVL_MS(10), BLE_GAP_CONN_ITVL_MS(100), 10, 150);
pClient->setConnectTimeout(30000);
pClient->setSelfDelete(false, false);
pClient->setClientCallbacks(new BluetoothClientCallbacks(sensorId), true);
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);
}
this->bleClients[sensorId] = pClient;
return pClient;
}
bool subscribeToBleDevice(const uint8_t sensorId, NimBLEClient* pClient) {
auto& sSensor = Sensors::settings[sensorId];
auto pAddress = pClient->getPeerAddress().toString().c_str();
auto pAddress = pClient->getPeerAddress().toString();
NimBLERemoteService* pService = nullptr;
NimBLERemoteCharacteristic* pChar = nullptr;
@@ -588,13 +605,13 @@ protected:
if (!pService) {
Log.straceln(
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
sensorId, sSensor.name, serviceUuid.toString().c_str(), pAddress.c_str()
);
} else {
Log.straceln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': found env service (%s) on device %s"),
sensorId, sSensor.name, serviceUuid.toString().c_str(), pAddress
sensorId, sSensor.name, serviceUuid.toString().c_str(), pAddress.c_str()
);
// 0x2A6E - Notify temperature x0.01C (pvvx)
@@ -606,7 +623,7 @@ protected:
if (pChar && (pChar->canNotify() || pChar->canIndicate())) {
Log.straceln(
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
sensorId, sSensor.name, charUuid.toString().c_str(), pAddress.c_str()
);
pChar->unsubscribe();
@@ -661,14 +678,14 @@ protected:
Log.straceln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': subscribed to temp char (%s) in env service on device %s"),
sensorId, sSensor.name,
charUuid.toString().c_str(), pAddress
charUuid.toString().c_str(), pAddress.c_str()
);
} else {
Log.swarningln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': failed to subscribe to temp char (%s) in env service on device %s"),
sensorId, sSensor.name,
charUuid.toString().c_str(), pAddress
charUuid.toString().c_str(), pAddress.c_str()
);
}
}
@@ -683,7 +700,7 @@ protected:
if (pChar && (pChar->canNotify() || pChar->canIndicate())) {
Log.straceln(
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
sensorId, sSensor.name, charUuid.toString().c_str(), pAddress.c_str()
);
pChar->unsubscribe();
@@ -738,14 +755,14 @@ protected:
Log.straceln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': subscribed to temp char (%s) in env service on device %s"),
sensorId, sSensor.name,
charUuid.toString().c_str(), pAddress
charUuid.toString().c_str(), pAddress.c_str()
);
} else {
Log.swarningln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': failed to subscribe to temp char (%s) in env service on device %s"),
sensorId, sSensor.name,
charUuid.toString().c_str(), pAddress
charUuid.toString().c_str(), pAddress.c_str()
);
}
}
@@ -754,7 +771,7 @@ protected:
if (!tempNotifyCreated) {
Log.swarningln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': not found supported temp chars in env service on device %s"),
sensorId, sSensor.name, pAddress
sensorId, sSensor.name, pAddress.c_str()
);
pClient->disconnect();
@@ -772,7 +789,7 @@ protected:
if (pChar && (pChar->canNotify() || pChar->canIndicate())) {
Log.straceln(
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
sensorId, sSensor.name, charUuid.toString().c_str(), pAddress.c_str()
);
pChar->unsubscribe();
@@ -827,14 +844,14 @@ protected:
Log.straceln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': subscribed to humidity char (%s) in env service on device %s"),
sensorId, sSensor.name,
charUuid.toString().c_str(), pAddress
charUuid.toString().c_str(), pAddress.c_str()
);
} else {
Log.swarningln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': failed to subscribe to humidity char (%s) in env service on device %s"),
sensorId, sSensor.name,
charUuid.toString().c_str(), pAddress
charUuid.toString().c_str(), pAddress.c_str()
);
}
}
@@ -843,7 +860,7 @@ protected:
if (!humidityNotifyCreated) {
Log.swarningln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': not found supported humidity chars in env service on device %s"),
sensorId, sSensor.name, pAddress
sensorId, sSensor.name, pAddress.c_str()
);
}
}
@@ -857,13 +874,13 @@ protected:
if (!pService) {
Log.straceln(
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
sensorId, sSensor.name, serviceUuid.toString().c_str(), pAddress.c_str()
);
} else {
Log.straceln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': found battery service (%s) on device %s"),
sensorId, sSensor.name, serviceUuid.toString().c_str(), pAddress
sensorId, sSensor.name, serviceUuid.toString().c_str(), pAddress.c_str()
);
// 0x2A19 - Notify the battery charge level 0..99% (pvvx)
@@ -875,7 +892,7 @@ protected:
if (pChar && (pChar->canNotify() || pChar->canIndicate())) {
Log.straceln(
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
sensorId, sSensor.name, charUuid.toString().c_str(), pAddress.c_str()
);
pChar->unsubscribe();
@@ -930,14 +947,14 @@ protected:
Log.straceln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': subscribed to battery char (%s) in battery service on device %s"),
sensorId, sSensor.name,
charUuid.toString().c_str(), pAddress
charUuid.toString().c_str(), pAddress.c_str()
);
} else {
Log.swarningln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': failed to subscribe to battery char (%s) in battery service on device %s"),
sensorId, sSensor.name,
charUuid.toString().c_str(), pAddress
charUuid.toString().c_str(), pAddress.c_str()
);
}
}
@@ -946,7 +963,7 @@ protected:
if (!batteryNotifyCreated) {
Log.swarningln(
FPSTR(L_SENSORS_BLE), F("Sensor #%hhu '%s': not found supported battery chars in battery service on device %s"),
sensorId, sSensor.name, pAddress
sensorId, sSensor.name, pAddress.c_str()
);
}
}

View File

@@ -12,13 +12,13 @@ struct NetworkSettings {
struct {
char ssid[33] = DEFAULT_AP_SSID;
char password[65] = DEFAULT_AP_PASSWORD;
byte channel = 6;
uint8_t channel = 6;
} ap;
struct {
char ssid[33] = DEFAULT_STA_SSID;
char password[65] = DEFAULT_STA_PASSWORD;
byte channel = 0;
uint8_t channel = 0;
} sta;
} networkSettings;
@@ -42,7 +42,7 @@ struct Settings {
} ntp;
UnitSystem unitSystem = UnitSystem::METRIC;
byte statusLedGpio = DEFAULT_STATUS_LED_GPIO;
uint8_t statusLedGpio = DEFAULT_STATUS_LED_GPIO;
} system;
struct {
@@ -54,9 +54,9 @@ struct Settings {
struct {
UnitSystem unitSystem = UnitSystem::METRIC;
byte inGpio = DEFAULT_OT_IN_GPIO;
byte outGpio = DEFAULT_OT_OUT_GPIO;
byte rxLedGpio = DEFAULT_OT_RX_LED_GPIO;
uint8_t inGpio = DEFAULT_OT_IN_GPIO;
uint8_t outGpio = DEFAULT_OT_OUT_GPIO;
uint8_t rxLedGpio = DEFAULT_OT_RX_LED_GPIO;
uint8_t memberId = 0;
uint8_t flags = 0;
float minPower = 0.0f;
@@ -105,8 +105,8 @@ struct Settings {
float target = DEFAULT_HEATING_TARGET_TEMP;
float hysteresis = 0.5f;
float turboFactor = 7.5f;
byte minTemp = DEFAULT_HEATING_MIN_TEMP;
byte maxTemp = DEFAULT_HEATING_MAX_TEMP;
uint8_t minTemp = DEFAULT_HEATING_MIN_TEMP;
uint8_t maxTemp = DEFAULT_HEATING_MAX_TEMP;
uint8_t maxModulation = 100;
struct {
@@ -123,8 +123,8 @@ struct Settings {
struct {
bool enabled = true;
float target = DEFAULT_DHW_TARGET_TEMP;
byte minTemp = DEFAULT_DHW_MIN_TEMP;
byte maxTemp = DEFAULT_DHW_MAX_TEMP;
uint8_t minTemp = DEFAULT_DHW_MIN_TEMP;
uint8_t maxTemp = DEFAULT_DHW_MAX_TEMP;
uint8_t maxModulation = 100;
struct {
@@ -154,14 +154,16 @@ struct Settings {
struct {
bool enabled = false;
float n_factor = 0.7f;
float k_factor = 3.0f;
float t_factor = 2.0f;
float slope = 0.7f;
float exponent = 1.3f;
float shift = 0.0f;
float targetDiffFactor = 2.0f;
} equitherm;
struct {
bool use = false;
byte gpio = DEFAULT_EXT_PUMP_GPIO;
uint8_t gpio = DEFAULT_EXT_PUMP_GPIO;
bool invertState = false;
unsigned short postCirculationTime = 600;
unsigned int antiStuckInterval = 2592000;
unsigned short antiStuckTime = 300;
@@ -170,15 +172,15 @@ struct Settings {
struct {
struct {
bool enabled = false;
byte gpio = GPIO_IS_NOT_CONFIGURED;
byte invertState = false;
uint8_t gpio = GPIO_IS_NOT_CONFIGURED;
bool invertState = false;
unsigned short thresholdTime = 60;
} input;
struct {
bool enabled = false;
byte gpio = GPIO_IS_NOT_CONFIGURED;
byte invertState = false;
uint8_t gpio = GPIO_IS_NOT_CONFIGURED;
bool invertState = false;
unsigned short thresholdTime = 60;
bool onFault = true;
bool onLossConnection = true;
@@ -329,10 +331,14 @@ struct Variables {
bool connected = false;
bool flame = false;
bool cooling = false;
float pressure = 0.0f;
float heatExchangerTemp = 0.0f;
struct {
bool active = false;
uint8_t setpoint = 0;
} cooling;
struct {
bool active = false;
uint8_t code = 0;

View File

@@ -81,6 +81,7 @@ const char S_ENABLED[] PROGMEM = "enabled";
const char S_ENV[] PROGMEM = "env";
const char S_EPC[] PROGMEM = "epc";
const char S_EQUITHERM[] PROGMEM = "equitherm";
const char S_EXPONENT[] PROGMEM = "exponent";
const char S_EXTERNAL_PUMP[] PROGMEM = "externalPump";
const char S_FACTOR[] PROGMEM = "factor";
const char S_FAULT[] PROGMEM = "fault";
@@ -117,7 +118,6 @@ const char S_INVERT_STATE[] PROGMEM = "invertState";
const char S_IP[] PROGMEM = "ip";
const char S_I_FACTOR[] PROGMEM = "i_factor";
const char S_I_MULTIPLIER[] PROGMEM = "i_multiplier";
const char S_K_FACTOR[] PROGMEM = "k_factor";
const char S_LOGIN[] PROGMEM = "login";
const char S_LOG_LEVEL[] PROGMEM = "logLevel";
const char S_LOW_TEMP[] PROGMEM = "lowTemp";
@@ -143,7 +143,6 @@ const char S_NAME[] PROGMEM = "name";
const char S_NATIVE_HEATING_CONTROL[] PROGMEM = "nativeHeatingControl";
const char S_NETWORK[] PROGMEM = "network";
const char S_NTP[] PROGMEM = "ntp";
const char S_N_FACTOR[] PROGMEM = "n_factor";
const char S_OFFSET[] PROGMEM = "offset";
const char S_ON_ENABLED_HEATING[] PROGMEM = "onEnabledHeating";
const char S_ON_FAULT[] PROGMEM = "onFault";
@@ -182,19 +181,23 @@ const char S_SERIAL[] PROGMEM = "serial";
const char S_SERVER[] PROGMEM = "server";
const char S_SETTINGS[] PROGMEM = "settings";
const char S_SET_DATE_AND_TIME[] PROGMEM = "setDateAndTime";
const char S_SHIFT[] PROGMEM = "shift";
const char S_SIGNAL_QUALITY[] PROGMEM = "signalQuality";
const char S_SIZE[] PROGMEM = "size";
const char S_SLAVE[] PROGMEM = "slave";
const char S_SLOPE[] PROGMEM = "slope";
const char S_SSID[] PROGMEM = "ssid";
const char S_STA[] PROGMEM = "sta";
const char S_STATE[] PROGMEM = "state";
const char S_STATIC_CONFIG[] PROGMEM = "staticConfig";
const char S_STATUS_LED_GPIO[] PROGMEM = "statusLedGpio";
const char S_SETPOINT[] PROGMEM = "setpoint";
const char S_SETPOINT_TEMP[] PROGMEM = "setpointTemp";
const char S_SUBNET[] PROGMEM = "subnet";
const char S_SUMMER_WINTER_MODE[] PROGMEM = "summerWinterMode";
const char S_SYSTEM[] PROGMEM = "system";
const char S_TARGET[] PROGMEM = "target";
const char S_TARGET_DIFF_FACTOR[] PROGMEM = "targetDiffFactor";
const char S_TARGET_TEMP[] PROGMEM = "targetTemp";
const char S_TELNET[] PROGMEM = "telnet";
const char S_TEMPERATURE[] PROGMEM = "temperature";
@@ -207,7 +210,6 @@ const char S_TRESHOLD_TIME[] PROGMEM = "tresholdTime";
const char S_TURBO[] PROGMEM = "turbo";
const char S_TURBO_FACTOR[] PROGMEM = "turboFactor";
const char S_TYPE[] PROGMEM = "type";
const char S_T_FACTOR[] PROGMEM = "t_factor";
const char S_UNIT_SYSTEM[] PROGMEM = "unitSystem";
const char S_UPTIME[] PROGMEM = "uptime";
const char S_USE[] PROGMEM = "use";

View File

@@ -72,7 +72,7 @@ time_t mkgmtime(const struct tm *ptm) {
inline bool isDigit(const char* ptr) {
char* endPtr;
strtol(ptr, &endPtr, 10);
auto tmp = strtol(ptr, &endPtr, 10);
return *endPtr == 0;
}
@@ -517,9 +517,10 @@ void settingsToJson(const Settings& src, JsonVariant dst, bool safe = false) {
auto equitherm = dst[FPSTR(S_EQUITHERM)].to<JsonObject>();
equitherm[FPSTR(S_ENABLED)] = src.equitherm.enabled;
equitherm[FPSTR(S_N_FACTOR)] = roundf(src.equitherm.n_factor, 3);
equitherm[FPSTR(S_K_FACTOR)] = roundf(src.equitherm.k_factor, 3);
equitherm[FPSTR(S_T_FACTOR)] = roundf(src.equitherm.t_factor, 3);
equitherm[FPSTR(S_SLOPE)] = roundf(src.equitherm.slope, 3);
equitherm[FPSTR(S_EXPONENT)] = roundf(src.equitherm.exponent, 3);
equitherm[FPSTR(S_SHIFT)] = roundf(src.equitherm.shift, 2);
equitherm[FPSTR(S_TARGET_DIFF_FACTOR)] = roundf(src.equitherm.targetDiffFactor, 3);
auto pid = dst[FPSTR(S_PID)].to<JsonObject>();
pid[FPSTR(S_ENABLED)] = src.pid.enabled;
@@ -542,6 +543,7 @@ void settingsToJson(const Settings& src, JsonVariant dst, bool safe = false) {
auto externalPump = dst[FPSTR(S_EXTERNAL_PUMP)].to<JsonObject>();
externalPump[FPSTR(S_USE)] = src.externalPump.use;
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_ANTI_STUCK_INTERVAL)] = roundf(src.externalPump.antiStuckInterval / 86400, 0);
externalPump[FPSTR(S_ANTI_STUCK_TIME)] = roundf(src.externalPump.antiStuckTime / 60, 0);
@@ -1126,29 +1128,38 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
}
}
if (!src[FPSTR(S_EQUITHERM)][FPSTR(S_N_FACTOR)].isNull()) {
float value = src[FPSTR(S_EQUITHERM)][FPSTR(S_N_FACTOR)].as<float>();
if (!src[FPSTR(S_EQUITHERM)][FPSTR(S_SLOPE)].isNull()) {
float value = src[FPSTR(S_EQUITHERM)][FPSTR(S_SLOPE)].as<float>();
if (value > 0 && value <= 10 && fabsf(value - dst.equitherm.n_factor) > 0.0001f) {
dst.equitherm.n_factor = roundf(value, 3);
if (value > 0.0f && value <= 10.0f && fabsf(value - dst.equitherm.slope) > 0.0001f) {
dst.equitherm.slope = roundf(value, 3);
changed = true;
}
}
if (!src[FPSTR(S_EQUITHERM)][FPSTR(S_K_FACTOR)].isNull()) {
float value = src[FPSTR(S_EQUITHERM)][FPSTR(S_K_FACTOR)].as<float>();
if (!src[FPSTR(S_EQUITHERM)][FPSTR(S_EXPONENT)].isNull()) {
float value = src[FPSTR(S_EQUITHERM)][FPSTR(S_EXPONENT)].as<float>();
if (value >= 0 && value <= 10 && fabsf(value - dst.equitherm.k_factor) > 0.0001f) {
dst.equitherm.k_factor = roundf(value, 3);
if (value > 0.0f && value <= 2.0f && fabsf(value - dst.equitherm.exponent) > 0.0001f) {
dst.equitherm.exponent = roundf(value, 3);
changed = true;
}
}
if (!src[FPSTR(S_EQUITHERM)][FPSTR(S_T_FACTOR)].isNull()) {
float value = src[FPSTR(S_EQUITHERM)][FPSTR(S_T_FACTOR)].as<float>();
if (!src[FPSTR(S_EQUITHERM)][FPSTR(S_SHIFT)].isNull()) {
float value = src[FPSTR(S_EQUITHERM)][FPSTR(S_SHIFT)].as<float>();
if (value >= 0 && value <= 10 && fabsf(value - dst.equitherm.t_factor) > 0.0001f) {
dst.equitherm.t_factor = roundf(value, 3);
if (value >= -15.0f && value <= 15.0f && fabsf(value - dst.equitherm.shift) > 0.0001f) {
dst.equitherm.shift = roundf(value, 2);
changed = true;
}
}
if (!src[FPSTR(S_EQUITHERM)][FPSTR(S_TARGET_DIFF_FACTOR)].isNull()) {
float value = src[FPSTR(S_EQUITHERM)][FPSTR(S_TARGET_DIFF_FACTOR)].as<float>();
if (value >= 0.0f && value <= 10.0f && fabsf(value - dst.equitherm.targetDiffFactor) > 0.0001f) {
dst.equitherm.targetDiffFactor = roundf(value, 3);
changed = true;
}
}
@@ -1324,7 +1335,7 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
if (!src[FPSTR(S_HEATING)][FPSTR(S_MIN_TEMP)].isNull()) {
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.minTemp) {
if (value != dst.heating.minTemp && value >= vars.slave.heating.minTemp && value < vars.slave.heating.maxTemp && value != dst.heating.maxTemp) {
dst.heating.minTemp = value;
changed = true;
}
@@ -1333,7 +1344,7 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
if (!src[FPSTR(S_HEATING)][FPSTR(S_MAX_TEMP)].isNull()) {
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.maxTemp) {
if (value != dst.heating.maxTemp && value > vars.slave.heating.minTemp && value <= vars.slave.heating.maxTemp && value != dst.heating.minTemp) {
dst.heating.maxTemp = value;
changed = true;
}
@@ -1492,6 +1503,15 @@ 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()) {
unsigned short value = src[FPSTR(S_EXTERNAL_PUMP)][FPSTR(S_POST_CIRCULATION_TIME)].as<unsigned short>();
@@ -1894,7 +1914,7 @@ bool jsonToSensorSettings(const uint8_t sensorId, const JsonVariantConst src, Se
// gpio
if (!src[FPSTR(S_GPIO)].isNull()) {
if (dst.type != Sensors::Type::DALLAS_TEMP && dst.type == Sensors::Type::BLUETOOTH && dst.type == Sensors::Type::NTC_10K_TEMP) {
if (dst.type != Sensors::Type::DALLAS_TEMP && dst.type != Sensors::Type::NTC_10K_TEMP) {
if (dst.gpio != GPIO_IS_NOT_CONFIGURED) {
dst.gpio = GPIO_IS_NOT_CONFIGURED;
changed = true;
@@ -1930,12 +1950,20 @@ bool jsonToSensorSettings(const uint8_t sensorId, const JsonVariantConst src, Se
);
if (parsed == 8) {
for (uint8_t i = 0; i < 8; i++) {
for (uint8_t i = 0; i < parsed; i++) {
if (dst.address[i] != tmp[i]) {
dst.address[i] = tmp[i];
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) {
@@ -1948,12 +1976,20 @@ bool jsonToSensorSettings(const uint8_t sensorId, const JsonVariantConst src, Se
);
if (parsed == 6) {
for (uint8_t i = 0; i < 6; i++) {
for (uint8_t i = 0; i < parsed; i++) {
if (dst.address[i] != tmp[i]) {
dst.address[i] = tmp[i];
changed = true;
}
}
} else {
// reset
for (uint8_t i = 0; i < sizeof(dst.address); i++) {
dst.address[i] = 0x00;
}
changed = true;
}
}
}
@@ -2060,7 +2096,10 @@ void varsToJson(const Variables& src, JsonVariant dst) {
slave[FPSTR(S_PROTOCOL_VERSION)] = src.slave.appVersion;
slave[FPSTR(S_CONNECTED)] = src.slave.connected;
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>();
sModulation[FPSTR(S_MIN)] = src.slave.modulation.min;

View File

@@ -109,7 +109,8 @@
"sConnected": "OpenTherm 通讯状态",
"sFlame": "火焰",
"sCooling": "制冷",
"sCoolingActive": "制冷",
"sCoolingSetpoint": "冷却设定点",
"sFaultActive": "报警状态",
"sFaultCode": "报警代码",
"sDiagActive": "诊断状态",
@@ -454,6 +455,7 @@
"extPump": {
"use": "使用外置循环泵",
"gpio": "继电器 GPIO引脚",
"invertState": "切换 GPIO 状态",
"postCirculationTime": "后循环时间 <small>(分钟)</small>",
"antiStuckInterval": "防卡死间隔时间<small>(天)</small>",
"antiStuckTime": "防卡死运行时长<small>(分钟)</small>"

View File

@@ -109,7 +109,8 @@
"sConnected": "OpenTherm connection",
"sFlame": "Flame",
"sCooling": "Cooling",
"sCoolingActive": "Cooling",
"sCoolingSetpoint": "Cooling setpoint",
"sFaultActive": "Fault",
"sFaultCode": "Fault code",
"sDiagActive": "Diagnostic",
@@ -370,11 +371,26 @@
},
"equitherm": {
"n": "N factor",
"k": "K factor",
"t": {
"slope": {
"title": "Slope",
"note": "Heat loss compensation. Main tuning parameter."
},
"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."
},
"shift": {
"title": "Shift",
"note": "Compensates for additional heat losses (e.g., in pipes) or extra heat sources."
},
"targetDiffFactor": {
"title": "T factor",
"note": "Not used if PID is enabled"
"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>."
},
"chart": {
"targetTemp": "Target indoor temperature",
"setpointTemp": "Heat carrier temperature",
"outdoorTemp": "Outdoor temperature"
}
},
@@ -454,6 +470,7 @@
"extPump": {
"use": "Use external pump",
"gpio": "Relay GPIO",
"invertState": "Invert GPIO state",
"postCirculationTime": "Post circulation time <small>(min)</small>",
"antiStuckInterval": "Anti stuck interval <small>(days)</small>",
"antiStuckTime": "Anti stuck time <small>(min)</small>"

View File

@@ -109,7 +109,8 @@
"sConnected": "Connessione OpenTherm",
"sFlame": "Fiamma",
"sCooling": "Raffrescamento",
"sCoolingActive": "Raffrescamento",
"sCoolingSetpoint": "Raffrescamento setpoint",
"sFaultActive": "Anomalia",
"sFaultCode": "Codice anomalia",
"sDiagActive": "Diagnostica",
@@ -370,11 +371,26 @@
},
"equitherm": {
"n": "Fattore N",
"k": "Fattore K",
"t": {
"slope": {
"title": "Pendenza",
"note": "Compensazione delle perdite di calore. Principale parametro di regolazione."
},
"exponent": {
"title": "Esponente",
"note": "Efficienza del radiatore. Valori tipici: <code>1.1</code> - Riscaldamento a pavimento, <code>1.2</code> - Radiatori in ghisa, <code>1.3</code> - Radiatori a pannelli, <code>1.4</code> - Convetttori."
},
"shift": {
"title": "Spostare",
"note": "Compensa le perdite di calore aggiuntive (ad esempio, nelle tubature) o fonti di calore extra."
},
"targetDiffFactor": {
"title": "Fattore T",
"note": "Non usato se PID è attivato"
"note": "Non usato se PID è attivato. Aggiunge al setpoint la differenza tra la temperatura interna target e quella attuale: <code>setpoint = setpoint + ((target - indoor) * T)</code>."
},
"chart": {
"targetTemp": "Temperatura interna target",
"setpointTemp": "Temperatura del portatore di calore",
"outdoorTemp": "Temperatura esterna"
}
},
@@ -454,6 +470,7 @@
"extPump": {
"use": "Usa pompa/circolatore esterno",
"gpio": "GPIO relè",
"invertState": "Inverti stato GPIO",
"postCirculationTime": "Tempo di post circolazione <small>(min)</small>",
"antiStuckInterval": "Intervallo antiblocco <small>(days)</small>",
"antiStuckTime": "Tempo antiblocco <small>(min)</small>"

466
src_data/locales/nl.json Normal file
View File

@@ -0,0 +1,466 @@
{
"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)",
"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": "Hysterese <small>(in graden)</small>",
"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": {
"n": "N-factor",
"k": "K-factor",
"t": {
"title": "T-factor",
"note": "Niet gebruikt als PID is ingeschakeld"
}
},
"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"
},
"nativeHeating": {
"title": "Natuurlijke verwarmingsregeling (ketel)",
"note": "Werkt <u>ALLEEN</u> als de ketel de gewenste kamertemperatuur vereist en zelf de temperatuur van de warmtedrager regelt. Niet compatibel met PID- en Equitherm-regelaars in de firmware."
}
},
"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,7 +109,8 @@
"sConnected": "Подключение к OpenTherm",
"sFlame": "Пламя",
"sCooling": "Охлаждение",
"sCoolingActive": "Охлаждение",
"sCoolingSetpoint": "Охлаждение, уставка",
"sFaultActive": "Ошибка",
"sFaultCode": "Код ошибки",
"sDiagActive": "Диагностика",
@@ -370,11 +371,26 @@
},
"equitherm": {
"n": "Коэффициент N",
"k": "Коэффициент K",
"t": {
"slope": {
"title": "Наклон",
"note": "Компенсация теплопотерь. Основной параметр настройки."
},
"exponent": {
"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": "Не используется, если ПИД включен"
"note": "Не используется, если ПИД включен. Добавляет разницу между целевой и текущей температурой в помещении: <code>setpoint = setpoint + ((target - indoor) * T)</code>."
},
"chart": {
"targetTemp": "Целевая внутренняя температура",
"setpointTemp": "Температура теплоносителя",
"outdoorTemp": "Наружная температура"
}
},
@@ -454,6 +470,7 @@
"extPump": {
"use": "Использовать доп. насос",
"gpio": "GPIO реле",
"invertState": "Инвертировать состояние GPIO",
"postCirculationTime": "Время постциркуляции <small>(в минутах)</small>",
"antiStuckInterval": "Интервал защиты от блокировки <small>(в днях)</small>",
"antiStuckTime": "Время работы насоса <small>(в минутах)</small>"

View File

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

View File

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

View File

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

View File

@@ -23,6 +23,7 @@
<option value="en" selected>EN</option>
<option value="cn">CN</option>
<option value="it">IT</option>
<option value="nl">NL</option>
<option value="ru">RU</option>
</select>
</li>
@@ -240,7 +241,9 @@
setCheckboxValue("[name='filtering']", data.filtering, sensorForm);
setInputValue("[name='filteringFactor']", data.filteringFactor, {}, sensorForm);
sensorForm.querySelector("[name='type']").dispatchEvent(new Event("change"));
setTimeout(() => {
sensorForm.querySelector("[name='type']").dispatchEvent(new Event("change"));
}, 10);
setBusy(".form-busy", "form", false, sensorNode);
};

View File

@@ -23,6 +23,7 @@
<option value="en" selected>EN</option>
<option value="cn">CN</option>
<option value="it">IT</option>
<option value="nl">NL</option>
<option value="ru">RU</option>
</select>
</li>
@@ -105,7 +106,7 @@
<option disabled selected data-i18n>settings.system.ntp.timezonePresets</option>
</select>
</div>
</label>
</label>
</fieldset>
<fieldset>
@@ -353,21 +354,44 @@
</label>
</fieldset>
<div>
<div>
<canvas id="etChart"></canvas>
</div>
<label>
<div>
<span data-i18n>settings.equitherm.chart.targetTemp</span>: <b class="etChartTargetTempValue"></b>°
</div>
<input class="etChartTargetTemp" type="range" value="0" min="0" max="0" step="0.5">
</label>
</div>
<div class="grid">
<label>
<span data-i18n>settings.equitherm.n</span>
<input type="number" inputmode="decimal" name="equitherm[n_factor]" min="0.001" max="10" step="0.001" required>
<span data-i18n>settings.equitherm.slope.title</span>
<input type="number" inputmode="decimal" name="equitherm[slope]" min="0.001" max="10" step="0.001" required>
<small data-i18n>settings.equitherm.slope.note</small>
</label>
<label>
<span data-i18n>settings.equitherm.k</span>
<input type="number" inputmode="decimal" name="equitherm[k_factor]" min="0" max="10" step="0.01" required>
<span data-i18n>settings.equitherm.exponent.title</span>
<input type="number" inputmode="decimal" name="equitherm[exponent]" min="0.1" max="2" step="0.001" required>
<small data-i18n>settings.equitherm.exponent.note</small>
</label>
</div>
<div class="grid">
<label>
<span data-i18n>settings.equitherm.shift.title</span>
<input type="number" inputmode="decimal" name="equitherm[shift]" min="-15" max="15" step="0.01" required>
<small data-i18n>settings.equitherm.shift.note</small>
</label>
<label>
<span data-i18n>settings.equitherm.t.title</span>
<input type="number" inputmode="decimal" name="equitherm[t_factor]" min="0" max="10" step="0.01" required>
<small data-i18n>settings.equitherm.t.note</small>
<span data-i18n>settings.equitherm.targetDiffFactor.title</span>
<input type="number" inputmode="decimal" name="equitherm[targetDiffFactor]" min="0" max="10" step="0.01" required>
<small data-i18n>settings.equitherm.targetDiffFactor.note</small>
</label>
</div>
@@ -423,7 +447,7 @@
<span data-i18n>settings.temp.min</span>
<input type="number" inputmode="decimal" name="pid[minTemp]" min="0" max="0" step="1" required>
</label>
<label>
<span data-i18n>settings.temp.max</span>
<input type="number" inputmode="numeric" name="pid[maxTemp]" min="0" max="0" step="1" required>
@@ -452,12 +476,12 @@
<span data-i18n>settings.pid.deadband.p_multiplier</span>
<input type="number" inputmode="decimal" name="pid[deadband][p_multiplier]" min="0" max="5" step="0.001" required>
</label>
<label>
<span data-i18n>settings.pid.deadband.i_multiplier</span>
<input type="number" inputmode="decimal" name="pid[deadband][i_multiplier]" min="0" max="1" step="0.001" required>
</label>
<label>
<span data-i18n>settings.pid.deadband.d_multiplier</span>
<input type="number" inputmode="decimal" name="pid[deadband][d_multiplier]" min="0" max="1" step="0.001" required>
@@ -469,7 +493,7 @@
<span data-i18n>settings.pid.deadband.thresholdHigh</span>
<input type="number" inputmode="decimal" name="pid[deadband][thresholdHigh]" min="0" max="5" step="0.01" required>
</label>
<label>
<span data-i18n>settings.pid.deadband.thresholdLow</span>
<input type="number" inputmode="decimal" name="pid[deadband][thresholdLow]" min="0" max="5" step="0.01" required>
@@ -651,7 +675,7 @@
</fieldset>
</div>
</details>
<br />
<button type="submit" data-i18n>button.save</button>
</form>
@@ -730,6 +754,11 @@
<input type="checkbox" name="externalPump[use]" value="true">
<span data-i18n>settings.extPump.use</span>
</label>
<label>
<input type="checkbox" name="externalPump[invertState]" value="true">
<span data-i18n>settings.externalPump.invertState</span>
</label>
</fieldset>
<div class="grid">
@@ -860,11 +889,163 @@
</footer>
<script src="/static/app.js?{BUILD_TIME}"></script>
<script src="/static/chart.js?{BUILD_TIME}"></script>
<script>
document.addEventListener('DOMContentLoaded', async () => {
const lang = new Lang(document.getElementById('lang'));
lang.build();
let etChart = null;
let etChartConfig = {
slope: null,
exponent: null,
shift: null,
unitSystem: null,
targetTemp: null,
minTemp: null,
maxTemp: null,
decimated: false
};
const hasNeedDecimationChart = () => {
return window.innerWidth <= 800;
}
const makeEquithermChart = () => {
if (etChart == null) {
const ctx = document.getElementById('etChart').getContext('2d');
try {
etChart = new Chart(ctx, {
type: 'line',
data: {
datasets: [{
borderColor: (context) => {
const chart = context.chart;
const { ctx, chartArea } = chart;
if (!chartArea) {
return;
}
const gradient = ctx.createLinearGradient(0, chartArea.bottom, 0, chartArea.top);
gradient.addColorStop(0, 'rgba(1, 114, 173, 1)');
gradient.addColorStop(0.5, 'rgba(255, 99, 132, 1)');
return gradient;
},
borderWidth: 3,
fill: false,
tension: 0.1,
pointRadius: 2,
pointHoverRadius: 4,
indexAxis: "x",
data: []
}]
},
options: {
responsive: true,
resizeDelay: 500,
parsing: false,
interaction: {
mode: 'nearest',
intersect: false
},
plugins: {
tooltip: {
enabled: true,
position: 'nearest',
displayColors: false,
callbacks: {
title: (items) => {
return `${i18n("settings.equitherm.chart.outdoorTemp")}: ${items[0].label}`;
}
}
},
legend: {
display: false
}
},
scales: {
x: {
display: true,
type: "linear",
reverse: true,
title: {
display: true
},
ticks: {
stepSize: 1,
format: {
style: "unit",
unit: "degree",
unitDisplay: "narrow"
}
}
},
y: {
display: true,
title: {
display: true
},
ticks: {
format: {
style: "unit",
unit: "degree",
unitDisplay: "narrow"
}
}
}
}
}
});
} catch (error) {
console.log(error);
}
}
if (!etChart) {
return;
}
let data = [];
etChartConfig.decimated = hasNeedDecimationChart();
for (let value = 30; value >= -30; value -= etChartConfig.decimated ? 2 : 1) {
const outdoorTemp = etChartConfig.unitSystem == 0 ? value : c2f(value);
data.push({
x: parseFloat(outdoorTemp.toFixed(1)),
y: parseFloat(calculateEquithermTemp(outdoorTemp).toFixed(1))
});
}
etChart.data.datasets[0].data = data;
etChart.data.datasets[0].label = i18n("settings.equitherm.chart.setpointTemp");
etChart.options.scales.x.title.text = i18n("settings.equitherm.chart.outdoorTemp");
etChart.options.scales.y.title.text = i18n("settings.equitherm.chart.setpointTemp");
etChart.update();
}
const calculateEquithermTemp = (outdoorTemp) => {
const tempDelta = etChartConfig.targetTemp - outdoorTemp;
const maxPoint = etChartConfig.targetTemp - (
etChartConfig.maxTemp - etChartConfig.targetTemp
) / etChartConfig.slope;
const sf = (etChartConfig.maxTemp - etChartConfig.targetTemp) / Math.pow(
etChartConfig.targetTemp - maxPoint,
1 / etChartConfig.exponent
);
const result = etChartConfig.targetTemp + etChartConfig.shift + sf * (
tempDelta >= 0
? Math.pow(tempDelta, 1 / etChartConfig.exponent)
: -(Math.pow(-(tempDelta), 1 / etChartConfig.exponent))
);
return Math.max(Math.min(result, etChartConfig.maxTemp), etChartConfig.minTemp);
}
const fillData = (data) => {
// System
setSelectValue("[name='system[logLevel]']", data.system.logLevel);
@@ -927,6 +1108,7 @@
// Extpump
setCheckboxValue("[name='externalPump[use]']", data.externalPump.use);
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[antiStuckInterval]']", data.externalPump.antiStuckInterval);
setInputValue("[name='externalPump[antiStuckTime]']", data.externalPump.antiStuckTime);
@@ -1012,9 +1194,10 @@
// Equitherm
setCheckboxValue("[name='equitherm[enabled]']", data.equitherm.enabled);
setInputValue("[name='equitherm[n_factor]']", data.equitherm.n_factor);
setInputValue("[name='equitherm[k_factor]']", data.equitherm.k_factor);
setInputValue("[name='equitherm[t_factor]']", data.equitherm.t_factor);
setInputValue("[name='equitherm[slope]']", data.equitherm.slope);
setInputValue("[name='equitherm[exponent]']", data.equitherm.exponent);
setInputValue("[name='equitherm[shift]']", data.equitherm.shift);
setInputValue("[name='equitherm[targetDiffFactor]']", data.equitherm.targetDiffFactor);
setBusy('#equitherm-settings-busy', '#equitherm-settings', false);
// PID
@@ -1038,6 +1221,24 @@
setInputValue("[name='pid[deadband][thresholdHigh]']", data.pid.deadband.thresholdHigh);
setInputValue("[name='pid[deadband][thresholdLow]']", data.pid.deadband.thresholdLow);
setBusy('#pid-settings-busy', '#pid-settings', false);
const etMinTemp = parseInt(data.system.unitSystem == 0 ? 5 : 41);
const etMaxTemp = parseInt(data.system.unitSystem == 0 ? 30 : 86);
const etTargetTemp = constrain(parseFloat(data.heating.target), etMinTemp, etMaxTemp);
setInputValue(".etChartTargetTemp", etTargetTemp.toFixed(1), {
"min": etMinTemp,
"max": etMaxTemp
});
etChartConfig.slope = data.equitherm.slope;
etChartConfig.exponent = data.equitherm.exponent;
etChartConfig.shift = data.equitherm.shift;
etChartConfig.unitSystem = data.system.unitSystem;
etChartConfig.minTemp = data.heating.minTemp;
etChartConfig.maxTemp = data.heating.maxTemp;
makeEquithermChart();
};
try {
@@ -1067,7 +1268,7 @@
cache: "no-cache",
credentials: "include"
});
if (!response.ok) {
throw new Error('Response not valid');
}
@@ -1090,6 +1291,57 @@
} catch (error) {
console.log(error);
}
document.querySelector(".etChartTargetTemp").addEventListener("input", async (event) => {
setValue('.etChartTargetTempValue', parseFloat(event.target.value).toFixed(1));
});
document.querySelector(".etChartTargetTemp").addEventListener("change", async (event) => {
if (!event.target.checkValidity()) {
return;
}
etChartConfig.targetTemp = parseFloat(event.target.value);
setValue('.etChartTargetTempValue', etChartConfig.targetTemp.toFixed(1));
makeEquithermChart();
});
document.querySelector("[name='equitherm[slope]']").addEventListener("change", async (event) => {
if (!event.target.checkValidity()) {
return;
}
etChartConfig.slope = parseFloat(event.target.value);
makeEquithermChart();
});
document.querySelector("[name='equitherm[exponent]']").addEventListener("change", async (event) => {
if (!event.target.checkValidity()) {
return;
}
etChartConfig.exponent = parseFloat(event.target.value);
makeEquithermChart();
});
document.querySelector("[name='equitherm[shift]']").addEventListener("change", async (event) => {
if (!event.target.checkValidity()) {
return;
}
etChartConfig.shift = parseFloat(event.target.value);
makeEquithermChart();
});
window.addEventListener('resize', async (event) => {
if (etChart) {
etChart.resize();
if (etChartConfig.decimated != hasNeedDecimationChart()) {
makeEquithermChart();
}
}
});
});
</script>
</body>

View File

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

14
src_data/scripts/chart.js Normal file

File diff suppressed because one or more lines are too long

View File

@@ -5,8 +5,13 @@ const setupForm = (formSelector, onResultCallback = null, noCastItems = []) => {
}
form.querySelectorAll('input').forEach(item => {
item.addEventListener('change', (e) => {
e.target.setAttribute('aria-invalid', !e.target.checkValidity());
item.addEventListener('change', (event) => {
if (!event.target.checkValidity()) {
event.target.setAttribute('aria-invalid', true);
} else if (event.target.hasAttribute('aria-invalid')) {
event.target.removeAttribute('aria-invalid');
}
})
});
@@ -630,6 +635,10 @@ const setCheckboxValue = (selector, value, parent = undefined) => {
}
item.checked = value;
setTimeout(() => {
item.dispatchEvent(new Event("change"));
}, 10);
}
const setRadioValue = (selector, value, parent = undefined) => {
@@ -643,7 +652,14 @@ const setRadioValue = (selector, value, parent = undefined) => {
}
for (let item of items) {
item.checked = item.value == value;
const checked = item.value == value;
if (item.checked != checked) {
item.checked = checked;
setTimeout(() => {
item.dispatchEvent(new Event("change"));
}, 10);
}
}
}
@@ -658,13 +674,17 @@ const setInputValue = (selector, value, attrs = {}, parent = undefined) => {
}
for (let item of items) {
item.value = value;
if (attrs instanceof Object) {
for (let attrKey of Object.keys(attrs)) {
item.setAttribute(attrKey, attrs[attrKey]);
}
}
item.value = value;
setTimeout(() => {
item.dispatchEvent(new Event("change"));
}, 10);
}
}
@@ -853,4 +873,12 @@ function dec2hex(i) {
function constrain(amt, low, high) {
return ((amt) < (low) ? (low) : ((amt) > (high) ? (high) : (amt)));
}
function c2f(value) {
return (9 / 5) * value + 32;
}
function f2c(value) {
return (value - 32) * (5 / 9);
}