From 347723cbbaa2a8ed7c1c132acf68623e1f162333 Mon Sep 17 00:00:00 2001 From: Yurii Date: Fri, 22 Dec 2023 19:15:00 +0300 Subject: [PATCH] fix: rename entities #26 * Current heating min temp => Boiler heating min temp * Current heating max temp => Boiler heating max temp * Current DHW min temp => Boiler DHW min temp * Current DHW max temp => Boiler DHW max temp --- src/HaHelper.h | 48 ++++++++++++++++++++++++------------------------ src/MqttTask.h | 12 ++++++------ 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/HaHelper.h b/src/HaHelper.h index 9f1b608..ac35da9 100644 --- a/src/HaHelper.h +++ b/src/HaHelper.h @@ -336,44 +336,44 @@ public: return this->publish(this->getTopic("sensor", "heating_setpoint").c_str(), doc); } - bool publishSensorCurrentHeatingMinTemp(bool enabledByDefault = true) { + bool publishSensorBoilerHeatingMinTemp(bool enabledByDefault = true) { JsonDocument doc; doc[FPSTR(HA_AVAILABILITY)][FPSTR(HA_TOPIC)] = this->getDeviceTopic("status"); doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; - doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectId("current_heating_min_temp"); - doc[FPSTR(HA_OBJECT_ID)] = this->getObjectId("current_heating_min_temp"); + doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectId("boiler_heating_min_temp"); + doc[FPSTR(HA_OBJECT_ID)] = this->getObjectId("boiler_heating_min_temp"); doc[FPSTR(HA_ENTITY_CATEGORY)] = F("diagnostic"); doc[FPSTR(HA_DEVICE_CLASS)] = F("temperature"); doc[FPSTR(HA_STATE_CLASS)] = F("measurement"); doc[FPSTR(HA_UNIT_OF_MEASUREMENT)] = F("°C"); - doc[FPSTR(HA_NAME)] = F("Current heating min temp"); + doc[FPSTR(HA_NAME)] = F("Boiler heating min temp"); doc[FPSTR(HA_ICON)] = F("mdi:thermometer-chevron-down"); doc[FPSTR(HA_STATE_TOPIC)] = this->getDeviceTopic("state"); doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.parameters.heatingMinTemp|int(0) }}"); doc[FPSTR(HA_EXPIRE_AFTER)] = 120; doc.shrinkToFit(); - return this->publish(this->getTopic("sensor", "current_heating_min_temp").c_str(), doc); + return this->publish(this->getTopic("sensor", "boiler_heating_min_temp").c_str(), doc); } - bool publishSensorCurrentHeatingMaxTemp(bool enabledByDefault = true) { + bool publishSensorBoilerHeatingMaxTemp(bool enabledByDefault = true) { JsonDocument doc; doc[FPSTR(HA_AVAILABILITY)][FPSTR(HA_TOPIC)] = this->getDeviceTopic("status"); doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; - doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectId("current_heating_max_temp"); - doc[FPSTR(HA_OBJECT_ID)] = this->getObjectId("current_heating_max_temp"); + doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectId("boiler_heating_max_temp"); + doc[FPSTR(HA_OBJECT_ID)] = this->getObjectId("boiler_heating_max_temp"); doc[FPSTR(HA_ENTITY_CATEGORY)] = F("diagnostic"); doc[FPSTR(HA_DEVICE_CLASS)] = F("temperature"); doc[FPSTR(HA_STATE_CLASS)] = F("measurement"); doc[FPSTR(HA_UNIT_OF_MEASUREMENT)] = F("°C"); - doc[FPSTR(HA_NAME)] = F("Current heating max temp"); + doc[FPSTR(HA_NAME)] = F("Boiler heating max temp"); doc[FPSTR(HA_ICON)] = F("mdi:thermometer-chevron-up"); doc[FPSTR(HA_STATE_TOPIC)] = this->getDeviceTopic("state"); doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.parameters.heatingMaxTemp|int(0) }}"); doc[FPSTR(HA_EXPIRE_AFTER)] = 120; doc.shrinkToFit(); - return this->publish(this->getTopic("sensor", "current_heating_max_temp").c_str(), doc); + return this->publish(this->getTopic("sensor", "boiler_heating_max_temp").c_str(), doc); } bool publishNumberHeatingMinTemp(bool enabledByDefault = true) { @@ -496,44 +496,44 @@ public: return this->publish(this->getTopic("number", "dhw_target").c_str(), doc); } - bool publishSensorCurrentDhwMinTemp(bool enabledByDefault = true) { + bool publishSensorBoilerDhwMinTemp(bool enabledByDefault = true) { JsonDocument doc; doc[FPSTR(HA_AVAILABILITY)][FPSTR(HA_TOPIC)] = this->getDeviceTopic("status"); doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; - doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectId("current_dhw_min_temp"); - doc[FPSTR(HA_OBJECT_ID)] = this->getObjectId("current_dhw_min_temp"); + doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectId("boiler_dhw_min_temp"); + doc[FPSTR(HA_OBJECT_ID)] = this->getObjectId("boiler_dhw_min_temp"); doc[FPSTR(HA_ENTITY_CATEGORY)] = F("diagnostic"); doc[FPSTR(HA_DEVICE_CLASS)] = F("temperature"); doc[FPSTR(HA_STATE_CLASS)] = F("measurement"); doc[FPSTR(HA_UNIT_OF_MEASUREMENT)] = F("°C"); - doc[FPSTR(HA_NAME)] = F("Current DHW min temp"); + doc[FPSTR(HA_NAME)] = F("Boiler DHW min temp"); doc[FPSTR(HA_ICON)] = F("mdi:thermometer-chevron-down"); doc[FPSTR(HA_STATE_TOPIC)] = this->getDeviceTopic("state"); doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.parameters.dhwMinTemp|int(0) }}"); doc[FPSTR(HA_EXPIRE_AFTER)] = 120; doc.shrinkToFit(); - return this->publish(this->getTopic("sensor", "current_dhw_min_temp").c_str(), doc); + return this->publish(this->getTopic("sensor", "boiler_dhw_min_temp").c_str(), doc); } - bool publishSensorCurrentDhwMaxTemp(bool enabledByDefault = true) { + bool publishSensorBoilerDhwMaxTemp(bool enabledByDefault = true) { JsonDocument doc; doc[FPSTR(HA_AVAILABILITY)][FPSTR(HA_TOPIC)] = this->getDeviceTopic("status"); doc[FPSTR(HA_ENABLED_BY_DEFAULT)] = enabledByDefault; - doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectId("current_dhw_max_temp"); - doc[FPSTR(HA_OBJECT_ID)] = this->getObjectId("current_dhw_max_temp"); + doc[FPSTR(HA_UNIQUE_ID)] = this->getObjectId("boiler_dhw_max_temp"); + doc[FPSTR(HA_OBJECT_ID)] = this->getObjectId("boiler_dhw_max_temp"); doc[FPSTR(HA_ENTITY_CATEGORY)] = F("diagnostic"); doc[FPSTR(HA_DEVICE_CLASS)] = F("temperature"); doc[FPSTR(HA_STATE_CLASS)] = F("measurement"); doc[FPSTR(HA_UNIT_OF_MEASUREMENT)] = F("°C"); - doc[FPSTR(HA_NAME)] = F("Current DHW max temp"); + doc[FPSTR(HA_NAME)] = F("Boiler DHW max temp"); doc[FPSTR(HA_ICON)] = F("mdi:thermometer-chevron-up"); doc[FPSTR(HA_STATE_TOPIC)] = this->getDeviceTopic("state"); doc[FPSTR(HA_VALUE_TEMPLATE)] = F("{{ value_json.parameters.dhwMaxTemp|int(0) }}"); doc[FPSTR(HA_EXPIRE_AFTER)] = 120; doc.shrinkToFit(); - return this->publish(this->getTopic("sensor", "current_dhw_max_temp").c_str(), doc); + return this->publish(this->getTopic("sensor", "boiler_dhw_max_temp").c_str(), doc); } bool publishNumberDhwMinTemp(bool enabledByDefault = true) { @@ -1407,12 +1407,12 @@ public: return this->publish(this->getTopic("switch", "dhw").c_str()); } - bool deleteSensorCurrentDhwMinTemp() { - return this->publish(this->getTopic("sensor", "current_dhw_min_temp").c_str()); + bool deleteSensorBoilerDhwMinTemp() { + return this->publish(this->getTopic("sensor", "boiler_dhw_min_temp").c_str()); } - bool deleteSensorCurrentDhwMaxTemp() { - return this->publish(this->getTopic("sensor", "current_dhw_max_temp").c_str()); + bool deleteSensorBoilerDhwMaxTemp() { + return this->publish(this->getTopic("sensor", "boiler_dhw_max_temp").c_str()); } bool deleteNumberDhwMinTemp() { diff --git a/src/MqttTask.h b/src/MqttTask.h index cdde64c..adc3fab 100644 --- a/src/MqttTask.h +++ b/src/MqttTask.h @@ -604,8 +604,8 @@ protected: this->haHelper->publishSwitchHeatingTurbo(); this->haHelper->publishNumberHeatingHysteresis(); this->haHelper->publishSensorHeatingSetpoint(false); - this->haHelper->publishSensorCurrentHeatingMinTemp(false); - this->haHelper->publishSensorCurrentHeatingMaxTemp(false); + this->haHelper->publishSensorBoilerHeatingMinTemp(false); + this->haHelper->publishSensorBoilerHeatingMaxTemp(false); this->haHelper->publishNumberHeatingMinTemp(false); this->haHelper->publishNumberHeatingMaxTemp(false); this->haHelper->publishNumberHeatingMaxModulation(false); @@ -670,8 +670,8 @@ protected: if (_dhwPresent) { this->haHelper->publishSwitchDhw(false); - this->haHelper->publishSensorCurrentDhwMinTemp(false); - this->haHelper->publishSensorCurrentDhwMaxTemp(false); + this->haHelper->publishSensorBoilerDhwMinTemp(false); + this->haHelper->publishSensorBoilerDhwMaxTemp(false); this->haHelper->publishNumberDhwMinTemp(false); this->haHelper->publishNumberDhwMaxTemp(false); this->haHelper->publishBinSensorDhw(); @@ -680,8 +680,8 @@ protected: } else { this->haHelper->deleteSwitchDhw(); - this->haHelper->deleteSensorCurrentDhwMinTemp(); - this->haHelper->deleteSensorCurrentDhwMaxTemp(); + this->haHelper->deleteSensorBoilerDhwMinTemp(); + this->haHelper->deleteSensorBoilerDhwMaxTemp(); this->haHelper->deleteNumberDhwMinTemp(); this->haHelper->deleteNumberDhwMaxTemp(); this->haHelper->deleteBinSensorDhw();