diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index befac9bd5..46613654b 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -2503,6 +2503,29 @@ bool Thermostat::set_RC30Vacation(const char * value, const int8_t id) { return true; } +// set R3000 holiday as string dd.mm.yyyy-dd.mm.yyyy +// RC30 and rego 3000 +bool Thermostat::set_R3000Holiday(const char * value, const int8_t id) { + if (strlen(value) != 21) { + return false; + } + + uint8_t data[6]; + data[2] = (value[0] - '0') * 10 + (value[1] - '0'); + data[1] = (value[3] - '0') * 10 + (value[4] - '0'); + data[0] = (value[7] - '0') * 100 + (value[8] - '0') * 10 + (value[9] - '0'); + data[5] = (value[11] - '0') * 10 + (value[12] - '0'); + data[4] = (value[14] - '0') * 10 + (value[15] - '0'); + data[3] = (value[18] - '0') * 100 + (value[19] - '0') * 10 + (value[20] - '0'); + + if (!data[2] || data[2] > 31 || !data[1] || data[1] > 12 || !data[5] || data[5] > 31 || !data[4] || data[4] > 12) { + return false; + } + write_command(0x269, 0, data, 6, 0x269); + return true; +} + + // set pause in hours bool Thermostat::set_pause(const char * value, const int8_t id) { auto hc = heating_circuit(id); @@ -3934,9 +3957,9 @@ void Thermostat::register_device_values() { &vacation[0], DeviceValueType::STRING, FL_(tpl_holidays), - FL_(holiday), + FL_(vacations), DeviceValueUOM::NONE, - MAKE_CF_CB(set_RC30Vacation)); + MAKE_CF_CB(set_R3000Holiday)); } register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hybridStrategy_, diff --git a/src/devices/thermostat.h b/src/devices/thermostat.h index 757d59a3b..74e5cba14 100644 --- a/src/devices/thermostat.h +++ b/src/devices/thermostat.h @@ -580,6 +580,7 @@ class Thermostat : public EMSdevice { bool set_wwDailyHeating(const char * value, const int8_t id); bool set_wwDailyHeatTime(const char * value, const int8_t id); bool set_wwwhenmodeoff(const char * value, const int8_t id); + bool set_R3000Holiday(const char * value, const int8_t id); inline bool set_wwVacation(const char * value, const int8_t id) { return set_holiday(value, DeviceValueTAG::TAG_DHW1, true); }