mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 01:09:51 +03:00
Merge pull request #1741 from MichaelDvP/dev
rego holiday and fix command with command as value, dev-10
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
- heatpump entities `fan` and `shutdown` [#1690](https://github.com/emsesp/EMS-ESP32/discussions/1690)
|
||||
- mqtt HA-mode 3 for v3.6 compatible HA entities, set on update v3.6->v3.7
|
||||
- HP input states [#1723](https://github.com/emsesp/EMS-ESP32/discussions/1723)
|
||||
- holiday settings for rego 3000 [#1735](https://github.com/emsesp/EMS-ESP32/issues/1735)
|
||||
- Added scripts for OTA (scripts/upload.py and upload_cli.py) [#1738](https://github.com/emsesp/EMS-ESP32/issues/1738)
|
||||
|
||||
## Fixed
|
||||
|
||||
@@ -173,10 +173,9 @@ uint8_t Command::process(const char * path, const bool is_admin, const JsonObjec
|
||||
if (!output.containsKey("api_data")) {
|
||||
return CommandRet::INVALID;
|
||||
}
|
||||
String dat = output["api_data"];
|
||||
String dat = output["api_data"].as<String>();
|
||||
output.clear();
|
||||
input["data"] = dat.c_str();
|
||||
data = input["data"];
|
||||
return Command::call(device_type, command_p, dat.c_str(), is_admin, id_n, output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,6 +174,7 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i
|
||||
register_telegram_type(0x240, "RC300Settings", true, MAKE_PF_CB(process_RC300Settings));
|
||||
register_telegram_type(0xBB, "HybridSettings", true, MAKE_PF_CB(process_HybridSettings));
|
||||
register_telegram_type(0x23E, "PVSettings", true, MAKE_PF_CB(process_PVSettings));
|
||||
register_telegram_type(0x269, "RC300Holiday1", true, MAKE_PF_CB(process_RC300Holiday));
|
||||
|
||||
// JUNKERS/HT3
|
||||
} else if (model == EMSdevice::EMS_DEVICE_FLAG_JUNKERS) {
|
||||
@@ -1289,6 +1290,25 @@ void Thermostat::process_RC300Floordry(std::shared_ptr<const Telegram> telegram)
|
||||
has_update(telegram, floordrytemp_, 1);
|
||||
}
|
||||
|
||||
// 0x269 - 0x26D RC300 EMS+ holidaymodes 1 to 5
|
||||
// special case R3000 only date in 0x269
|
||||
void Thermostat::process_RC300Holiday(std::shared_ptr<const Telegram> telegram) {
|
||||
if (telegram->offset || telegram->message_length < 6) {
|
||||
return;
|
||||
}
|
||||
char data[sizeof(vacation[0]) + 4];
|
||||
snprintf(data,
|
||||
sizeof(data),
|
||||
"%02d.%02d.%04d-%02d.%02d.%04d",
|
||||
telegram->message_data[2],
|
||||
telegram->message_data[1],
|
||||
telegram->message_data[0] + 2000,
|
||||
telegram->message_data[5],
|
||||
telegram->message_data[4],
|
||||
telegram->message_data[3] + 2000);
|
||||
has_update(vacation[0], data, sizeof(vacation[0]));
|
||||
}
|
||||
|
||||
// 0x291 ff. HP mode
|
||||
// thermostat(0x10) -W-> Me(0x0B), HPMode(0x0291), data: 01 00 00 03 FF 00
|
||||
void Thermostat::process_HPMode(std::shared_ptr<const Telegram> telegram) {
|
||||
@@ -2433,14 +2453,9 @@ bool Thermostat::set_holiday(const char * value, const int8_t id, const bool vac
|
||||
data[4] = (value[14] - '0') * 10 + (value[15] - '0');
|
||||
data[5] = (value[18] - '0') * 100 + (value[19] - '0') * 10 + (value[20] - '0');
|
||||
|
||||
if (data[0] > 31 || data[1] > 12 || data[3] > 31 || data[4] > 12) {
|
||||
if (!data[0] || data[0] > 31 || !data[1] || data[1] > 12 || !data[3] || data[3] > 31 || !data[4] || data[4] > 12) {
|
||||
return false;
|
||||
}
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_RC30) {
|
||||
write_command(0xA9 + hc->hc(), 1, data, 6, 0x9A + hc->hc());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!vacation || value[10] == '+') { // + for compatibility
|
||||
if (hc) {
|
||||
write_command(timer_typeids[hc->hc()], 93, data, 6, timer_typeids[hc->hc()]);
|
||||
@@ -2462,6 +2477,7 @@ bool Thermostat::set_holiday(const char * value, const int8_t id, const bool vac
|
||||
}
|
||||
|
||||
// set vacations as string dd.mm.yyyy-dd.mm.yyyy
|
||||
// RC30 and rego 3000
|
||||
bool Thermostat::set_RC30Vacation(const char * value, const int8_t id) {
|
||||
if (strlen(value) != 21) {
|
||||
return false;
|
||||
@@ -2478,10 +2494,38 @@ bool Thermostat::set_RC30Vacation(const char * value, const int8_t id) {
|
||||
if (!data[0] || data[0] > 31 || !data[1] || data[1] > 12 || !data[3] || data[3] > 31 || !data[4] || data[4] > 12) {
|
||||
return false;
|
||||
}
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_R3000) {
|
||||
write_command(0x269, 0, data, 6, 0x269);
|
||||
return true;
|
||||
}
|
||||
// RC30
|
||||
write_command(0xA9, 1 + 7 * (id - 1), data, 6, 0x9A);
|
||||
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);
|
||||
@@ -3908,6 +3952,15 @@ void Thermostat::register_device_values() {
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_minexttemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &ibaDamping_, DeviceValueType::BOOL, FL_(damping), DeviceValueUOM::NONE, MAKE_CF_CB(set_damping));
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_R3000) {
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&vacation[0],
|
||||
DeviceValueType::STRING,
|
||||
FL_(tpl_holidays),
|
||||
FL_(vacations),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_R3000Holiday));
|
||||
}
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&hybridStrategy_,
|
||||
DeviceValueType::ENUM,
|
||||
|
||||
@@ -271,7 +271,7 @@ class Thermostat : public EMSdevice {
|
||||
uint8_t humidity_;
|
||||
uint8_t battery_;
|
||||
|
||||
char vacation[8][22]; // RC30 only, only one hc
|
||||
char vacation[8][22]; // RC30, R3000 only, only one hc
|
||||
|
||||
// HybridHP
|
||||
uint8_t hybridStrategy_; // co2 = 1, cost = 2, temperature = 3, mix = 4
|
||||
@@ -431,6 +431,7 @@ class Thermostat : public EMSdevice {
|
||||
void process_RC300OutdoorTemp(std::shared_ptr<const Telegram> telegram);
|
||||
void process_RC300Settings(std::shared_ptr<const Telegram> telegram);
|
||||
void process_RC300Floordry(std::shared_ptr<const Telegram> telegram);
|
||||
void process_RC300Holiday(std::shared_ptr<const Telegram> telegram);
|
||||
void process_RC300Curve(std::shared_ptr<const Telegram> telegram);
|
||||
void process_JunkersMonitor(std::shared_ptr<const Telegram> telegram);
|
||||
void process_JunkersSet(std::shared_ptr<const Telegram> telegram);
|
||||
@@ -579,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);
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define EMSESP_APP_VERSION "3.7.0-dev.9"
|
||||
#define EMSESP_APP_VERSION "3.7.0-dev.10"
|
||||
|
||||
Reference in New Issue
Block a user