sync tag and id, add RC30 vacation #1712

This commit is contained in:
MichaelDvP
2024-05-03 08:31:20 +02:00
parent d056846eb0
commit 3a772a0dbf
16 changed files with 210 additions and 172 deletions

View File

@@ -1727,7 +1727,7 @@ void Boiler::process_UBASetPoints(std::shared_ptr<const Telegram> telegram) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
// 0x35 - not yet implemented
// 0x35 - not yet implemented, not readable, only for settings
void Boiler::process_UBAFlags(std::shared_ptr<const Telegram> telegram) {
}

View File

@@ -26,9 +26,9 @@ Heatsource::Heatsource(uint8_t device_type, uint8_t device_id, uint8_t product_i
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
// AM200 alternative heatsource
if (device_id == EMSdevice::EMS_DEVICE_ID_BOILER || (device_id >= EMSdevice::EMS_DEVICE_ID_AHS1 && device_id < EMSdevice::EMS_DEVICE_ID_HS1)) {
uint8_t tag = device_id == EMSdevice::EMS_DEVICE_ID_BOILER
? DeviceValueTAG::TAG_DEVICE_DATA
: DeviceValueTAG::TAG_AHS1 + device_id - EMSdevice::EMS_DEVICE_ID_AHS1; // heating source id, count from 0
int8_t tag = device_id == EMSdevice::EMS_DEVICE_ID_BOILER
? DeviceValueTAG::TAG_DEVICE_DATA
: DeviceValueTAG::TAG_AHS1 + device_id - EMSdevice::EMS_DEVICE_ID_AHS1; // heating source id, count from 0
register_telegram_type(0x54D, "AmTemperatures", false, MAKE_PF_CB(process_amTempMessage));
register_telegram_type(0x54E, "AmStatus", false, MAKE_PF_CB(process_amStatusMessage));
register_telegram_type(0x54F, "AmCommand", false, MAKE_PF_CB(process_amCommandMessage)); // not broadcasted, but actually not used
@@ -75,23 +75,18 @@ Heatsource::Heatsource(uint8_t device_type, uint8_t device_id, uint8_t product_i
// cascaded heating sources, only some values per individual heatsource (hs)
if (device_id >= EMSdevice::EMS_DEVICE_ID_HS1) {
uint8_t hs = device_id - EMSdevice::EMS_DEVICE_ID_HS1; // heating source id, count from 0
int8_t tag = DeviceValueTAG::TAG_HS1 + device_id - EMSdevice::EMS_DEVICE_ID_HS1; // heating source id, count from 0
// Runtime of each heatingsource in 0x06DC, ff
register_telegram_type(0x6DC + hs, "CascadeMessage", false, MAKE_PF_CB(process_CascadeMessage));
register_device_value(DeviceValueTAG::TAG_HS1 + hs, &burnWorkMin_, DeviceValueType::TIME, FL_(burnWorkMin), DeviceValueUOM::MINUTES);
register_telegram_type(0x6DC + device_id - EMSdevice::EMS_DEVICE_ID_HS1, "CascadeMessage", false, MAKE_PF_CB(process_CascadeMessage));
register_device_value(tag, &burnWorkMin_, DeviceValueType::TIME, FL_(burnWorkMin), DeviceValueUOM::MINUTES);
// selBurnpower in D2 and E4
// register_telegram_type(0xD2, "CascadePowerMessage", false, MAKE_PF_CB(process_CascadePowerMessage));
// individual Flowtemps and powervalues for each heatingsource in E4
register_telegram_type(0xE4, "UBAMonitorFastPlus", false, MAKE_PF_CB(process_UBAMonitorFastPlus));
register_device_value(DeviceValueTAG::TAG_HS1 + hs, &setFlowTemp_, DeviceValueType::UINT8, FL_(setFlowTemp), DeviceValueUOM::DEGREES);
register_device_value(DeviceValueTAG::TAG_HS1 + hs, &selBurnPow_, DeviceValueType::UINT8, FL_(selBurnPow), DeviceValueUOM::PERCENT);
register_device_value(DeviceValueTAG::TAG_HS1 + hs,
&curFlowTemp_,
DeviceValueType::UINT16,
DeviceValueNumOp::DV_NUMOP_DIV10,
FL_(curFlowTemp),
DeviceValueUOM::DEGREES);
register_device_value(DeviceValueTAG::TAG_HS1 + hs, &curBurnPow_, DeviceValueType::UINT8, FL_(curBurnPow), DeviceValueUOM::PERCENT);
register_device_value(tag, &setFlowTemp_, DeviceValueType::UINT8, FL_(setFlowTemp), DeviceValueUOM::DEGREES);
register_device_value(tag, &selBurnPow_, DeviceValueType::UINT8, FL_(selBurnPow), DeviceValueUOM::PERCENT);
register_device_value(tag, &curFlowTemp_, DeviceValueType::UINT16, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(curFlowTemp), DeviceValueUOM::DEGREES);
register_device_value(tag, &curBurnPow_, DeviceValueType::UINT8, FL_(curBurnPow), DeviceValueUOM::PERCENT);
return;
}
}

View File

@@ -26,13 +26,12 @@ uuid::log::Logger Mixer::logger_{F_(mixer), uuid::log::Facility::CONSOLE};
Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
int8_t tag = DeviceValueTAG::TAG_HC1 + device_id - 0x20;
// EMS+
if (flags == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) {
register_telegram_type(device_id - 0x20 + 0x02D7, "MMPLUSStatusMessage_HC", false, MAKE_PF_CB(process_MMPLUSStatusMessage_HC));
// register_telegram_type(device_id - 0x20 + 0x02E1, "MMPLUSSetMessage_HC", true, MAKE_PF_CB(process_MMPLUSSetMessage_HC));
register_telegram_type(device_id - 0x20 + 0x02CD, "MMPLUSSetMessage_HC", true, MAKE_PF_CB(process_MMPLUSSetMessage_HC));
hc_ = device_id - 0x20 + 1;
uint8_t tag = DeviceValueTAG::TAG_HC1 + hc_ - 1;
register_telegram_type(device_id - 0x20 + 0x02D7, "MMPLUSStatusMessage", false, MAKE_PF_CB(process_MMPLUSStatusMessage_HC));
// register_telegram_type(device_id - 0x20 + 0x02E1, "MMPLUSSetMessage", true, MAKE_PF_CB(process_MMPLUSSetMessage_HC));
register_telegram_type(device_id - 0x20 + 0x02CD, "MMPLUSConfigMessage", true, MAKE_PF_CB(process_MMPLUSConfigMessage_HC));
register_device_value(tag, &flowTempHc_, DeviceValueType::UINT16, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(flowTempHc), DeviceValueUOM::DEGREES);
register_device_value(tag, &status_, DeviceValueType::UINT8, FL_(mixerStatus), DeviceValueUOM::PERCENT);
register_device_value(tag, &flowSetTemp_, DeviceValueType::UINT8, FL_(flowSetTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_flowSetTemp));
@@ -55,8 +54,6 @@ Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
register_telegram_type(0x00AA, "MMConfigMessage", true, MAKE_PF_CB(process_MMConfigMessage));
register_telegram_type(0x00AB, "MMStatusMessage", false, MAKE_PF_CB(process_MMStatusMessage));
register_telegram_type(0x00AC, "MMSetMessage", false, MAKE_PF_CB(process_MMSetMessage));
hc_ = device_id - 0x20 + 1;
uint8_t tag = DeviceValueTAG::TAG_HC1 + hc_ - 1;
register_device_value(tag, &flowTempHc_, DeviceValueType::UINT16, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(flowTempHc), DeviceValueUOM::DEGREES);
register_device_value(tag, &status_, DeviceValueType::INT8, FL_(mixerStatus), DeviceValueUOM::PERCENT);
register_device_value(tag, &flowSetTemp_, DeviceValueType::UINT8, FL_(flowSetTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_flowSetTemp));
@@ -70,7 +67,7 @@ Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
DeviceValueUOM::SECONDS,
MAKE_CF_CB(set_setValveTime),
10,
120);
600);
}
// HT3
@@ -78,8 +75,6 @@ Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
register_telegram_type(0x010C, "IPMStatusMessage", false, MAKE_PF_CB(process_IPMStatusMessage));
register_telegram_type(0x011E, "IPMTempMessage", false, MAKE_PF_CB(process_IPMTempMessage));
// register_telegram_type(0x0123, "IPMSetMessage", false, MAKE_PF_CB(process_IPMSetMessage));
hc_ = device_id - 0x20 + 1;
uint8_t tag = DeviceValueTAG::TAG_HC1 + hc_ - 1;
register_device_value(tag, &flowTempHc_, DeviceValueType::UINT16, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(flowTempHc), DeviceValueUOM::DEGREES);
register_device_value(tag, &status_, DeviceValueType::UINT8, FL_(mixerStatus), DeviceValueUOM::PERCENT);
register_device_value(tag, &flowSetTemp_, DeviceValueType::UINT8, FL_(flowSetTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_flowSetTemp));
@@ -151,10 +146,11 @@ void Mixer::process_MMConfigMessage(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, setValveTime_, 1); // valve runtime in 10 sec, max 120 s
}
// Mixer Setting 0x2DC, ..
void Mixer::process_MMPLUSSetMessage_HC(std::shared_ptr<const Telegram> telegram) {
// Mixer Config 0x2CD, ..
// mixer(0x20) -W-> Me(0x0B), ?(0x02CD), data: FF 0E 05 FF 1E 00
void Mixer::process_MMPLUSConfigMessage_HC(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, activated_, 0); // on = 0xFF
has_update(telegram, setValveTime_, 1); // valve runtime in 10 sec, max 120 s
has_update(telegram, setValveTime_, 1); // valve runtime in 10 sec, default 120 s, max 600 s
has_update(telegram, flowTempOffset_, 2); // Mixer increase [0-20 K]
}

