feat: expose smart heating control across device interfaces

Rename indoor_temp_control to smart_control across firmware, REST,
the dashboard and Home Assistant.

Publish state/master/heating/smart_control over MQTT and remove the
redundant state/master/mqtt/connected topic.
This commit is contained in:
Yurii committed 2026-11-23 07:35:37 +03:00
1 parent 9ff1bd14f5
commit 7e1d0ddff2
7 files changed
+16 -16

No files matched your search

+1 -1
View File
@@ -249,7 +249,7 @@ struct Variables {
struct {
bool blocking = false;
bool enabled = false;
bool indoorTempControl = false;
bool smartControl = false;
bool overheat = false;
bool freezing = false;
float setpointTemp = 0.0f;
+1 -1
View File
@@ -110,7 +110,6 @@ inline const char S_IMMERGAS_FIX[] = "immergas_fix";
inline const char S_ALWAYS_SEND_INDOOR_TEMP[] = "always_send_indoor_temp";
inline const char S_INDOOR_TEMP[] = "indoor_temp";
inline const char S_INDOOR_TEMP_AVG_TYPE[] = "indoor_temp_avg_type";
inline const char S_INDOOR_TEMP_CONTROL[] = "indoor_temp_control";
inline const char S_IN_GPIO[] = "in_gpio";
inline const char S_INPUT[] = "input";
inline const char S_INTERVAL[] = "interval";
@@ -187,6 +186,7 @@ inline const char S_SIGNAL_QUALITY[] = "signal_quality";
inline const char S_SIZE[] = "size";
inline const char S_SLAVE[] = "slave";
inline const char S_SLOPE[] = "slope";
inline const char S_SMART_CONTROL[] = "smart_control";
inline const char S_SSID[] = "ssid";
inline const char S_STA[] = "sta";
inline const char S_STATE[] = "state";
+5 -5
View File
@@ -1336,11 +1336,11 @@ static bool normalizeHeatingFreezeBounds(HeatingSettings& dst) {
static SettingResult setHeatingTarget(HeatingSettings& dst, float value) {
bool changed = false;
bool indoorTempControl = settings.equitherm.enabled || settings.pid.enabled || settings.opentherm.options.nativeOTC;
float minTemp = indoorTempControl
bool smartControl = settings.equitherm.enabled || settings.pid.enabled || settings.opentherm.options.nativeOTC;
float minTemp = smartControl
? THERMOSTAT_INDOOR_MIN_TEMP
: dst.minTemp;
float maxTemp = indoorTempControl
float maxTemp = smartControl
? THERMOSTAT_INDOOR_MAX_TEMP
: dst.maxTemp;
@@ -1353,7 +1353,7 @@ static SettingResult setHeatingTarget(HeatingSettings& dst, float value) {
);
if (!valid) {
value = indoorTempControl ? THERMOSTAT_INDOOR_DEFAULT_TEMP : DEFAULT_HEATING_TARGET_TEMP;
value = smartControl ? THERMOSTAT_INDOOR_DEFAULT_TEMP : DEFAULT_HEATING_TARGET_TEMP;
}
value = constrain(value, minTemp, maxTemp);
@@ -3405,7 +3405,7 @@ JsonVariant toJson(const Variables& src, JsonVariant dst) {
auto mHeating = master[S_HEATING].to<JsonObject>();
mHeating[S_ENABLED] = src.master.heating.enabled;
mHeating[S_BLOCKING] = src.master.heating.blocking;
mHeating[S_INDOOR_TEMP_CONTROL] = src.master.heating.indoorTempControl;
mHeating[S_SMART_CONTROL] = src.master.heating.smartControl;
mHeating[S_OVERHEAT] = src.master.heating.overheat;
mHeating[S_FREEZING] = src.master.heating.freezing;
mHeating[S_SETPOINT_TEMP] = roundf((src.master.heating.setpointTemp == 0 ? 0 : convertTemp(src.master.heating.setpointTemp, UnitSystem::METRIC, settings.system.unitSystem)), 2);
+1 -1
View File
@@ -608,7 +608,7 @@ void publishHaEntity(HaEntity entityId, bool remove) {
if (!remove) {
climate->icon = "mdi:radiator";
climate->enabledByDefault = true;
climate->currentTemperatureTopic = vars.master.heating.indoorTempControl
climate->currentTemperatureTopic = vars.master.heating.smartControl
? "~/state/master/heating/indoor_temp"
: "~/state/master/heating/current_temp";
climate->temperatureCommandTopic = "~/settings/heating/target/set";
+4 -4
View File
@@ -247,6 +247,7 @@ static void publishSlaveState() {
static void publishMasterState() {
publishValue(mqttTopic("state/master/heating/enabled"), vars.master.heating.enabled);
publishValue(mqttTopic("state/master/heating/blocking"), vars.master.heating.blocking);
publishValue(mqttTopic("state/master/heating/smart_control"), vars.master.heating.smartControl);
publishValue(mqttTopic("state/master/heating/overheat"), vars.master.heating.overheat);
publishValue(mqttTopic("state/master/heating/freezing"), vars.master.heating.freezing);
publishValue(
@@ -284,7 +285,6 @@ static void publishMasterState() {
publishValue(mqttTopic("state/master/dhw/max_temp"), convertTemp(settings.dhw.maxTemp, UnitSystem::METRIC, settings.system.unitSystem), 2);
publishValue(mqttTopic("state/master/network/connected"), isNetworkConnected());
publishValue(mqttTopic("state/master/network/rssi"), std::to_string(vars.network.rssi));
publishValue(mqttTopic("state/master/mqtt/connected"), isMqttConnected());
publishValue(mqttTopic("state/master/emergency/state"), vars.emergency.state);
publishValue(mqttTopic("state/master/ext_pump/state"), vars.externalPump.state);
publishValue(mqttTopic("state/master/cascade_control/input"), vars.cascadeControl.input);
@@ -762,7 +762,7 @@ Task mqttConfigureTask("Configure MQTT", Task::Type::ONCE, [](void*) {
static uint8_t heatingMinTemp = vars.slave.heating.minTemp;
static uint8_t heatingMaxTemp = vars.slave.heating.maxTemp;
static bool dhwSupport = settings.opentherm.options.dhwSupport;
static bool indoorTempControl = vars.master.heating.indoorTempControl;
static bool smartControl = vars.master.heating.smartControl;
static float heatingMinSetpointTemp = vars.master.heating.minTemp;
static float heatingMaxSetpointTemp = vars.master.heating.maxTemp;
static uint8_t dhwMinTemp = settings.dhw.minTemp;
@@ -827,8 +827,8 @@ Task mqttConfigureTask("Configure MQTT", Task::Type::ONCE, [](void*) {
.set(HA_ENTITY_DHW_OVERHEAT);
}
if (indoorTempControl != vars.master.heating.indoorTempControl) {
indoorTempControl = vars.master.heating.indoorTempControl;
if (smartControl != vars.master.heating.smartControl) {
smartControl = vars.master.heating.smartControl;
mqttHaPendingEntities.set(HA_ENTITY_HEATING_CLIMATE);
}
+2 -2
View File
@@ -188,12 +188,12 @@ static Task regulatorTask("Regulator", [](void*) {
}
if (settings.equitherm.enabled || settings.pid.enabled || settings.opentherm.options.nativeOTC) {
vars.master.heating.indoorTempControl = true;
vars.master.heating.smartControl = true;
vars.master.heating.minTemp = THERMOSTAT_INDOOR_MIN_TEMP;
vars.master.heating.maxTemp = THERMOSTAT_INDOOR_MAX_TEMP;
} else {
vars.master.heating.indoorTempControl = false;
vars.master.heating.smartControl = false;
vars.master.heating.minTemp = settings.heating.minTemp;
vars.master.heating.maxTemp = settings.heating.maxTemp;
}
+2 -2
View File
@@ -598,7 +598,7 @@
const result = await response.json();
// Graph
setValue('#tHeatCurrentTemp', result.master.heating.indoor_temp_control
setValue('#tHeatCurrentTemp', result.master.heating.smart_control
? result.master.heating.indoor_temp
: result.master.heating.current_temp
);
@@ -683,7 +683,7 @@
result.master.heating.blocking ? "success" : "error",
result.master.heating.blocking ? "red" : "green"
);
setState('.mHeatIndoorTempControl', result.master.heating.indoor_temp_control);
setState('.mHeatSmartControl', result.master.heating.smart_control);
setStatus(
'.mHeatOverheat',
result.master.heating.overheat ? "success" : "error",