From 2c0c5ba425445cf716d57c38cc7e731f9aac3f67 Mon Sep 17 00:00:00 2001 From: tp1de Date: Sat, 21 May 2022 13:57:31 +0200 Subject: [PATCH] emergencyops and emergencytemp for RC310 --- src/devices/boiler.cpp | 38 ++++++++++++++++++++++++++++++++++++++ src/devices/boiler.h | 4 ++++ src/locale_EN.h | 2 ++ 3 files changed, 44 insertions(+) diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index 890ba7beb..e39a3cc45 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -206,6 +206,21 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const FL_(maintenanceDate), DeviceValueUOM::NONE, MAKE_CF_CB(set_maintenancedate)); + register_device_value(DeviceValueTAG::TAG_BOILER_DATA, + &emergencyOps_, + DeviceValueType::BOOL, + nullptr, FL_(emergencyOps), + DeviceValueUOM::NONE, + MAKE_CF_CB(set_emergency_ops)); + register_device_value(DeviceValueTAG::TAG_BOILER_DATA, + &emergencyTemp_, + DeviceValueType::UINT, + nullptr, + FL_(emergencyTemp), + DeviceValueUOM::DEGREES, + MAKE_CF_CB(set_emergency_temp), + 40, + 70); /* * Hybrid heatpump with telegram 0xBB is readable and writeable in boiler and thermostat @@ -784,6 +799,9 @@ void Boiler::process_UBAParametersPlus(std::shared_ptr telegram) has_update(telegram, boilHystOff_, 8); has_update(telegram, boilHystOn_, 9); has_update(telegram, burnMinPeriod_, 10); + has_update(telegram, emergencyOps_, 18); + has_update(telegram, emergencyTemp_, 19); + // has_update(telegram, pumpType_, 11); // guess, RC300 manual: power controlled, pressure controlled 1-4? // has_update(telegram, pumpDelay_, 12); // guess // has_update(telegram, pumpModMax_, 13); // guess @@ -1854,4 +1872,24 @@ bool Boiler::set_pool_temp(const char * value, const int8_t id) { return true; } +bool Boiler::set_emergency_temp(const char * value, const int8_t id) { + int v = 0; + if (!Helpers::value2temperature(value, v)) { + return false; + } + + write_command(EMS_TYPE_UBAParametersPlus, 19, v, EMS_TYPE_UBAParametersPlus); + + return true; +} + +bool Boiler::set_emergency_ops(const char * value, const int8_t id) { + bool v = false; + if (!Helpers::value2bool(value, v)) { + return false; + } + write_command(EMS_TYPE_UBAParametersPlus, 18, v ? 0x01 : 0x00, EMS_TYPE_UBAParametersPlus); + return true; +} + } // namespace emsesp diff --git a/src/devices/boiler.h b/src/devices/boiler.h index b36ad2694..9d8bd85b0 100644 --- a/src/devices/boiler.h +++ b/src/devices/boiler.h @@ -134,6 +134,8 @@ class Boiler : public EMSdevice { char lastCode_[50]; // last error code char serviceCode_[4]; // 3 character status/service code uint16_t serviceCodeNumber_; // error/service code + uint8_t emergencyOps_; + uint8_t emergencyTemp_; // info uint32_t upTimeControl_; // Operating time control @@ -278,6 +280,8 @@ class Boiler : public EMSdevice { bool set_ww_hyst_on(const char * value, const int8_t id); bool set_ww_hyst_off(const char * value, const int8_t id); bool set_pool_temp(const char * value, const int8_t id); + bool set_emergency_temp(const char * value, const int8_t id); + bool set_emergency_ops(const char * value, const int8_t id); /* bool set_hybridStrategy(const char * value, const int8_t id); bool set_switchOverTemp(const char * value, const int8_t id); diff --git a/src/locale_EN.h b/src/locale_EN.h index 57653f1af..5ddf6dc1e 100644 --- a/src/locale_EN.h +++ b/src/locale_EN.h @@ -465,6 +465,8 @@ MAKE_PSTR_LIST(maintenanceMessage, F("maintenancemessage"), F("maintenance messa MAKE_PSTR_LIST(maintenanceDate, F("maintenancedate"), F("next maintenance date")) MAKE_PSTR_LIST(maintenanceType, F_(maintenance), F("maintenance scheduled")) MAKE_PSTR_LIST(maintenanceTime, F("maintenancetime"), F("time to next maintenance")) +MAKE_PSTR_LIST(emergencyOps, F("emergencyops"), F("emergency operation")) +MAKE_PSTR_LIST(emergencyTemp, F("emergencytemp"), F("emergency temperature")) // heatpump/compress specific MAKE_PSTR_LIST(upTimeControl, F("uptimecontrol"), F("total operating time heat"))