diff --git a/components/truma_inetbox/climate/TrumaWaterClimate.cpp b/components/truma_inetbox/climate/TrumaWaterClimate.cpp index c8dd218..06cbffc 100644 --- a/components/truma_inetbox/climate/TrumaWaterClimate.cpp +++ b/components/truma_inetbox/climate/TrumaWaterClimate.cpp @@ -5,10 +5,11 @@ namespace esphome { namespace truma_inetbox { static const char *const TAG = "truma_inetbox.water_climate"; + void TrumaWaterClimate::setup() { this->parent_->get_heater()->add_on_message_callback([this](const StatusFrameHeater *status_heater) { // Publish updated state - this->target_temperature = temp_code_to_decimal(status_heater->target_temp_water); + this->target_temperature = water_temp_200_fix(temp_code_to_decimal(status_heater->target_temp_water)); this->current_temperature = temp_code_to_decimal(status_heater->current_temp_water); this->mode = (status_heater->target_temp_water == TargetTemp::TARGET_TEMP_OFF) ? climate::CLIMATE_MODE_OFF : climate::CLIMATE_MODE_HEAT; diff --git a/components/truma_inetbox/helpers.cpp b/components/truma_inetbox/helpers.cpp index 83b2420..d49abda 100644 --- a/components/truma_inetbox/helpers.cpp +++ b/components/truma_inetbox/helpers.cpp @@ -27,6 +27,13 @@ float temp_code_to_decimal(u_int16_t val, float zero) { return ((float) val) / 10.0f - 273.0f; } +float water_temp_200_fix(float val) { + if (val == 200) { + return 80; + } + return val; +} + float temp_code_to_decimal(TargetTemp val, float zero) { return temp_code_to_decimal((u_int16_t) val, zero); } TargetTemp decimal_to_temp(u_int8_t val) { return (TargetTemp) ((((u_int16_t) val) + 273) * 10); } diff --git a/components/truma_inetbox/helpers.h b/components/truma_inetbox/helpers.h index fad927c..12b6027 100644 --- a/components/truma_inetbox/helpers.h +++ b/components/truma_inetbox/helpers.h @@ -16,6 +16,7 @@ u_int8_t addr_parity(const u_int8_t pid); u_int8_t data_checksum(const u_int8_t *message, u_int8_t length, uint16_t sum); float temp_code_to_decimal(u_int16_t val, float zero = NAN); float temp_code_to_decimal(TargetTemp val, float zero = NAN); +float water_temp_200_fix(float val); TargetTemp decimal_to_temp(u_int8_t val); TargetTemp decimal_to_temp(float val); TargetTemp decimal_to_room_temp(u_int8_t val);