diff --git a/src/core/locale_translations.h b/src/core/locale_translations.h index f5ce7ce07..12c15bf77 100644 --- a/src/core/locale_translations.h +++ b/src/core/locale_translations.h @@ -895,6 +895,8 @@ MAKE_TRANSLATION(cyl3BottomTemp, "cyl3bottomtemp", "third cylinder bottom temper MAKE_TRANSLATION(cylTopTemp, "cyltoptemp", "cylinder top temperature (TS10)", "Speichertemperatur oben (TS10)", "", "Cylindertemperatur Toppen (TS10)", "", "", "", "", "", "horná teplota valca (TS10)", "") // TODO translate MAKE_TRANSLATION(transferPumpMod, "transferpumpmod", "transfer pump modulation", "Transferpumpenmodulation", "", "Överföringspumpmodulering", "", "", "", "", "", "modulácia prenosového čerpadla", "") // TODO translate MAKE_TRANSLATION(transferPump, "transferpump", "transfer pump", "Transferpumpe", "", "Överföringspump", "", "", "", "", "", "prenosové čerpadlo", "") // TODO translate +MAKE_TRANSLATION(heatAssistOn, "heatassiston", "heat assistance on", "Einschaltdiff. Rücklaufanh.") +MAKE_TRANSLATION(heatAssistOff, "heatassistoff", "heat assistance off", "Ausschaltdiff. Rücklaufanh.") // solar dhw MAKE_TRANSLATION(wwColdTemp, "coldtemp", "cold water", "Kaltwasser", "", "kallvatten", "zimna woda", "", "", "", "", "studená voda", "studená voda") // TODO translate diff --git a/src/devices/solar.cpp b/src/devices/solar.cpp index 6b787ccac..95f8a2861 100644 --- a/src/devices/solar.cpp +++ b/src/devices/solar.cpp @@ -417,6 +417,20 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c DeviceValueNumOp::DV_NUMOP_DIV10, FL_(swapRetTemp), DeviceValueUOM::DEGREES); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &heatAssistOn_, + DeviceValueType::INT8, + DeviceValueNumOp::DV_NUMOP_DIV10, + FL_(heatAssistOn), + DeviceValueUOM::K, + MAKE_CF_CB(set_solarHeatAssistOn)); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, + &heatAssistOff_, + DeviceValueType::INT8, + DeviceValueNumOp::DV_NUMOP_DIV10, + FL_(heatAssistOff), + DeviceValueUOM::K, + MAKE_CF_CB(set_solarHeatAssistOn)); } } @@ -540,7 +554,8 @@ void Solar::process_SM100Circuit2Config(std::shared_ptr telegram // type 0x35C Heat assistance void Solar::process_SM100HeatAssist(std::shared_ptr telegram) { - has_update(telegram, solarHeatAssist_, 0); // is *10 + has_update(telegram, heatAssistOn_, 0); // is *10 + has_update(telegram, heatAssistOff_, 1); // is *10 } // type 0x361 differential control @@ -1103,4 +1118,22 @@ bool Solar::set_diffControl(const char * value, const int8_t id) { return true; } +bool Solar::set_solarHeatAssistOn(const char * value, const int8_t id) { + float t; + if (!Helpers::value2float(value, t)) { + return false; + } + write_command(0x35C, 0, (uint8_t)(t * 10), 0x35C); + return true; +} + +bool Solar::set_solarHeatAssistOff(const char * value, const int8_t id) { + float t; + if (!Helpers::value2float(value, t)) { + return false; + } + write_command(0x35C, 1, (uint8_t)(t * 10), 0x35C); + return true; +} + } // namespace emsesp diff --git a/src/devices/solar.h b/src/devices/solar.h index f6514c0ee..3dceaff31 100644 --- a/src/devices/solar.h +++ b/src/devices/solar.h @@ -105,7 +105,8 @@ class Solar : public EMSdevice { uint8_t solarPump2Mode_; // 00=off, 01=PWM, 02=10V // telegram 0x35C Heat assistance - uint8_t solarHeatAssist_; // is *10 + int8_t heatAssistOn_; // is *10 + int8_t heatAssistOff_; // is *10 // telegram 0x035F uint8_t cylPriority_; // 0 or 1 @@ -195,6 +196,8 @@ class Solar : public EMSdevice { bool set_cylPriority(const char * value, const int8_t id); bool set_heatAssist(const char * value, const int8_t id); bool set_diffControl(const char * value, const int8_t id); + bool set_solarHeatAssistOn(const char * value, const int8_t id); + bool set_solarHeatAssistOff(const char * value, const int8_t id); }; } // namespace emsesp diff --git a/src/web/WebCustomEntityService.cpp b/src/web/WebCustomEntityService.cpp index b489a9bc5..8f34b0123 100644 --- a/src/web/WebCustomEntityService.cpp +++ b/src/web/WebCustomEntityService.cpp @@ -196,7 +196,7 @@ bool WebCustomEntityService::command_setvalue(const char * value, const int8_t i if (!Helpers::value2float(value, f)) { return false; } - int v = f / entityItem.factor; + int v = (f / entityItem.factor + 0.5); if (entityItem.value_type == DeviceValueType::UINT8 || entityItem.value_type == DeviceValueType::INT8) { EMSESP::send_write_request(entityItem.type_id, entityItem.device_id, entityItem.offset, v, 0); } else if (entityItem.value_type == DeviceValueType::UINT16 || entityItem.value_type == DeviceValueType::INT16) {