mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-25 17:43:35 +05:00
Compare commits
4 Commits
dc62f99b7d
...
57cf98ca19
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57cf98ca19 | ||
|
|
c32c643442 | ||
|
|
5553a13cc0 | ||
|
|
a9e97c15ad |
@@ -37,7 +37,7 @@ build_flags =
|
||||
-D BUILD_ENV='"$PIOENV"'
|
||||
-D USE_SERIAL=${secrets.use_serial}
|
||||
-D USE_TELNET=${secrets.use_telnet}
|
||||
-D DEBUG_BY_DEFAULT=${secrets.debug}
|
||||
-D DEFAULT_LOG_LEVEL=${secrets.log_level}
|
||||
-D DEFAULT_HOSTNAME='"${secrets.hostname}"'
|
||||
-D DEFAULT_AP_SSID='"${secrets.ap_ssid}"'
|
||||
-D DEFAULT_AP_PASSWORD='"${secrets.ap_password}"'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[secrets]
|
||||
use_serial = true
|
||||
use_telnet = true
|
||||
debug = true
|
||||
log_level = 5
|
||||
hostname = opentherm
|
||||
|
||||
ap_ssid = OpenTherm Gateway
|
||||
|
||||
@@ -266,30 +266,6 @@ public:
|
||||
return this->publish(this->getTopic(FPSTR(HA_ENTITY_NUMBER), F("heating_max_temp")).c_str(), doc);
|
||||
}
|
||||
|
||||
bool publishNumberHeatingMaxModulation(bool enabledByDefault = true) {
|
||||
JsonDocument doc;
|
||||
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
|
||||
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectId(F("heating_max_modulation"));
|
||||
doc[FPSTR(HA_OBJECT_ID)] = this->getObjectId(F("heating_max_modulation"));
|
||||
doc[FPSTR(HA_ENTITY_CATEGORY)] = F("config");
|
||||
doc[FPSTR(HA_DEVICE_CLASS)] = F("power_factor");
|
||||
doc[FPSTR(HA_UNIT_OF_MEASUREMENT)] = F("%");
|
||||
doc[FPSTR(HA_NAME)] = F("Max modulation");
|
||||
doc[FPSTR(HA_ICON)] = F("mdi:speedometer");
|
||||
doc[FPSTR(HA_STATE_TOPIC)] = this->getDeviceTopic(F("settings"));
|
||||
doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.heating.maxModulation|int(1) }}");
|
||||
doc[FPSTR(HA_COMMAND_TOPIC)] = this->getDeviceTopic(F("settings/set"));
|
||||
doc[FPSTR(HA_COMMAND_TEMPLATE)] = F("{\"heating\": {\"maxModulation\" : {{ value }}}}");
|
||||
doc[FPSTR(HA_MIN)] = 1;
|
||||
doc[FPSTR(HA_MAX)] = 100;
|
||||
doc[FPSTR(HA_STEP)] = 1;
|
||||
doc[FPSTR(HA_MODE)] = "box";
|
||||
doc[FPSTR(HA_EXPIRE_AFTER)] = 120;
|
||||
doc.shrinkToFit();
|
||||
|
||||
return this->publish(this->getTopic(FPSTR(HA_ENTITY_NUMBER), F("heating_max_modulation")).c_str(), doc);
|
||||
}
|
||||
|
||||
|
||||
bool publishSwitchDhw(bool enabledByDefault = true) {
|
||||
JsonDocument doc;
|
||||
@@ -872,38 +848,15 @@ public:
|
||||
return this->publish(this->getTopic(FPSTR(HA_ENTITY_BINARY_SENSOR), F("diagnostic")).c_str(), doc);
|
||||
}
|
||||
|
||||
bool publishSensorMaxPower(bool enabledByDefault = true) {
|
||||
bool publishSensorPower(bool enabledByDefault = true) {
|
||||
JsonDocument doc;
|
||||
doc[FPSTR(HA_AVAILABILITY)][0][FPSTR(HA_TOPIC)] = this->getDeviceTopic(F("status"));
|
||||
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = this->getDeviceTopic(F("state"));
|
||||
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = F("{{ iif(value_json.states.otStatus, 'online', 'offline') }}");
|
||||
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
|
||||
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
|
||||
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectId(F("max_power"));
|
||||
doc[FPSTR(HA_OBJECT_ID)] = this->getObjectId(F("max_power"));
|
||||
doc[FPSTR(HA_ENTITY_CATEGORY)] = F("diagnostic");
|
||||
doc[FPSTR(HA_DEVICE_CLASS)] = F("power");
|
||||
doc[FPSTR(HA_STATE_CLASS)] = F("measurement");
|
||||
doc[FPSTR(HA_UNIT_OF_MEASUREMENT)] = F("kW");
|
||||
doc[FPSTR(HA_NAME)] = F("Max power");
|
||||
doc[FPSTR(HA_ICON)] = F("mdi:chart-bar");
|
||||
doc[FPSTR(HA_STATE_TOPIC)] = this->getDeviceTopic(F("state"));
|
||||
doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.sensors.maxPower|float(0)|round(2) }}");
|
||||
doc[FPSTR(HA_EXPIRE_AFTER)] = 120;
|
||||
doc.shrinkToFit();
|
||||
|
||||
return this->publish(this->getTopic(FPSTR(HA_ENTITY_SENSOR), F("max_power")).c_str(), doc);
|
||||
}
|
||||
|
||||
bool publishSensorCurrentPower(bool enabledByDefault = true) {
|
||||
JsonDocument doc;
|
||||
doc[FPSTR(HA_AVAILABILITY)][0][FPSTR(HA_TOPIC)] = this->getDeviceTopic(F("status"));
|
||||
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_TOPIC)] = this->getDeviceTopic(F("state"));
|
||||
doc[FPSTR(HA_AVAILABILITY)][1][FPSTR(HA_VALUE_TEMPLATE)] = F("{{ iif(value_json.states.otStatus, 'online', 'offline') }}");
|
||||
doc[FPSTR(HA_AVAILABILITY_MODE)] = F("all");
|
||||
doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault;
|
||||
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectId(F("current_power"));
|
||||
doc[FPSTR(HA_OBJECT_ID)] = this->getObjectId(F("current_power"));
|
||||
doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectId(F("power"));
|
||||
doc[FPSTR(HA_OBJECT_ID)] = this->getObjectId(F("power"));
|
||||
doc[FPSTR(HA_ENTITY_CATEGORY)] = F("diagnostic");
|
||||
doc[FPSTR(HA_DEVICE_CLASS)] = F("power");
|
||||
doc[FPSTR(HA_STATE_CLASS)] = F("measurement");
|
||||
@@ -911,11 +864,11 @@ public:
|
||||
doc[FPSTR(HA_NAME)] = F("Current power");
|
||||
doc[FPSTR(HA_ICON)] = F("mdi:chart-bar");
|
||||
doc[FPSTR(HA_STATE_TOPIC)] = this->getDeviceTopic(F("state"));
|
||||
doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.sensors.currentPower|float(0)|round(2) }}");
|
||||
doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.sensors.power|float(0)|round(2) }}");
|
||||
doc[FPSTR(HA_EXPIRE_AFTER)] = 120;
|
||||
doc.shrinkToFit();
|
||||
|
||||
return this->publish(this->getTopic(FPSTR(HA_ENTITY_SENSOR), F("current_power")).c_str(), doc);
|
||||
return this->publish(this->getTopic(FPSTR(HA_ENTITY_SENSOR), F("power")).c_str(), doc);
|
||||
}
|
||||
|
||||
bool publishSensorFaultCode(bool enabledByDefault = true) {
|
||||
|
||||
@@ -99,11 +99,10 @@ protected:
|
||||
tMqtt->disable();
|
||||
}
|
||||
|
||||
if ( Log.getLevel() != TinyLogger::Level::INFO && !settings.system.debug ) {
|
||||
Log.setLevel(TinyLogger::Level::INFO);
|
||||
|
||||
} else if ( Log.getLevel() != TinyLogger::Level::VERBOSE && settings.system.debug ) {
|
||||
Log.setLevel(TinyLogger::Level::VERBOSE);
|
||||
if (settings.system.logLevel >= TinyLogger::Level::SILENT && settings.system.logLevel <= TinyLogger::Level::VERBOSE) {
|
||||
if (Log.getLevel() != settings.system.logLevel) {
|
||||
Log.setLevel(static_cast<TinyLogger::Level>(settings.system.logLevel));
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -160,7 +159,7 @@ protected:
|
||||
this->restartSignalTime = millis();
|
||||
}
|
||||
|
||||
if (!settings.system.debug) {
|
||||
if (settings.system.logLevel < TinyLogger::Level::VERBOSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ protected:
|
||||
return;
|
||||
}
|
||||
|
||||
if (settings.system.debug) {
|
||||
if (settings.system.logLevel >= TinyLogger::Level::TRACE) {
|
||||
Log.strace(FPSTR(L_MQTT_MSG), F("Topic: %s\r\n> "), topic);
|
||||
if (Log.lock()) {
|
||||
for (size_t i = 0; i < length; i++) {
|
||||
@@ -329,7 +329,6 @@ protected:
|
||||
this->haHelper->publishSensorBoilerHeatingMaxTemp(settings.system.unitSystem, false);
|
||||
this->haHelper->publishNumberHeatingMinTemp(settings.system.unitSystem, false);
|
||||
this->haHelper->publishNumberHeatingMaxTemp(settings.system.unitSystem, false);
|
||||
this->haHelper->publishNumberHeatingMaxModulation(false);
|
||||
|
||||
// pid
|
||||
this->haHelper->publishSwitchPid();
|
||||
@@ -357,8 +356,7 @@ protected:
|
||||
// sensors
|
||||
this->haHelper->publishSensorModulation(false);
|
||||
this->haHelper->publishSensorPressure(settings.system.unitSystem, false);
|
||||
this->haHelper->publishSensorMaxPower(false);
|
||||
this->haHelper->publishSensorCurrentPower();
|
||||
this->haHelper->publishSensorPower();
|
||||
this->haHelper->publishSensorFaultCode();
|
||||
this->haHelper->publishSensorDiagnosticCode();
|
||||
this->haHelper->publishSensorRssi(false);
|
||||
|
||||
@@ -185,7 +185,11 @@ protected:
|
||||
);
|
||||
|
||||
if (!CustomOpenTherm::isValidResponse(response)) {
|
||||
Log.swarningln(FPSTR(L_OT), F("Invalid response after setBoilerStatus: %s"), CustomOpenTherm::statusToString(this->instance->getLastResponseStatus()));
|
||||
Log.swarningln(
|
||||
FPSTR(L_OT),
|
||||
F("Failed receive boiler status: %s"),
|
||||
CustomOpenTherm::statusToString(this->instance->getLastResponseStatus())
|
||||
);
|
||||
}
|
||||
|
||||
if (!vars.states.otStatus && millis() - this->lastSuccessResponse < 1150) {
|
||||
@@ -241,6 +245,12 @@ protected:
|
||||
vars.states.fault = CustomOpenTherm::isFault(response);
|
||||
vars.states.diagnostic = CustomOpenTherm::isDiagnostic(response);
|
||||
|
||||
Log.snoticeln(
|
||||
FPSTR(L_OT),
|
||||
F("Received boiler status. Heating: %hhu; DHW: %hhu; flame: %hhu; fault: %hhu; diag: %hhu"),
|
||||
vars.states.heating, vars.states.dhw, vars.states.flame, vars.states.fault, vars.states.diagnostic
|
||||
);
|
||||
|
||||
// Fault state
|
||||
if (this->configuredFaultStateGpio != GPIO_IS_NOT_CONFIGURED) {
|
||||
bool fState = vars.states.fault ^ settings.opentherm.invertFaultState ? HIGH : LOW;
|
||||
@@ -254,32 +264,43 @@ protected:
|
||||
// These parameters will be updated every minute
|
||||
if (millis() - this->prevUpdateNonEssentialVars > 60000) {
|
||||
if (this->updateMinModulationLevel()) {
|
||||
Log.straceln(FPSTR(L_OT), F("Min modulation: %u%%, boiler max power: %u kW"), vars.parameters.minModulation, vars.sensors.maxPower);
|
||||
Log.snoticeln(
|
||||
FPSTR(L_OT),
|
||||
F("Received min modulation: %hhu%%, max power: %hhu kW"),
|
||||
vars.parameters.minModulation,
|
||||
vars.parameters.maxPower
|
||||
);
|
||||
|
||||
if (vars.parameters.minModulation > settings.heating.maxModulation) {
|
||||
settings.heating.maxModulation = vars.parameters.minModulation;
|
||||
if (settings.opentherm.maxModulation < vars.parameters.minModulation) {
|
||||
settings.opentherm.maxModulation = vars.parameters.minModulation;
|
||||
fsSettings.update();
|
||||
Log.snoticeln(FPSTR(L_OT_DHW), F("Updated min modulation: %hhu"), settings.heating.maxModulation);
|
||||
Log.swarningln(FPSTR(L_SETTINGS_OT), F("Updated min modulation: %hhu%%"), settings.opentherm.maxModulation);
|
||||
}
|
||||
|
||||
if (fabsf(settings.opentherm.maxPower) < 0.1f && vars.parameters.maxPower > 0) {
|
||||
settings.opentherm.maxPower = vars.parameters.maxPower;
|
||||
fsSettings.update();
|
||||
Log.swarningln(FPSTR(L_SETTINGS_OT), F("Updated max power: %.2f kW"), settings.opentherm.maxPower);
|
||||
}
|
||||
|
||||
} else {
|
||||
Log.swarningln(FPSTR(L_OT), F("Failed get min modulation & max power"));
|
||||
Log.swarningln(FPSTR(L_OT), F("Failed receive min modulation and max power"));
|
||||
}
|
||||
|
||||
if (!heatingEnabled && settings.opentherm.modulationSyncWithHeating) {
|
||||
if (this->setMaxModulationLevel(0)) {
|
||||
Log.snoticeln(FPSTR(L_OT_HEATING), F("Set max modulation 0% (off)"));
|
||||
Log.snoticeln(FPSTR(L_OT), F("Set max modulation: 0% (off)"));
|
||||
|
||||
} else {
|
||||
Log.swarningln(FPSTR(L_OT_HEATING), F("Failed set max modulation 0% (off)"));
|
||||
Log.swarningln(FPSTR(L_OT), F("Failed set max modulation: 0% (off)"));
|
||||
}
|
||||
|
||||
} else {
|
||||
if (this->setMaxModulationLevel(settings.heating.maxModulation)) {
|
||||
Log.snoticeln(FPSTR(L_OT_HEATING), F("Set max modulation %hhu%%"), settings.heating.maxModulation);
|
||||
if (this->setMaxModulationLevel(settings.opentherm.maxModulation)) {
|
||||
Log.snoticeln(FPSTR(L_OT), F("Set max modulation: %hhu%%"), settings.opentherm.maxModulation);
|
||||
|
||||
} else {
|
||||
Log.swarningln(FPSTR(L_OT_HEATING), F("Failed set max modulation %hhu%%"), settings.heating.maxModulation);
|
||||
Log.swarningln(FPSTR(L_OT), F("Failed set max modulation: %hhu%%"), settings.opentherm.maxModulation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,23 +308,30 @@ protected:
|
||||
// Get DHW min/max temp (if necessary)
|
||||
if (settings.opentherm.dhwPresent && settings.opentherm.getMinMaxTemp) {
|
||||
if (this->updateMinMaxDhwTemp()) {
|
||||
Log.snoticeln(
|
||||
FPSTR(L_OT_DHW),
|
||||
F("Received min temp: %hhu, max temp: %hhu"),
|
||||
vars.parameters.dhwMinTemp,
|
||||
vars.parameters.dhwMaxTemp
|
||||
);
|
||||
|
||||
if (settings.dhw.minTemp < vars.parameters.dhwMinTemp) {
|
||||
settings.dhw.minTemp = vars.parameters.dhwMinTemp;
|
||||
fsSettings.update();
|
||||
Log.snoticeln(FPSTR(L_OT_DHW), F("Updated min temp: %hhu"), settings.dhw.minTemp);
|
||||
Log.swarningln(FPSTR(L_SETTINGS_DHW), F("Updated min temp: %hhu"), settings.dhw.minTemp);
|
||||
}
|
||||
|
||||
if (settings.dhw.maxTemp > vars.parameters.dhwMaxTemp) {
|
||||
settings.dhw.maxTemp = vars.parameters.dhwMaxTemp;
|
||||
fsSettings.update();
|
||||
Log.snoticeln(FPSTR(L_OT_DHW), F("Updated max temp: %hhu"), settings.dhw.maxTemp);
|
||||
Log.swarningln(FPSTR(L_SETTINGS_DHW), F("Updated max temp: %hhu"), settings.dhw.maxTemp);
|
||||
}
|
||||
|
||||
} else {
|
||||
vars.parameters.dhwMinTemp = convertTemp(DEFAULT_DHW_MIN_TEMP, UnitSystem::METRIC, settings.system.unitSystem);
|
||||
vars.parameters.dhwMaxTemp = convertTemp(DEFAULT_DHW_MAX_TEMP, UnitSystem::METRIC, settings.system.unitSystem);
|
||||
|
||||
Log.swarningln(FPSTR(L_OT_DHW), F("Failed get min/max temp"));
|
||||
Log.swarningln(FPSTR(L_OT_DHW), F("Failed receive min/max temp"));
|
||||
}
|
||||
|
||||
if (settings.dhw.minTemp >= settings.dhw.maxTemp) {
|
||||
@@ -317,23 +345,30 @@ protected:
|
||||
// Get heating min/max temp
|
||||
if (settings.opentherm.getMinMaxTemp) {
|
||||
if (this->updateMinMaxHeatingTemp()) {
|
||||
Log.snoticeln(
|
||||
FPSTR(L_OT_HEATING),
|
||||
F("Received min temp: %hhu, max temp: %hhu"),
|
||||
vars.parameters.heatingMinTemp,
|
||||
vars.parameters.heatingMaxTemp
|
||||
);
|
||||
|
||||
if (settings.heating.minTemp < vars.parameters.heatingMinTemp) {
|
||||
settings.heating.minTemp = vars.parameters.heatingMinTemp;
|
||||
fsSettings.update();
|
||||
Log.snoticeln(FPSTR(L_OT_HEATING), F("Updated min temp: %hhu"), settings.heating.minTemp);
|
||||
Log.swarningln(FPSTR(L_SETTINGS_HEATING), F("Updated min temp: %hhu"), settings.heating.minTemp);
|
||||
}
|
||||
|
||||
if (settings.heating.maxTemp > vars.parameters.heatingMaxTemp) {
|
||||
settings.heating.maxTemp = vars.parameters.heatingMaxTemp;
|
||||
fsSettings.update();
|
||||
Log.snoticeln(FPSTR(L_OT_HEATING), F("Updated max temp: %hhu"), settings.heating.maxTemp);
|
||||
Log.swarningln(FPSTR(L_SETTINGS_HEATING), F("Updated max temp: %hhu"), settings.heating.maxTemp);
|
||||
}
|
||||
|
||||
} else {
|
||||
vars.parameters.heatingMinTemp = convertTemp(DEFAULT_HEATING_MIN_TEMP, UnitSystem::METRIC, settings.system.unitSystem);
|
||||
vars.parameters.heatingMaxTemp = convertTemp(DEFAULT_HEATING_MAX_TEMP, UnitSystem::METRIC, settings.system.unitSystem);
|
||||
|
||||
Log.swarningln(FPSTR(L_OT_HEATING), F("Failed get min/max temp"));
|
||||
Log.swarningln(FPSTR(L_OT_HEATING), F("Failed receive min/max temp"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,7 +380,19 @@ protected:
|
||||
|
||||
// Get fault code (if necessary)
|
||||
if (vars.states.fault) {
|
||||
this->updateFaultCode();
|
||||
if (this->updateFaultCode()) {
|
||||
Log.snoticeln(
|
||||
FPSTR(L_OT),
|
||||
F("Received fault code: %hhu%% (0x%02X)"),
|
||||
vars.sensors.faultCode,
|
||||
vars.sensors.faultCode
|
||||
);
|
||||
|
||||
} else {
|
||||
vars.sensors.faultCode = 0;
|
||||
|
||||
Log.swarningln(FPSTR(L_OT), F("Failed receive fault code"));
|
||||
}
|
||||
|
||||
} else if (vars.sensors.faultCode != 0) {
|
||||
vars.sensors.faultCode = 0;
|
||||
@@ -353,7 +400,19 @@ protected:
|
||||
|
||||
// Get diagnostic code (if necessary)
|
||||
if (vars.states.fault || vars.states.diagnostic) {
|
||||
this->updateDiagCode();
|
||||
if (this->updateDiagCode()) {
|
||||
Log.snoticeln(
|
||||
FPSTR(L_OT),
|
||||
F("Received diag code: %hhu%% (0x%02X)"),
|
||||
vars.sensors.diagnosticCode,
|
||||
vars.sensors.diagnosticCode
|
||||
);
|
||||
|
||||
} else {
|
||||
vars.sensors.diagnosticCode = 0;
|
||||
|
||||
Log.swarningln(FPSTR(L_OT), F("Failed receive diag code"));
|
||||
}
|
||||
|
||||
} else if (vars.sensors.diagnosticCode != 0) {
|
||||
vars.sensors.diagnosticCode = 0;
|
||||
@@ -364,11 +423,21 @@ protected:
|
||||
if (!settings.opentherm.filterNumValues.enable) {
|
||||
// Get outdoor temp (if necessary)
|
||||
if (settings.sensors.outdoor.type == SensorType::BOILER) {
|
||||
this->updateOutdoorTemp();
|
||||
if (this->updateOutdoorTemp()) {
|
||||
Log.snoticeln(FPSTR(L_OT), F("Received outdoor temp: %.2f"), vars.temperatures.outdoor);
|
||||
|
||||
} else {
|
||||
Log.swarningln(FPSTR(L_OT), F("Failed receive outdoor temp"));
|
||||
}
|
||||
}
|
||||
|
||||
// Get pressure
|
||||
this->updatePressure();
|
||||
if (this->updatePressure()) {
|
||||
Log.snoticeln(FPSTR(L_OT), F("Received pressure: %.2f"), vars.sensors.pressure);
|
||||
|
||||
} else {
|
||||
Log.swarningln(FPSTR(L_OT), F("Failed receive pressure"));
|
||||
}
|
||||
}
|
||||
|
||||
this->prevUpdateNonEssentialVars = millis();
|
||||
@@ -376,28 +445,52 @@ protected:
|
||||
|
||||
|
||||
// Get current modulation level (if necessary)
|
||||
if (vars.states.flame && this->updateModulationLevel()) {
|
||||
vars.sensors.currentPower = vars.sensors.maxPower > 0
|
||||
? vars.sensors.maxPower * (vars.sensors.modulation / 100)
|
||||
: 0;
|
||||
|
||||
Log.sverboseln(
|
||||
FPSTR(L_OT_DHW),
|
||||
F("Current modulation level: %.2f%%, power: %.2f of %hhu kW"),
|
||||
vars.sensors.modulation,
|
||||
vars.sensors.currentPower,
|
||||
vars.sensors.maxPower
|
||||
);
|
||||
if (vars.states.flame) {
|
||||
if (this->updateModulationLevel()) {
|
||||
if (settings.opentherm.maxPower > 0.1f) {
|
||||
float modulatedPower = settings.opentherm.maxPower - settings.opentherm.minPower;
|
||||
vars.sensors.power = settings.opentherm.minPower + (modulatedPower / 100.0f * vars.sensors.modulation);
|
||||
|
||||
} else {
|
||||
vars.sensors.power = 0.0f;
|
||||
}
|
||||
|
||||
Log.snoticeln(
|
||||
FPSTR(L_OT),
|
||||
F("Received modulation level: %.2f%%, power: %.2f of %.2f kW (min: %.2f kW)"),
|
||||
vars.sensors.modulation,
|
||||
vars.sensors.power,
|
||||
settings.opentherm.maxPower,
|
||||
settings.opentherm.minPower
|
||||
);
|
||||
|
||||
} else {
|
||||
vars.sensors.modulation = 0;
|
||||
vars.sensors.power = 0;
|
||||
|
||||
Log.swarningln(FPSTR(L_OT), F("Failed receive modulation level"));
|
||||
}
|
||||
|
||||
} else {
|
||||
vars.sensors.modulation = 0;
|
||||
vars.sensors.currentPower = 0;
|
||||
vars.sensors.power = 0;
|
||||
}
|
||||
|
||||
// Update DHW sensors (if necessary)
|
||||
if (settings.opentherm.dhwPresent) {
|
||||
this->updateDhwTemp();
|
||||
this->updateDhwFlowRate();
|
||||
if (this->updateDhwTemp()) {
|
||||
Log.snoticeln(FPSTR(L_OT_DHW), F("Received temp: %.2f"), vars.temperatures.dhw);
|
||||
|
||||
} else {
|
||||
Log.swarningln(FPSTR(L_OT_DHW), F("Failed receive temp"));
|
||||
}
|
||||
|
||||
if (this->updateDhwFlowRate()) {
|
||||
Log.snoticeln(FPSTR(L_OT_DHW), F("Received flow rate: %.2f"), vars.sensors.dhwFlowRate);
|
||||
|
||||
} else {
|
||||
Log.swarningln(FPSTR(L_OT_DHW), F("Failed receive flow rate"));
|
||||
}
|
||||
|
||||
} else {
|
||||
vars.temperatures.dhw = 0.0f;
|
||||
@@ -405,24 +498,49 @@ protected:
|
||||
}
|
||||
|
||||
// Get current heating temp
|
||||
this->updateHeatingTemp();
|
||||
if (this->updateHeatingTemp()) {
|
||||
Log.snoticeln(FPSTR(L_OT_HEATING), F("Received temp: %.2f"), vars.temperatures.heating);
|
||||
|
||||
} else {
|
||||
Log.swarningln(FPSTR(L_OT_HEATING), F("Failed receive temp"));
|
||||
}
|
||||
|
||||
// Get heating return temp
|
||||
this->updateHeatingReturnTemp();
|
||||
if (this->updateHeatingReturnTemp()) {
|
||||
Log.snoticeln(FPSTR(L_OT_HEATING), F("Received return temp: %.2f"), vars.temperatures.heatingReturn);
|
||||
|
||||
} else {
|
||||
Log.swarningln(FPSTR(L_OT_HEATING), F("Failed receive return temp"));
|
||||
}
|
||||
|
||||
// Get exhaust temp
|
||||
this->updateExhaustTemp();
|
||||
if (this->updateExhaustTemp()) {
|
||||
Log.snoticeln(FPSTR(L_OT), F("Received exhaust temp: %.2f"), vars.temperatures.exhaust);
|
||||
|
||||
} else {
|
||||
Log.swarningln(FPSTR(L_OT), F("Failed receive exhaust temp"));
|
||||
}
|
||||
|
||||
// If filtering is enabled, these parameters
|
||||
// must be updated every time.
|
||||
if (settings.opentherm.filterNumValues.enable) {
|
||||
// Get outdoor temp (if necessary)
|
||||
if (settings.sensors.outdoor.type == SensorType::BOILER) {
|
||||
this->updateOutdoorTemp();
|
||||
if (this->updateOutdoorTemp()) {
|
||||
Log.snoticeln(FPSTR(L_OT), F("Received outdoor temp: %.2f"), vars.temperatures.outdoor);
|
||||
|
||||
} else {
|
||||
Log.swarningln(FPSTR(L_OT), F("Failed receive outdoor temp"));
|
||||
}
|
||||
}
|
||||
|
||||
// Get pressure
|
||||
this->updatePressure();
|
||||
if (this->updatePressure()) {
|
||||
Log.snoticeln(FPSTR(L_OT), F("Received pressure: %.2f"), vars.sensors.pressure);
|
||||
|
||||
} else {
|
||||
Log.swarningln(FPSTR(L_OT), F("Failed receive pressure"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -573,46 +691,46 @@ protected:
|
||||
void initialize() {
|
||||
// Not all boilers support these, only try once when the boiler becomes connected
|
||||
if (this->updateSlaveVersion()) {
|
||||
Log.straceln(FPSTR(L_OT), F("Slave version: %u, type: %u"), vars.parameters.slaveVersion, vars.parameters.slaveType);
|
||||
Log.snoticeln(FPSTR(L_OT), F("Received slave version: %u, type: %u"), vars.parameters.slaveVersion, vars.parameters.slaveType);
|
||||
|
||||
} else {
|
||||
Log.swarningln(FPSTR(L_OT), F("Get slave version failed"));
|
||||
Log.swarningln(FPSTR(L_OT), F("Failed receive slave version"));
|
||||
}
|
||||
|
||||
// 0x013F
|
||||
if (this->setMasterVersion(0x3F, 0x01)) {
|
||||
Log.straceln(FPSTR(L_OT), F("Master version: %u, type: %u"), vars.parameters.masterVersion, vars.parameters.masterType);
|
||||
Log.snoticeln(FPSTR(L_OT), F("Set master version: %u, type: %u"), vars.parameters.masterVersion, vars.parameters.masterType);
|
||||
|
||||
} else {
|
||||
Log.swarningln(FPSTR(L_OT), F("Set master version failed"));
|
||||
Log.swarningln(FPSTR(L_OT), F("Failed set master version"));
|
||||
}
|
||||
|
||||
if (this->updateSlaveOtVersion()) {
|
||||
Log.straceln(FPSTR(L_OT), F("Slave OT version: %f"), vars.parameters.slaveOtVersion);
|
||||
Log.snoticeln(FPSTR(L_OT), F("Received slave OT version: %f"), vars.parameters.slaveOtVersion);
|
||||
|
||||
} else {
|
||||
Log.swarningln(FPSTR(L_OT), F("Get slave OT version failed"));
|
||||
Log.swarningln(FPSTR(L_OT), F("Failed receive slave OT version"));
|
||||
}
|
||||
|
||||
if (this->setMasterOtVersion(2.2f)) {
|
||||
Log.straceln(FPSTR(L_OT), F("Master OT version: %f"), vars.parameters.masterOtVersion);
|
||||
Log.snoticeln(FPSTR(L_OT), F("Set master OT version: %f"), vars.parameters.masterOtVersion);
|
||||
|
||||
} else {
|
||||
Log.swarningln(FPSTR(L_OT), F("Set master OT version failed"));
|
||||
Log.swarningln(FPSTR(L_OT), F("Failed set master OT version"));
|
||||
}
|
||||
|
||||
if (this->updateSlaveConfig()) {
|
||||
Log.straceln(FPSTR(L_OT), F("Slave member id: %u, flags: %u"), vars.parameters.slaveMemberId, vars.parameters.slaveFlags);
|
||||
Log.snoticeln(FPSTR(L_OT), F("Received slave member id: %u, flags: %u"), vars.parameters.slaveMemberId, vars.parameters.slaveFlags);
|
||||
|
||||
} else {
|
||||
Log.swarningln(FPSTR(L_OT), F("Get slave config failed"));
|
||||
Log.swarningln(FPSTR(L_OT), F("Failed receive slave config"));
|
||||
}
|
||||
|
||||
if (this->setMasterConfig(settings.opentherm.memberIdCode & 0xFF, (settings.opentherm.memberIdCode & 0xFFFF) >> 8)) {
|
||||
Log.straceln(FPSTR(L_OT), F("Master member id: %u, flags: %u"), vars.parameters.masterMemberId, vars.parameters.masterFlags);
|
||||
Log.snoticeln(FPSTR(L_OT), F("Set master member id: %u, flags: %u"), vars.parameters.masterMemberId, vars.parameters.masterFlags);
|
||||
|
||||
} else {
|
||||
Log.swarningln(FPSTR(L_OT), F("Set master config failed"));
|
||||
Log.swarningln(FPSTR(L_OT), F("Failed set master config"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1023,7 +1141,6 @@ protected:
|
||||
));
|
||||
|
||||
if (!CustomOpenTherm::isValidResponse(response)) {
|
||||
vars.sensors.faultCode = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1039,7 +1156,6 @@ protected:
|
||||
));
|
||||
|
||||
if (!CustomOpenTherm::isValidResponse(response)) {
|
||||
vars.sensors.diagnosticCode = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1059,6 +1175,10 @@ protected:
|
||||
}
|
||||
|
||||
float value = CustomOpenTherm::getFloat(response);
|
||||
if (value < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (settings.opentherm.filterNumValues.enable && fabs(vars.sensors.modulation) >= 0.1f) {
|
||||
vars.sensors.modulation += (value - vars.sensors.modulation) * settings.opentherm.filterNumValues.factor;
|
||||
|
||||
@@ -1080,11 +1200,8 @@ protected:
|
||||
return false;
|
||||
}
|
||||
|
||||
byte minModulation = response & 0xFF;
|
||||
byte maxPower = (response & 0xFFFF) >> 8;
|
||||
|
||||
vars.parameters.minModulation = minModulation;
|
||||
vars.sensors.maxPower = maxPower;
|
||||
vars.parameters.minModulation = response & 0xFF;
|
||||
vars.parameters.maxPower = (response & 0xFFFF) >> 8;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#define PORTAL_CACHE_TIME "max-age=86400"
|
||||
#define PORTAL_CACHE settings.system.debug ? nullptr : PORTAL_CACHE_TIME
|
||||
#define PORTAL_CACHE (settings.system.logLevel >= TinyLogger::Level::TRACE ? nullptr : PORTAL_CACHE_TIME)
|
||||
#ifdef ARDUINO_ARCH_ESP8266
|
||||
#include <ESP8266WebServer.h>
|
||||
#include <Updater.h>
|
||||
|
||||
@@ -24,7 +24,7 @@ struct NetworkSettings {
|
||||
|
||||
struct Settings {
|
||||
struct {
|
||||
bool debug = DEBUG_BY_DEFAULT;
|
||||
uint8_t logLevel = DEFAULT_LOG_LEVEL;
|
||||
|
||||
struct {
|
||||
bool enable = USE_SERIAL;
|
||||
@@ -54,8 +54,11 @@ struct Settings {
|
||||
byte faultStateGpio = DEFAULT_OT_FAULT_STATE_GPIO;
|
||||
byte invertFaultState = false;
|
||||
unsigned int memberIdCode = 0;
|
||||
uint8_t maxModulation = 100;
|
||||
float pressureFactor = 1.0f;
|
||||
float dhwFlowRateFactor = 1.0f;
|
||||
float minPower = 0.0f;
|
||||
float maxPower = 0.0f;
|
||||
bool dhwPresent = true;
|
||||
bool summerWinterMode = false;
|
||||
bool heatingCh2Enabled = true;
|
||||
@@ -103,7 +106,6 @@ struct Settings {
|
||||
float hysteresis = 0.5f;
|
||||
byte minTemp = DEFAULT_HEATING_MIN_TEMP;
|
||||
byte maxTemp = DEFAULT_HEATING_MAX_TEMP;
|
||||
byte maxModulation = 100;
|
||||
} heating;
|
||||
|
||||
struct {
|
||||
@@ -174,8 +176,7 @@ struct Variables {
|
||||
float modulation = 0.0f;
|
||||
float pressure = 0.0f;
|
||||
float dhwFlowRate = 0.0f;
|
||||
byte maxPower = 0;
|
||||
float currentPower = 0.0f;
|
||||
float power = 0.0f;
|
||||
byte faultCode = 0;
|
||||
unsigned short diagnosticCode = 0;
|
||||
int8_t rssi = 0;
|
||||
@@ -214,6 +215,7 @@ struct Variables {
|
||||
byte dhwMaxTemp = DEFAULT_DHW_MAX_TEMP;
|
||||
byte minModulation = 0;
|
||||
byte maxModulation = 0;
|
||||
uint8_t maxPower = 0;
|
||||
uint8_t slaveMemberId = 0;
|
||||
uint8_t slaveFlags = 0;
|
||||
uint8_t slaveType = 0;
|
||||
|
||||
@@ -62,8 +62,8 @@
|
||||
#define DEFAULT_STA_PASSWORD ""
|
||||
#endif
|
||||
|
||||
#ifndef DEBUG_BY_DEFAULT
|
||||
#define DEBUG_BY_DEFAULT false
|
||||
#ifndef DEFAULT_LOG_LEVEL
|
||||
#define DEFAULT_LOG_LEVEL TinyLogger::Level::VERBOSE
|
||||
#endif
|
||||
|
||||
#ifndef DEFAULT_STATUS_LED_GPIO
|
||||
|
||||
@@ -129,7 +129,9 @@ void setup() {
|
||||
Log.addStream(telnetStream);
|
||||
}
|
||||
|
||||
Log.setLevel(settings.system.debug ? TinyLogger::Level::VERBOSE : TinyLogger::Level::INFO);
|
||||
if (settings.system.logLevel >= TinyLogger::Level::SILENT && settings.system.logLevel <= TinyLogger::Level::VERBOSE) {
|
||||
Log.setLevel(static_cast<TinyLogger::Level>(settings.system.logLevel));
|
||||
}
|
||||
|
||||
// network
|
||||
network = (new NetworkMgr)
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
#endif
|
||||
|
||||
const char L_SETTINGS[] PROGMEM = "SETTINGS";
|
||||
const char L_SETTINGS_OT[] PROGMEM = "SETTINGS.OT";
|
||||
const char L_SETTINGS_DHW[] PROGMEM = "SETTINGS.DHW";
|
||||
const char L_SETTINGS_HEATING[] PROGMEM = "SETTINGS.HEATING";
|
||||
const char L_NETWORK[] PROGMEM = "NETWORK";
|
||||
const char L_NETWORK_SETTINGS[] PROGMEM = "NETWORK.SETTINGS";
|
||||
const char L_PORTAL_WEBSERVER[] PROGMEM = "PORTAL.WEBSERVER";
|
||||
|
||||
53
src/utils.h
53
src/utils.h
@@ -326,7 +326,7 @@ bool jsonToNetworkSettings(const JsonVariantConst src, NetworkSettings& dst) {
|
||||
|
||||
void settingsToJson(const Settings& src, JsonVariant dst, bool safe = false) {
|
||||
if (!safe) {
|
||||
dst["system"]["debug"] = src.system.debug;
|
||||
dst["system"]["logLevel"] = static_cast<uint8_t>(src.system.logLevel);
|
||||
dst["system"]["serial"]["enable"] = src.system.serial.enable;
|
||||
dst["system"]["serial"]["baudrate"] = src.system.serial.baudrate;
|
||||
dst["system"]["telnet"]["enable"] = src.system.telnet.enable;
|
||||
@@ -345,8 +345,11 @@ void settingsToJson(const Settings& src, JsonVariant dst, bool safe = false) {
|
||||
dst["opentherm"]["faultStateGpio"] = src.opentherm.faultStateGpio;
|
||||
dst["opentherm"]["invertFaultState"] = src.opentherm.invertFaultState;
|
||||
dst["opentherm"]["memberIdCode"] = src.opentherm.memberIdCode;
|
||||
dst["opentherm"]["maxModulation"] = src.opentherm.maxModulation;
|
||||
dst["opentherm"]["pressureFactor"] = roundd(src.opentherm.pressureFactor, 2);
|
||||
dst["opentherm"]["dhwFlowRateFactor"] = roundd(src.opentherm.dhwFlowRateFactor, 2);
|
||||
dst["opentherm"]["minPower"] = roundd(src.opentherm.minPower, 2);
|
||||
dst["opentherm"]["maxPower"] = roundd(src.opentherm.maxPower, 2);
|
||||
dst["opentherm"]["dhwPresent"] = src.opentherm.dhwPresent;
|
||||
dst["opentherm"]["summerWinterMode"] = src.opentherm.summerWinterMode;
|
||||
dst["opentherm"]["heatingCh2Enabled"] = src.opentherm.heatingCh2Enabled;
|
||||
@@ -386,7 +389,6 @@ void settingsToJson(const Settings& src, JsonVariant dst, bool safe = false) {
|
||||
dst["heating"]["hysteresis"] = roundd(src.heating.hysteresis, 2);
|
||||
dst["heating"]["minTemp"] = src.heating.minTemp;
|
||||
dst["heating"]["maxTemp"] = src.heating.maxTemp;
|
||||
dst["heating"]["maxModulation"] = src.heating.maxModulation;
|
||||
|
||||
dst["dhw"]["enable"] = src.dhw.enable;
|
||||
dst["dhw"]["target"] = roundd(src.dhw.target, 1);
|
||||
@@ -457,11 +459,11 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
|
||||
|
||||
if (!safe) {
|
||||
// system
|
||||
if (src["system"]["debug"].is<bool>()) {
|
||||
bool value = src["system"]["debug"].as<bool>();
|
||||
if (!src["system"]["logLevel"].isNull()) {
|
||||
uint8_t value = src["system"]["logLevel"].as<uint8_t>();
|
||||
|
||||
if (value != dst.system.debug) {
|
||||
dst.system.debug = value;
|
||||
if (value != dst.system.logLevel && value >= TinyLogger::Level::SILENT && value <= TinyLogger::Level::VERBOSE) {
|
||||
dst.system.logLevel = value;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
@@ -698,6 +700,15 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
|
||||
}
|
||||
}
|
||||
|
||||
if (!src["opentherm"]["maxModulation"].isNull()) {
|
||||
unsigned char value = src["opentherm"]["maxModulation"].as<unsigned char>();
|
||||
|
||||
if (value > 0 && value <= 100 && value != dst.opentherm.maxModulation) {
|
||||
dst.opentherm.maxModulation = value;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!src["opentherm"]["pressureFactor"].isNull()) {
|
||||
float value = src["opentherm"]["pressureFactor"].as<float>();
|
||||
|
||||
@@ -716,6 +727,24 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
|
||||
}
|
||||
}
|
||||
|
||||
if (!src["opentherm"]["minPower"].isNull()) {
|
||||
float value = src["opentherm"]["minPower"].as<float>();
|
||||
|
||||
if (value >= 0 && value <= 1000 && fabs(value - dst.opentherm.minPower) > 0.0001f) {
|
||||
dst.opentherm.minPower = roundd(value, 2);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!src["opentherm"]["maxPower"].isNull()) {
|
||||
float value = src["opentherm"]["maxPower"].as<float>();
|
||||
|
||||
if (value >= 0 && value <= 1000 && fabs(value - dst.opentherm.maxPower) > 0.0001f) {
|
||||
dst.opentherm.maxPower = roundd(value, 2);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (src["opentherm"]["filterNumValues"]["enable"].is<bool>()) {
|
||||
bool value = src["opentherm"]["filterNumValues"]["enable"].as<bool>();
|
||||
|
||||
@@ -1185,15 +1214,6 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
|
||||
}
|
||||
}
|
||||
|
||||
if (!src["heating"]["maxModulation"].isNull()) {
|
||||
unsigned char value = src["heating"]["maxModulation"].as<unsigned char>();
|
||||
|
||||
if (value > 0 && value <= 100 && value != dst.heating.maxModulation) {
|
||||
dst.heating.maxModulation = value;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// dhw
|
||||
if (src["dhw"]["enable"].is<bool>()) {
|
||||
@@ -1546,8 +1566,7 @@ void varsToJson(const Variables& src, JsonVariant dst) {
|
||||
dst["sensors"]["modulation"] = roundd(src.sensors.modulation, 2);
|
||||
dst["sensors"]["pressure"] = roundd(src.sensors.pressure, 2);
|
||||
dst["sensors"]["dhwFlowRate"] = roundd(src.sensors.dhwFlowRate, 2);
|
||||
dst["sensors"]["maxPower"] = src.sensors.maxPower;
|
||||
dst["sensors"]["currentPower"] = roundd(src.sensors.currentPower, 2);
|
||||
dst["sensors"]["power"] = roundd(src.sensors.power, 2);
|
||||
dst["sensors"]["faultCode"] = src.sensors.faultCode;
|
||||
dst["sensors"]["diagnosticCode"] = src.sensors.diagnosticCode;
|
||||
dst["sensors"]["rssi"] = src.sensors.rssi;
|
||||
|
||||
@@ -100,8 +100,7 @@
|
||||
"modulation": "Modulation",
|
||||
"pressure": "Pressure",
|
||||
"dhwFlowRate": "DHW flow rate",
|
||||
"maxPower": "Max power",
|
||||
"currentPower": "Current power",
|
||||
"power": "Current power",
|
||||
"faultCode": "Fault code",
|
||||
"diagCode": "Diagnostic code",
|
||||
"indoorTemp": "Indoor temp",
|
||||
@@ -199,13 +198,10 @@
|
||||
"metric": "Metric <small>(celsius, liters, bar)</small>",
|
||||
"imperial": "Imperial <small>(fahrenheit, gallons, psi)</small>",
|
||||
"statusLedGpio": "Status LED GPIO",
|
||||
"debug": "Debug mode",
|
||||
"logLevel": "Log level",
|
||||
"serial": {
|
||||
"enable": "Enable Serial port",
|
||||
"baud": {
|
||||
"title": "Serial port baud rate",
|
||||
"note": "Available: 9600, 19200, 38400, 57600, 74880, 115200"
|
||||
}
|
||||
"baud": "Serial port baud rate"
|
||||
},
|
||||
"telnet": {
|
||||
"enable": "Enable Telnet",
|
||||
@@ -217,8 +213,7 @@
|
||||
},
|
||||
|
||||
"heating": {
|
||||
"hyst": "Hysteresis <small>(in degrees)</small>",
|
||||
"maxMod": "Max modulation level"
|
||||
"hyst": "Hysteresis <small>(in degrees)</small>"
|
||||
},
|
||||
|
||||
"emergency": {
|
||||
@@ -260,10 +255,12 @@
|
||||
},
|
||||
|
||||
"ot": {
|
||||
"advanced": "Advanced Settings",
|
||||
"inGpio": "In GPIO",
|
||||
"outGpio": "Out GPIO",
|
||||
"ledGpio": "RX LED GPIO",
|
||||
"memberIdCode": "Master MemberID code",
|
||||
"maxMod": "Max modulation level",
|
||||
"pressureFactor": {
|
||||
"title": "Coeff. pressure correction",
|
||||
"note": "If the pressure displayed is <b>X10</b> from the real one, set the <b>0.1</b>."
|
||||
@@ -272,6 +269,14 @@
|
||||
"title": "Coeff. DHW flow rate correction",
|
||||
"note": "If the DHW flow rate displayed is <b>X10</b> from the real one, set the <b>0.1</b>."
|
||||
},
|
||||
"minPower": {
|
||||
"title": "Min boiler power <small>(kW)</small>",
|
||||
"note": "This value is at 0-1% boiler modulation level. Typically found in the boiler specification as \"minimum useful heat output\"."
|
||||
},
|
||||
"maxPower": {
|
||||
"title": "Max boiler power <small>(kW)</small>",
|
||||
"note": "<b>0</b> - try detect automatically. Typically found in the boiler specification as \"maximum useful heat output\"."
|
||||
},
|
||||
"fnv": {
|
||||
"title": "Filtering numeric values",
|
||||
"enable": {
|
||||
|
||||
@@ -100,8 +100,7 @@
|
||||
"modulation": "Уровень модуляции",
|
||||
"pressure": "Давление",
|
||||
"dhwFlowRate": "Расход ГВС",
|
||||
"maxPower": "Макс. мощность",
|
||||
"currentPower": "Текущая мощность",
|
||||
"power": "Текущая мощность",
|
||||
"faultCode": "Код ошибки",
|
||||
"diagCode": "Диагностический код",
|
||||
"indoorTemp": "Внутренняя темп.",
|
||||
@@ -199,13 +198,10 @@
|
||||
"metric": "Метрическая <small>(цильсии, литры, бары)</small>",
|
||||
"imperial": "Imperial <small>(фаренгейты, галлоны, psi)</small>",
|
||||
"statusLedGpio": "Статус LED GPIO",
|
||||
"debug": "Отладка",
|
||||
"logLevel": "Уровень логирования",
|
||||
"serial": {
|
||||
"enable": "Вкл. Serial порт",
|
||||
"baud": {
|
||||
"title": "Скорость Serial порта",
|
||||
"note": "Доступно: 9600, 19200, 38400, 57600, 74880, 115200"
|
||||
}
|
||||
"baud": "Скорость Serial порта"
|
||||
},
|
||||
"telnet": {
|
||||
"enable": "Вкл. Telnet",
|
||||
@@ -217,8 +213,7 @@
|
||||
},
|
||||
|
||||
"heating": {
|
||||
"hyst": "Гистерезис <small>(в градусах)</small>",
|
||||
"maxMod": "Макс. уровень модуляции"
|
||||
"hyst": "Гистерезис <small>(в градусах)</small>"
|
||||
},
|
||||
|
||||
"emergency": {
|
||||
@@ -260,10 +255,12 @@
|
||||
},
|
||||
|
||||
"ot": {
|
||||
"advanced": "Дополнительные настройки",
|
||||
"inGpio": "Вход GPIO",
|
||||
"outGpio": "Выход GPIO",
|
||||
"ledGpio": "RX LED GPIO",
|
||||
"memberIdCode": "Master MemberID код",
|
||||
"maxMod": "Макс. уровень модуляции",
|
||||
"pressureFactor": {
|
||||
"title": "Коэфф. коррекции давления",
|
||||
"note": "Если давление отображается <b>Х10</b> от реального, установите значение <b>0.1</b>."
|
||||
@@ -272,6 +269,14 @@
|
||||
"title": "Коэфф. коррекции потока ГВС",
|
||||
"note": "Если поток ГВС отображается <b>Х10</b> от реального, установите значение <b>0.1</b>."
|
||||
},
|
||||
"minPower": {
|
||||
"title": "Мин. мощность котла <small>(кВт)</small>",
|
||||
"note": "Это значение соответствует уровню модуляции котла 0–1%. Обычно можно найти в спецификации котла как \"минимальная полезная тепловая мощность\"."
|
||||
},
|
||||
"maxPower": {
|
||||
"title": "Макс. мощность котла <small>(кВт)</small>",
|
||||
"note": "<b>0</b> - попробовать определить автоматически. Обычно можно найти в спецификации котла как \"максимальная полезная тепловая мощность\"."
|
||||
},
|
||||
"fnv": {
|
||||
"title": "Фильтрация числовых значений",
|
||||
"enable": {
|
||||
|
||||
@@ -159,12 +159,8 @@
|
||||
<td><b id="ot-dhw-flow-rate"></b> <span class="volume-unit"></span>/min</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" data-i18n>dashboard.state.maxPower</th>
|
||||
<td><b id="ot-max-power"></b> <span data-i18n>kw</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" data-i18n>dashboard.state.currentPower</th>
|
||||
<td><b id="ot-current-power"></b> <span data-i18n>kw</span></td>
|
||||
<th scope="row" data-i18n>dashboard.state.power</th>
|
||||
<td><b id="ot-power"></b> <span data-i18n>kw</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" data-i18n>dashboard.state.faultCode</th>
|
||||
@@ -442,8 +438,7 @@
|
||||
setValue('#ot-modulation', result.sensors.modulation);
|
||||
setValue('#ot-pressure', result.sensors.pressure);
|
||||
setValue('#ot-dhw-flow-rate', result.sensors.dhwFlowRate);
|
||||
setValue('#ot-max-power', result.sensors.maxPower);
|
||||
setValue('#ot-current-power', result.sensors.currentPower);
|
||||
setValue('#ot-power', result.sensors.power);
|
||||
setValue(
|
||||
'#ot-fault-code',
|
||||
result.sensors.faultCode
|
||||
|
||||
@@ -94,11 +94,6 @@
|
||||
<fieldset>
|
||||
<legend data-i18n>settings.section.diag</legend>
|
||||
|
||||
<label for="system-debug">
|
||||
<input type="checkbox" id="system-debug" name="system[debug]" value="true">
|
||||
<span data-i18n>settings.system.debug</span>
|
||||
</label>
|
||||
|
||||
<label for="system-serial-enable">
|
||||
<input type="checkbox" id="system-serial-enable" name="system[serial][enable]" value="true">
|
||||
<span data-i18n>settings.system.serial.enable</span>
|
||||
@@ -109,11 +104,31 @@
|
||||
<span data-i18n>settings.system.telnet.enable</span>
|
||||
</label>
|
||||
|
||||
<label for="system-log-level">
|
||||
<span data-i18n>settings.system.logLevel</span>
|
||||
<select id="system-log-level" name="system[logLevel]">
|
||||
<option value="0">SILENT</option>
|
||||
<option value="1">FATAL</option>
|
||||
<option value="2">ERROR</option>
|
||||
<option value="3">WARNING</option>
|
||||
<option value="4">INFO</option>
|
||||
<option value="5">NOTICE</option>
|
||||
<option value="6">TRACE</option>
|
||||
<option value="7">VERBOSE</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<div class="grid">
|
||||
<label for="system-serial-baudrate">
|
||||
<span data-i18n>settings.system.serial.baud.title</span>
|
||||
<input type="number" inputmode="numeric" id="system-serial-baudrate" name="system[serial][baudrate]" min="9600" max="115200" step="1" required>
|
||||
<small data-i18n>settings.system.serial.baud.note</small>
|
||||
<span data-i18n>settings.system.serial.baud</span>
|
||||
<select id="system-serial-baudrate" name="system[serial][baudrate]" required>
|
||||
<option value="9600">9600</option>
|
||||
<option value="19200">19200</option>
|
||||
<option value="38400">38400</option>
|
||||
<option value="57600">57600</option>
|
||||
<option value="74880">74880</option>
|
||||
<option value="115200">115200</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label for="system-telnet-port">
|
||||
@@ -151,17 +166,10 @@
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="grid">
|
||||
<label for="heating-hysteresis">
|
||||
<span data-i18n>settings.heating.hyst</span>
|
||||
<input type="number" inputmode="numeric" id="heating-hysteresis" name="heating[hysteresis]" min="0" max="5" step="0.05" required>
|
||||
</label>
|
||||
|
||||
<label for="heating-max-modulation">
|
||||
<span data-i18n>settings.heating.maxMod</span>
|
||||
<input type="number" inputmode="numeric" id="heating-max-modulation" name="heating[maxModulation]" min="1" max="100" step="1" required>
|
||||
</label>
|
||||
</div>
|
||||
<label for="heating-hysteresis">
|
||||
<span data-i18n>settings.heating.hyst</span>
|
||||
<input type="number" inputmode="numeric" id="heating-hysteresis" name="heating[hysteresis]" min="0" max="5" step="0.05" required>
|
||||
</label>
|
||||
|
||||
<button type="submit" data-i18n>button.save</button>
|
||||
</form>
|
||||
@@ -386,32 +394,37 @@
|
||||
<span data-i18n>settings.ot.outGpio</span>
|
||||
<input type="number" inputmode="numeric" id="opentherm-out-gpio" name="opentherm[outGpio]" min="0" max="254" step="1">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="grid">
|
||||
<label for="opentherm-rx-led-gpio">
|
||||
<span data-i18n>settings.ot.ledGpio</span>
|
||||
<input type="number" inputmode="numeric" id="opentherm-rx-led-gpio" name="opentherm[rxLedGpio]" min="0" max="254" step="1">
|
||||
<small data-i18n>settings.note.blankNotUse</small>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="grid">
|
||||
<label for="opentherm-member-id-code">
|
||||
<span data-i18n>settings.ot.memberIdCode</span>
|
||||
<input type="number" inputmode="numeric" id="opentherm-member-id-code" name="opentherm[memberIdCode]" min="0" max="65535" step="1" required>
|
||||
</label>
|
||||
|
||||
<label for="opentherm-max-modulation">
|
||||
<span data-i18n>settings.ot.maxMod</span>
|
||||
<input type="number" inputmode="numeric" id="opentherm-max-modulation" name="opentherm[maxModulation]" min="1" max="100" step="1" required>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="grid">
|
||||
<label for="opentherm-pressure-factor">
|
||||
<span data-i18n>settings.ot.pressureFactor.title</span>
|
||||
<input type="number" inputmode="numeric" id="opentherm-pressure-factor" name="opentherm[pressureFactor]" min="0.1" max="100" step="0.01">
|
||||
<small data-i18n>settings.ot.pressureFactor.note</small>
|
||||
<label for="opentherm-min-power">
|
||||
<span data-i18n>settings.ot.minPower.title</span>
|
||||
<input type="number" inputmode="numeric" id="opentherm-min-power" name="opentherm[minPower]" min="0" max="1000" step="0.1">
|
||||
<small data-i18n>settings.ot.minPower.note</small>
|
||||
</label>
|
||||
|
||||
<label for="opentherm-dhw-fr-factor">
|
||||
<span data-i18n>settings.ot.dhwFlowRateFactor.title</span>
|
||||
<input type="number" inputmode="numeric" id="opentherm-dhw-fr-factor" name="opentherm[dhwFlowRateFactor]" min="0.1" max="100" step="0.01">
|
||||
<small data-i18n>settings.ot.dhwFlowRateFactor.note</small>
|
||||
<label for="opentherm-max-power">
|
||||
<span data-i18n>settings.ot.maxPower.title</span>
|
||||
<input type="number" inputmode="numeric" id="opentherm-max-power" name="opentherm[maxPower]" min="0" max="1000" step="0.1">
|
||||
<small data-i18n>settings.ot.maxPower.note</small>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@@ -462,40 +475,6 @@
|
||||
<span data-i18n>settings.ot.options.immergasFix</span>
|
||||
</label>
|
||||
|
||||
<hr />
|
||||
<fieldset>
|
||||
<legend>
|
||||
<span data-i18n>settings.ot.fnv.title</span>
|
||||
</legend>
|
||||
|
||||
<label for="opentherm-fnv-enable">
|
||||
<input type="checkbox" id="opentherm-fnv-enable" name="opentherm[filterNumValues][enable]" value="true">
|
||||
<span data-i18n>settings.ot.fnv.enable.title</span>
|
||||
<br>
|
||||
<small data-i18n>settings.ot.fnv.enable.note</small>
|
||||
</label>
|
||||
|
||||
<label for="opentherm-fnv-factor">
|
||||
<span data-i18n>settings.ot.fnv.factor.title</span>
|
||||
<input type="number" inputmode="numeric" id="opentherm-fnv-factor" name="opentherm[filterNumValues][factor]" min="0.01" max="1" step="0.01">
|
||||
<small data-i18n>settings.ot.fnv.factor.note</small>
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
<hr />
|
||||
<fieldset>
|
||||
<label for="opentherm-fault-state-gpio">
|
||||
<span data-i18n>settings.ot.faultState.gpio</span>
|
||||
<input type="number" inputmode="numeric" id="opentherm-fault-state-gpio" name="opentherm[faultStateGpio]" min="0" max="254" step="1">
|
||||
<small data-i18n>settings.ot.faultState.note</small>
|
||||
</label>
|
||||
|
||||
<label for="opentherm-invert-fault-state">
|
||||
<input type="checkbox" id="opentherm-invert-fault-state" name="opentherm[invertFaultState]" value="true">
|
||||
<span data-i18n>settings.ot.faultState.invert</span>
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
<hr />
|
||||
<label for="opentherm-native-heating-control">
|
||||
<input type="checkbox" id="opentherm-native-heating-control" name="opentherm[nativeHeatingControl]" value="true">
|
||||
@@ -503,6 +482,60 @@
|
||||
<small data-i18n>settings.ot.nativeHeating.note</small>
|
||||
</label>
|
||||
</fieldset>
|
||||
<hr />
|
||||
|
||||
<details>
|
||||
<summary role="button" class="secondary" data-i18n>settings.ot.advanced</summary>
|
||||
<div>
|
||||
<div class="grid">
|
||||
<label for="opentherm-pressure-factor">
|
||||
<span data-i18n>settings.ot.pressureFactor.title</span>
|
||||
<input type="number" inputmode="numeric" id="opentherm-pressure-factor" name="opentherm[pressureFactor]" min="0.1" max="100" step="0.01">
|
||||
<small data-i18n>settings.ot.pressureFactor.note</small>
|
||||
</label>
|
||||
|
||||
<label for="opentherm-dhw-fr-factor">
|
||||
<span data-i18n>settings.ot.dhwFlowRateFactor.title</span>
|
||||
<input type="number" inputmode="numeric" id="opentherm-dhw-fr-factor" name="opentherm[dhwFlowRateFactor]" min="0.1" max="100" step="0.01">
|
||||
<small data-i18n>settings.ot.dhwFlowRateFactor.note</small>
|
||||
</label>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<fieldset>
|
||||
<legend>
|
||||
<span data-i18n>settings.ot.fnv.title</span>
|
||||
</legend>
|
||||
|
||||
<label for="opentherm-fnv-enable">
|
||||
<input type="checkbox" id="opentherm-fnv-enable" name="opentherm[filterNumValues][enable]" value="true">
|
||||
<span data-i18n>settings.ot.fnv.enable.title</span>
|
||||
<br>
|
||||
<small data-i18n>settings.ot.fnv.enable.note</small>
|
||||
</label>
|
||||
|
||||
<label for="opentherm-fnv-factor">
|
||||
<span data-i18n>settings.ot.fnv.factor.title</span>
|
||||
<input type="number" inputmode="numeric" id="opentherm-fnv-factor" name="opentherm[filterNumValues][factor]" min="0.01" max="1" step="0.01">
|
||||
<small data-i18n>settings.ot.fnv.factor.note</small>
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
<hr />
|
||||
<fieldset>
|
||||
<label for="opentherm-fault-state-gpio">
|
||||
<span data-i18n>settings.ot.faultState.gpio</span>
|
||||
<input type="number" inputmode="numeric" id="opentherm-fault-state-gpio" name="opentherm[faultStateGpio]" min="0" max="254" step="1">
|
||||
<small data-i18n>settings.ot.faultState.note</small>
|
||||
</label>
|
||||
|
||||
<label for="opentherm-invert-fault-state">
|
||||
<input type="checkbox" id="opentherm-invert-fault-state" name="opentherm[invertFaultState]" value="true">
|
||||
<span data-i18n>settings.ot.faultState.invert</span>
|
||||
</label>
|
||||
</fieldset>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<button type="submit" data-i18n>button.save</button>
|
||||
</form>
|
||||
@@ -743,9 +776,9 @@
|
||||
|
||||
const fillData = (data) => {
|
||||
// System
|
||||
setCheckboxValue('#system-debug', data.system.debug);
|
||||
setSelectValue('#system-log-level', data.system.logLevel);
|
||||
setCheckboxValue('#system-serial-enable', data.system.serial.enable);
|
||||
setInputValue('#system-serial-baudrate', data.system.serial.baudrate);
|
||||
setSelectValue('#system-serial-baudrate', data.system.serial.baudrate);
|
||||
setCheckboxValue('#system-telnet-enable', data.system.telnet.enable);
|
||||
setInputValue('#system-telnet-port', data.system.telnet.port);
|
||||
setRadioValue('.system-unit-system', data.system.unitSystem);
|
||||
@@ -766,8 +799,11 @@
|
||||
setInputValue('#opentherm-fault-state-gpio', data.opentherm.faultStateGpio < 255 ? data.opentherm.faultStateGpio : '');
|
||||
setCheckboxValue('#opentherm-invert-fault-state', data.opentherm.invertFaultState);
|
||||
setInputValue('#opentherm-member-id-code', data.opentherm.memberIdCode);
|
||||
setInputValue('#opentherm-max-modulation', data.opentherm.maxModulation);
|
||||
setInputValue('#opentherm-pressure-factor', data.opentherm.pressureFactor);
|
||||
setInputValue('#opentherm-dhw-fr-factor', data.opentherm.dhwFlowRateFactor);
|
||||
setInputValue('#opentherm-min-power', data.opentherm.minPower);
|
||||
setInputValue('#opentherm-max-power', data.opentherm.maxPower);
|
||||
setCheckboxValue('#opentherm-dhw-present', data.opentherm.dhwPresent);
|
||||
setCheckboxValue('#opentherm-sw-mode', data.opentherm.summerWinterMode);
|
||||
setCheckboxValue('#opentherm-heating-ch2-enabled', data.opentherm.heatingCh2Enabled);
|
||||
@@ -825,7 +861,6 @@
|
||||
"max": data.system.unitSystem == 0 ? 100 : 212
|
||||
});
|
||||
setInputValue('#heating-hysteresis', data.heating.hysteresis);
|
||||
setInputValue('#heating-max-modulation', data.heating.maxModulation);
|
||||
setBusy('#heating-settings-busy', '#heating-settings', false);
|
||||
|
||||
// DHW
|
||||
|
||||
@@ -539,6 +539,17 @@ function setInputValue(selector, value, attrs = {}) {
|
||||
}
|
||||
}
|
||||
|
||||
function setSelectValue(selector, value) {
|
||||
let item = document.querySelector(selector);
|
||||
if (!item) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let option of item.options) {
|
||||
option.selected = option.value == value;
|
||||
}
|
||||
}
|
||||
|
||||
function show(selector) {
|
||||
let items = document.querySelectorAll(selector);
|
||||
if (!items.length) {
|
||||
|
||||
Reference in New Issue
Block a user