View File

@@ -31,6 +31,7 @@ class Mixer : public EMSdevice {
static uuid::log::Logger logger_;
void process_MMPLUSStatusMessage_HC(std::shared_ptr<const Telegram> telegram);
void process_MMPLUSConfigMessage_HC(std::shared_ptr<const Telegram> telegram);
void process_MMPLUSSetMessage_HC(std::shared_ptr<const Telegram> telegram);
void process_IPMStatusMessage(std::shared_ptr<const Telegram> telegram);
void process_IPMTempMessage(std::shared_ptr<const Telegram> telegram);
@@ -54,8 +55,6 @@ class Mixer : public EMSdevice {
uint8_t activated_;
uint8_t setValveTime_;
uint8_t flowTempOffset_;
uint16_t hc_ = EMS_VALUE_UINT16_NOTSET;
};
} // namespace emsesp

View File

@@ -582,7 +582,7 @@ std::shared_ptr<Thermostat::DhwCircuit> Thermostat::dhw_circuit(const uint8_t of
// type 0xB1 - data from the RC10 thermostat (0x17)
// Data: 04 23 00 BA 00 00 00 BA
void Thermostat::process_RC10Monitor(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -599,7 +599,7 @@ void Thermostat::process_RC10Monitor(std::shared_ptr<const Telegram> telegram) {
// type 0xB0 - for reading the mode from the RC10 thermostat (0x17)
// Data: 00 FF 00 1C 20 08 01
void Thermostat::process_RC10Set(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -619,7 +619,7 @@ void Thermostat::process_RC10Set(std::shared_ptr<const Telegram> telegram) {
// type 0xB2, mode setting Data: 04 00
// not used, we read mode from monitor 0xB1
void Thermostat::process_RC10Set_2(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -633,7 +633,7 @@ void Thermostat::process_RC10Set_2(std::shared_ptr<const Telegram> telegram) {
// 0xA8 - for reading the mode from the RC20 thermostat (0x17)
// RC20Set(0xA8), data: 01 00 FF F6 01 06 00 01 0D 01 00 FF FF 01 02 02 02 00 00 05 1E 05 1E 02 1C 00 FF 00 00 26 02
void Thermostat::process_RC20Set(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -646,7 +646,7 @@ void Thermostat::process_RC20Set(std::shared_ptr<const Telegram> telegram) {
// 0x90 - for reading curve temperature from the RC20 thermostat (0x17)
//
void Thermostat::process_RC20Temp(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -662,7 +662,7 @@ void Thermostat::process_RC20Temp(std::shared_ptr<const Telegram> telegram) {
// data: E7 90 E7 90 E7 90 E7 90 E7 90 E7 90 E7 90 E7 90 E7 90 E7 90 E7 90 E7 90 E7 90 E7 (offset 54)
// data: 90 E7 90 01 00 00 01 01 00 01 01 00 01 01 00 01 01 00 00 (offset 81)
void Thermostat::process_RC20Timer(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -690,7 +690,7 @@ void Thermostat::process_RC20Timer(std::shared_ptr<const Telegram> telegram) {
// 17 00 AE 00 80 12 2E 00 D0 00 00 64 (#data=8)
// https://github.com/emsesp/EMS-ESP/issues/361
void Thermostat::process_RC20Monitor_2(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -709,7 +709,7 @@ void Thermostat::process_RC20Monitor_2(std::shared_ptr<const Telegram> telegram)
// 17 00 AD 00 01 27 29 01 4B 05 01 FF 28 19 0A 02 00 00
// RC25(0x17) -> All(0x00), ?(0xAD), data: 01 27 2D 00 44 05 01 FF 28 19 0A 07 00 00 F6 12 5A 11 00 28 05 05 00
void Thermostat::process_RC20Set_2(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -729,7 +729,7 @@ void Thermostat::process_RC20Set_2(std::shared_ptr<const Telegram> telegram) {
// 0xAF - for reading the roomtemperature from the RC20/ES72 thermostat (0x18, 0x19, ..)
void Thermostat::process_RC20Remote(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -777,7 +777,7 @@ void Thermostat::process_RemoteBattery(std::shared_ptr<const Telegram> telegram)
// type 0x0165, ff
void Thermostat::process_JunkersSet(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -805,7 +805,7 @@ void Thermostat::process_JunkersSet(std::shared_ptr<const Telegram> telegram) {
// type 0x0179, ff for Junkers_OLD
void Thermostat::process_JunkersSet2(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -839,7 +839,7 @@ void Thermostat::process_RCOutdoorTemp(std::shared_ptr<const Telegram> telegram)
// RC20Monitor(0x91), data: 90 2A 00 D5 1A 00 00 05 00 5A 04 00 D6 00
// offset 8: setburnpower to boiler, offset 9: setflowtemp to boiler (thermostat: targetflowtemp) send via 0x1A
void Thermostat::process_RC20Monitor(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -852,7 +852,7 @@ void Thermostat::process_RC20Monitor(std::shared_ptr<const Telegram> telegram) {
// type 0x0A - data from the Nefit Easy/TC100 thermostat (0x18) - 31 bytes long
void Thermostat::process_EasyMonitor(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -971,7 +971,7 @@ void Thermostat::process_JunkersMonitor(std::shared_ptr<const Telegram> telegram
return;
}
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -1008,7 +1008,7 @@ void Thermostat::process_PVSettings(std::shared_ptr<const Telegram> telegram) {
}
void Thermostat::process_JunkersSetMixer(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -1022,7 +1022,7 @@ void Thermostat::process_JunkersWW(std::shared_ptr<const Telegram> telegram) {
// type 0x02A5 - data from Worchester CRF200
void Thermostat::process_CRFMonitor(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -1039,7 +1039,7 @@ void Thermostat::process_CRFMonitor(std::shared_ptr<const Telegram> telegram) {
// type 0x02A5 - data from the Nefit RC1010/3000 thermostat (0x18) and RC300/310s on 0x10
// Rx: 10 0B FF 00 01 A5 80 00 01 30 23 00 30 28 01 E7 03 03 01 01 E7 02 33 00 00 11 01 03 FF FF 00 04
void Thermostat::process_RC300Monitor(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -1078,7 +1078,7 @@ void Thermostat::process_RC300Monitor(std::shared_ptr<const Telegram> telegram)
// type 0x02B9 EMS+ for reading from RC300/RC310 thermostat
// Thermostat(0x10) -> Me(0x0B), RC300Set(0x2B9), data: FF 2E 2A 26 1E 02 4E FF FF 00 1C 01 E1 20 01 0F 05 00 00 02 1F
void Thermostat::process_RC300Set(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -1132,7 +1132,7 @@ void Thermostat::process_RC300Set(std::shared_ptr<const Telegram> telegram) {
// types 0x2AF ff
// RC300Summer(0x02AF), data: 00 28 00 00 3C 26 00 00 19 0F 00 (from a heatpump)
void Thermostat::process_RC300Summer(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -1158,7 +1158,7 @@ void Thermostat::process_RC300Summer(std::shared_ptr<const Telegram> telegram) {
// types 0x471 ff
// (0x473), data: 00 11 04 01 01 1C 08 04
void Thermostat::process_RC300Summer2(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -1178,7 +1178,7 @@ void Thermostat::process_RC300Summer2(std::shared_ptr<const Telegram> telegram)
// types 0x29B ff
// Thermostat(0x10) -> Me(0x0B), RC300Curves(0x29B), data: 01 01 00 FF FF 01 05 30 52
void Thermostat::process_RC300Curve(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -1276,7 +1276,7 @@ void Thermostat::process_RC300Set2(std::shared_ptr<const Telegram> telegram) {
// telegram is either offset 3 with data length of 1 and values 0/1 (radiators) - 10 0B FF 03 01 CC 01 F6
// or offset 0 with data length of 6 bytes - offset 3 values are 0x00 or 0xFF - 10 0B FF 00 01 CE FF 13 0A FF 1E 00 20
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -1292,7 +1292,7 @@ void Thermostat::process_RC300Floordry(std::shared_ptr<const Telegram> telegram)
// 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) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -1302,7 +1302,7 @@ void Thermostat::process_HPMode(std::shared_ptr<const Telegram> telegram) {
// 0x467 ff HP settings
void Thermostat::process_HPSet(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -1314,7 +1314,7 @@ void Thermostat::process_HPSet(std::shared_ptr<const Telegram> telegram) {
// type 0x41 - data from the RC30 thermostat(0x10) - 14 bytes long
// RC30Monitor(0x41), data: 80 20 00 AC 00 00 00 02 00 05 09 00 AC 00
void Thermostat::process_RC30Monitor(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -1329,7 +1329,7 @@ void Thermostat::process_RC30Monitor(std::shared_ptr<const Telegram> telegram) {
// RC30Set(0xA7), data: 01 00 FF F6 01 06 00 01 0D 00 00 FF FF 01 02 02 02 00 00 05 1F 05 1F 01 0E 00 FF
// RC30Set(0xA7), data: 00 00 20 02 (offset 27)
void Thermostat::process_RC30Set(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -1357,7 +1357,7 @@ void Thermostat::process_RC30Temp(std::shared_ptr<const Telegram> telegram) {
return;
}
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -1380,7 +1380,7 @@ void Thermostat::process_RC35Monitor(std::shared_ptr<const Telegram> telegram) {
return;
}
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -1404,7 +1404,7 @@ void Thermostat::process_RC35Set(std::shared_ptr<const Telegram> telegram) {
return;
}
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -1446,7 +1446,7 @@ void Thermostat::process_RC35Set(std::shared_ptr<const Telegram> telegram) {
// type 0x3F (HC1), 0x49 (HC2), 0x53 (HC3), 0x5D (HC4) - timer setting
void Thermostat::process_RC35Timer(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
auto hc = heating_circuit(telegram);
if (hc == nullptr) {
return;
}
@@ -1517,23 +1517,26 @@ void Thermostat::process_RC35Timer(std::shared_ptr<const Telegram> telegram) {
// type 0x9A (HC1)
void Thermostat::process_RC30Vacation(std::shared_ptr<const Telegram> telegram) {
auto hc = heating_circuit(0x9A - telegram->type_id + 1);
if (hc == nullptr) {
uint8_t index = 0;
if ((telegram->offset + telegram->message_length) > 57) {
return;
}
if (telegram->message_length + telegram->offset >= 7 && telegram->offset <= 1) {
char data[sizeof(hc->vacation)];
static uint8_t vacation_telegram[57] = {0}; // make a copy of the whole telegram to access blocks
memcpy(&vacation_telegram[telegram->offset], telegram->message_data, telegram->message_length);
for (uint8_t index = 0; index < 8; index++) {
char data[sizeof(vacation[0])];
snprintf(data,
sizeof(data),
"%02d.%02d.%04d-%02d.%02d.%04d",
telegram->message_data[1 - telegram->offset],
telegram->message_data[2 - telegram->offset],
telegram->message_data[3 - telegram->offset] + 2000,
telegram->message_data[4 - telegram->offset],
telegram->message_data[5 - telegram->offset],
telegram->message_data[7 - telegram->offset] + 2000);
has_update(hc->vacation, data, sizeof(hc->vacation));
vacation_telegram[1 + 7 * index],
vacation_telegram[2 + 7 * index],
vacation_telegram[3 + 7 * index] + 2000,
vacation_telegram[4 + 7 * index],
vacation_telegram[5 + 7 * index],
vacation_telegram[6 + 7 * index] + 2000);
if (data[1] > '0') {
has_update(vacation[index], data, sizeof(vacation[0]));
}
}
}
@@ -2459,6 +2462,27 @@ bool Thermostat::set_holiday(const char * value, const int8_t id, const bool vac
return true;
}
// set vacations as string dd.mm.yyyy-dd.mm.yyyy
bool Thermostat::set_RC30Vacation(const char * value, const int8_t id) {
if (strlen(value) != 21) {
return false;
}
uint8_t data[6];
data[0] = (value[0] - '0') * 10 + (value[1] - '0');
data[1] = (value[3] - '0') * 10 + (value[4] - '0');
data[2] = (value[7] - '0') * 100 + (value[8] - '0') * 10 + (value[9] - '0');
data[3] = (value[11] - '0') * 10 + (value[12] - '0');
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] || data[0] > 31 || !data[1] || data[1] > 12 || !data[3] || data[3] > 31 || !data[4] || data[4] > 12) {
return false;
}
write_command(0xA9, 1 + 7 * (id - 1), data, 6, 0x9A);
return true;
}
// set pause in hours
bool Thermostat::set_pause(const char * value, const int8_t id) {
auto hc = heating_circuit(id);
@@ -3808,14 +3832,14 @@ bool Thermostat::set_temperature_value(const char * value, const int8_t id, cons
void Thermostat::register_device_values() {
// RF remote sensor seen at 0x40, maybe this is also for different hc with id 0x40 - 0x47? emsesp.cpp maps only 0x40
if (device_id() >= 0x40 && device_id() <= 0x47) {
uint8_t tag = DeviceValueTAG::TAG_HC1 + device_id() - 0x40;
int8_t tag = DeviceValueTAG::TAG_HC1 + device_id() - 0x40;
register_device_value(tag, &tempsensor1_, DeviceValueType::INT16, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(RFTemp), DeviceValueUOM::DEGREES);
return;
}
// RC100H remote with humidity, this is also EMSdevice::EMS_DEVICE_FLAG_RC100 for set_calinttemp
if (device_id() >= 0x38 && device_id() <= 0x3F) {
// each device controls only one hc, so we tag the values
uint8_t tag = DeviceValueTAG::TAG_HC1 + device_id() - 0x38;
int8_t tag = DeviceValueTAG::TAG_HC1 + device_id() - 0x38;
register_device_value(tag, &tempsensor1_, DeviceValueType::INT16, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(remotetemp), DeviceValueUOM::DEGREES);
register_device_value(tag, &dewtemperature_, DeviceValueType::INT16, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(dewTemperature), DeviceValueUOM::DEGREES);
register_device_value(tag, &humidity_, DeviceValueType::UINT8, FL_(airHumidity), DeviceValueUOM::PERCENT);
@@ -3831,7 +3855,7 @@ void Thermostat::register_device_values() {
}
// Junkers FB10 remote, show only internal sensor
if (this->model() == EMSdevice::EMS_DEVICE_FLAG_JUNKERS && device_id() >= 0x18 && device_id() <= 0x1B) {
uint8_t tag = DeviceValueTAG::TAG_HC1 + device_id() - 0x18;
int8_t tag = DeviceValueTAG::TAG_HC1 + device_id() - 0x18;
register_device_value(tag, &tempsensor1_, DeviceValueType::INT16, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(remotetemp), DeviceValueUOM::DEGREES);
return;
}
@@ -4222,7 +4246,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
uint8_t model = hc->get_model();
// heating circuit
uint8_t tag = DeviceValueTAG::TAG_HC1 + hc->hc();
int8_t tag = DeviceValueTAG::TAG_HC1 + hc->hc();
// different logic on how temperature values are stored, depending on model
uint8_t seltemp_divider;
@@ -4448,11 +4472,18 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
break;
case EMSdevice::EMS_DEVICE_FLAG_RC30:
register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode2), FL_(mode), DeviceValueUOM::NONE, MAKE_CF_CB(set_mode));
register_device_value(tag, &hc->holiday, DeviceValueType::STRING, FL_(tpl_holidays), FL_(holidays), DeviceValueUOM::NONE, MAKE_CF_CB(set_holiday));
register_device_value(tag, &hc->vacation, DeviceValueType::STRING, FL_(tpl_holidays), FL_(vacations), DeviceValueUOM::NONE, MAKE_CF_CB(set_vacation));
// register_device_value(tag, &hc->holiday, DeviceValueType::STRING, FL_(tpl_holidays), FL_(holidays), DeviceValueUOM::NONE, MAKE_CF_CB(set_holiday));
// register_device_value(tag, &hc->vacation, DeviceValueType::STRING, FL_(tpl_holidays), FL_(vacations), DeviceValueUOM::NONE, MAKE_CF_CB(set_vacation));
// register_device_value(tag, &hc->pause, DeviceValueType::UINT8, FL_(pause), DeviceValueUOM::HOURS, MAKE_CF_CB(set_pause));
// register_device_value(tag, &hc->party, DeviceValueType::UINT8, FL_(party), DeviceValueUOM::HOURS, MAKE_CF_CB(set_party));
register_device_value(tag, &vacation[0], DeviceValueType::STRING, FL_(tpl_holidays), FL_(vacations1), DeviceValueUOM::NONE, MAKE_CF_CB(set_RC30Vacation1));
register_device_value(tag, &vacation[1], DeviceValueType::STRING, FL_(tpl_holidays), FL_(vacations2), DeviceValueUOM::NONE, MAKE_CF_CB(set_RC30Vacation2));
register_device_value(tag, &vacation[2], DeviceValueType::STRING, FL_(tpl_holidays), FL_(vacations3), DeviceValueUOM::NONE, MAKE_CF_CB(set_RC30Vacation3));
register_device_value(tag, &vacation[3], DeviceValueType::STRING, FL_(tpl_holidays), FL_(vacations4), DeviceValueUOM::NONE, MAKE_CF_CB(set_RC30Vacation4));
register_device_value(tag, &vacation[4], DeviceValueType::STRING, FL_(tpl_holidays), FL_(vacations5), DeviceValueUOM::NONE, MAKE_CF_CB(set_RC30Vacation5));
register_device_value(tag, &vacation[5], DeviceValueType::STRING, FL_(tpl_holidays), FL_(vacations6), DeviceValueUOM::NONE, MAKE_CF_CB(set_RC30Vacation6));
register_device_value(tag, &vacation[6], DeviceValueType::STRING, FL_(tpl_holidays), FL_(vacations7), DeviceValueUOM::NONE, MAKE_CF_CB(set_RC30Vacation7));
register_device_value(tag, &hc->program, DeviceValueType::ENUM, FL_(enum_progMode2), FL_(program), DeviceValueUOM::NONE, MAKE_CF_CB(set_program));
register_device_value(tag, &hc->pause, DeviceValueType::UINT8, FL_(pause), DeviceValueUOM::HOURS, MAKE_CF_CB(set_pause));
register_device_value(tag, &hc->party, DeviceValueType::UINT8, FL_(party), DeviceValueUOM::HOURS, MAKE_CF_CB(set_party));
register_device_value(
tag, &hc->switchtime1, DeviceValueType::STRING, FL_(tpl_switchtime1), FL_(switchtime1), DeviceValueUOM::NONE, MAKE_CF_CB(set_switchtime1));
register_device_value(
@@ -4639,7 +4670,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
// registers the values for a heating circuit
void Thermostat::register_device_values_dhw(std::shared_ptr<Thermostat::DhwCircuit> dhw) {
uint8_t tag = DeviceValueTAG::TAG_DHW1 + dhw->dhw();
int8_t tag = DeviceValueTAG::TAG_DHW1 + dhw->dhw();
switch (this->model()) {
case EMSdevice::EMS_DEVICE_FLAG_RC100:
case EMSdevice::EMS_DEVICE_FLAG_RC300:
@@ -4702,8 +4733,8 @@ void Thermostat::register_device_values_dhw(std::shared_ptr<Thermostat::DhwCircu
register_device_value(
tag, &dhw->wwDisinfectDay_, DeviceValueType::ENUM, FL_(enum_dayOfWeek), FL_(wwDisinfectDay), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwDisinfectDay));
register_device_value(tag, &dhw->wwDisinfectHour_, DeviceValueType::UINT8, FL_(wwDisinfectHour), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwDisinfectHour), 0, 23);
register_device_value(tag, &dhw->wwHoliday_, DeviceValueType::STRING, FL_(tpl_holidays), FL_(wwHolidays), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwHoliday));
register_device_value(tag, &dhw->wwVacation_, DeviceValueType::STRING, FL_(tpl_holidays), FL_(wwVacations), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwVacation));
// register_device_value(tag, &dhw->wwHoliday_, DeviceValueType::STRING, FL_(tpl_holidays), FL_(wwHolidays), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwHoliday));
// register_device_value(tag, &dhw->wwVacation_, DeviceValueType::STRING, FL_(tpl_holidays), FL_(wwVacations), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwVacation));
break;
case EMSdevice::EMS_DEVICE_FLAG_RC30_N:
register_device_value(tag, &dhw->wwMode_, DeviceValueType::ENUM, FL_(enum_wwMode2), FL_(wwMode), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwmode));

View File

@@ -224,7 +224,7 @@ class Thermostat : public EMSdevice {
}
inline uint8_t id2dhw(const int8_t id) const {
return id - DeviceValueTAG::TAG_DHW1 + DeviceValueTAG::TAG_HC1 - 1;
return id - DeviceValueTAG::TAG_DHW1;
}
// each thermostat has a list of heating controller type IDs for reading and writing
@@ -271,6 +271,8 @@ class Thermostat : public EMSdevice {
uint8_t humidity_;
uint8_t battery_;
char vacation[8][21]; // RC30 only, only one hc
// HybridHP
uint8_t hybridStrategy_; // co2 = 1, cost = 2, temperature = 3, mix = 4
int8_t switchOverTemp_; // degrees
@@ -583,7 +585,28 @@ class Thermostat : public EMSdevice {
inline bool set_wwHoliday(const char * value, const int8_t id) {
return set_holiday(value, DeviceValueTAG::TAG_DHW1);
}
bool set_RC30Vacation(const char * value, const int8_t id);
inline bool set_RC30Vacation1(const char * value, const int8_t id) {
return set_RC30Vacation(value, 1);
}
inline bool set_RC30Vacation2(const char * value, const int8_t id) {
return set_RC30Vacation(value, 2);
}
inline bool set_RC30Vacation3(const char * value, const int8_t id) {
return set_RC30Vacation(value, 3);
}
inline bool set_RC30Vacation4(const char * value, const int8_t id) {
return set_RC30Vacation(value, 4);
}
inline bool set_RC30Vacation5(const char * value, const int8_t id) {
return set_RC30Vacation(value, 5);
}
inline bool set_RC30Vacation6(const char * value, const int8_t id) {
return set_RC30Vacation(value, 6);
}
inline bool set_RC30Vacation7(const char * value, const int8_t id) {
return set_RC30Vacation(value, 7);
}
bool set_datetime(const char * value, const int8_t id);
bool set_minexttemp(const char * value, const int8_t id);
bool set_clockoffset(const char * value, const int8_t id);

View File

@@ -26,9 +26,9 @@ uuid::log::Logger Water::logger_{F_(water), uuid::log::Facility::CONSOLE};
Water::Water(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
uint8_t tag = DeviceValueTAG::TAG_DHW1 + device_id - EMSdevice::EMS_DEVICE_ID_DHW1;
dhw_ = device_id - EMSdevice::EMS_DEVICE_ID_DHW1;
int8_t tag = DeviceValueTAG::TAG_DHW1 + dhw_;
if (device_id == 0x2A) { // SM100, DHW3
dhw_ = 2;
// telegram handlers
register_telegram_type(0x07D6, "SM100wwTemperature", false, MAKE_PF_CB(process_SM100wwTemperature));
register_telegram_type(0x07AA, "SM100wwStatus", false, MAKE_PF_CB(process_SM100wwStatus));
@@ -64,7 +64,6 @@ Water::Water(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
register_device_value(tag, &errorDisp_, DeviceValueType::ENUM, FL_(enum_errorDisp), FL_(errorDisp), DeviceValueUOM::NONE, MAKE_CF_CB(set_errorDisp));
} else if (device_id >= EMSdevice::EMS_DEVICE_ID_DHW1 && device_id <= EMSdevice::EMS_DEVICE_ID_DHW2) {
dhw_ = device_id - EMSdevice::EMS_DEVICE_ID_DHW1;
register_telegram_type(0x331 + dhw_, "MMPLUSStatusMessage_WWC", false, MAKE_PF_CB(process_MMPLUSStatusMessage_WWC));
register_telegram_type(0x313 + dhw_, "MMPLUSConfigMessage_WWC", true, MAKE_PF_CB(process_MMPLUSConfigMessage_WWC));
// register_telegram_type(0x33B + type_offset, "MMPLUSSetMessage_WWC", true, MAKE_PF_CB(process_MMPLUSSetMessage_WWC));
@@ -375,26 +374,24 @@ bool Water::set_wwKeepWarm(const char * value, const int8_t id) {
}
bool Water::set_wwDiffTemp(const char * value, const int8_t id) {
uint8_t dhw = device_id() - 0x28;
float v;
float v;
if (!Helpers::value2temperature(value, v)) {
return false;
}
if (flags() == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) {
write_command(0x313 + dhw, 7, (int8_t)(v * 10), 0x313 + dhw);
write_command(0x313 + dhw_, 7, (int8_t)(v * 10), 0x313 + dhw_);
return true;
}
return false;
}
bool Water::set_wwRequiredTemp(const char * value, const int8_t id) {
uint8_t dhw = device_id() - 0x28;
float v;
float v;
if (!Helpers::value2temperature(value, v)) {
return false;
}
if (flags() == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) {
write_command(0x313 + dhw, 4, (uint8_t)v, 0x313 + dhw);
write_command(0x313 + dhw_, 4, (uint8_t)v, 0x313 + dhw_);
return true;
}
return false;