RC100H emulation version and telegrams

This commit is contained in:
MichaelDvP
2024-02-08 18:51:45 +01:00
parent 4f406e8d33
commit 119b2b9514
3 changed files with 20 additions and 6 deletions

View File

@@ -715,6 +715,11 @@ void Thermostat::process_RC20Remote(std::shared_ptr<const Telegram> telegram) {
// e.g. "38 10 FF 00 03 2B 00 D1 08 2A 01" // e.g. "38 10 FF 00 03 2B 00 D1 08 2A 01"
void Thermostat::process_RemoteTemp(std::shared_ptr<const Telegram> telegram) { void Thermostat::process_RemoteTemp(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, tempsensor1_, 0); has_update(telegram, tempsensor1_, 0);
uint8_t hc = telegram->type_id - 0x42B;
if (Roomctrl::is_remote(hc)) {
toggle_fetch(0x273 + hc, false);
toggle_fetch(0xA6A + hc, false);
}
} }
// 0x47B, ff - for reading humidity from the RC100H remote thermostat (0x38, 0x39, ..) // 0x47B, ff - for reading humidity from the RC100H remote thermostat (0x38, 0x39, ..)
@@ -1241,6 +1246,7 @@ void Thermostat::process_RC300Floordry(std::shared_ptr<const Telegram> telegram)
} }
// 0x291 ff. HP mode // 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) { void Thermostat::process_HPMode(std::shared_ptr<const Telegram> telegram) {
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram); std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
if (hc == nullptr) { if (hc == nullptr) {
@@ -4639,7 +4645,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode3), FL_(mode), DeviceValueUOM::NONE, MAKE_CF_CB(set_mode)); register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode3), FL_(mode), DeviceValueUOM::NONE, MAKE_CF_CB(set_mode));
register_device_value(tag, &hc->modetype, DeviceValueType::ENUM, FL_(enum_modetype3), FL_(modetype), DeviceValueUOM::NONE); register_device_value(tag, &hc->modetype, DeviceValueType::ENUM, FL_(enum_modetype3), FL_(modetype), DeviceValueUOM::NONE);
register_device_value( register_device_value(
tag, &hc->daytemp, DeviceValueType::UINT, DeviceValueNumOp::DV_NUMOP_DIV2, FL_(daytemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_daytemp), 5, 30); tag, &hc->daytemp, DeviceValueType::UINT, DeviceValueNumOp::DV_NUMOP_DIV2, FL_(daytemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_daytemp), 10, 30);
register_device_value(tag, register_device_value(tag,
&hc->nighttemp, &hc->nighttemp,
DeviceValueType::UINT, DeviceValueType::UINT,
@@ -4647,7 +4653,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
FL_(nighttemp), FL_(nighttemp),
DeviceValueUOM::DEGREES, DeviceValueUOM::DEGREES,
MAKE_CF_CB(set_nighttemp), MAKE_CF_CB(set_nighttemp),
5, 10,
30); 30);
register_device_value(tag, &hc->designtemp, DeviceValueType::UINT, FL_(designtemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_designtemp), 30, 90); register_device_value(tag, &hc->designtemp, DeviceValueType::UINT, FL_(designtemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_designtemp), 30, 90);
register_device_value(tag, register_device_value(tag,

View File

@@ -182,14 +182,19 @@ void Roomctrl::version(uint8_t addr, uint8_t dst) {
data[4] = type_; // set RC20 id 113, Ver 02.01 or Junkers FB10 id 109, Ver 16.05, RC100H id 200 ver 40.04 data[4] = type_; // set RC20 id 113, Ver 02.01 or Junkers FB10 id 109, Ver 16.05, RC100H id 200 ver 40.04
data[5] = type_ == RC20 ? 2 : type_ == FB10 ? 16 : type_ == RC200 ? 41 : 40; data[5] = type_ == RC20 ? 2 : type_ == FB10 ? 16 : type_ == RC200 ? 41 : 40;
data[6] = type_ == RC20 ? 1 : type_ == FB10 ? 5 : type_ == RC200 ? 8 : 4; data[6] = type_ == RC20 ? 1 : type_ == FB10 ? 5 : type_ == RC200 ? 8 : 4;
if (type_ != RC200) { if (type_ == RC20 || type_ == FB10) {
data[7] = EMSbus::calculate_crc(data, 7); // apppend CRC data[7] = EMSbus::calculate_crc(data, 7); // apppend CRC
EMSuart::transmit(data, 8); EMSuart::transmit(data, 8);
return; return;
} }
// RC200 adds some extra bytes
data[7] = 0; data[7] = 0;
data[8] = 0xFF; data[8] = 0xFF;
if (type_ == RC100H) {
data[9] = EMSbus::calculate_crc(data, 9); // apppend CRC
EMSuart::transmit(data, 10);
return;
}
// RC200 adds some extra bytes
data[9] = 0; data[9] = 0;
data[10] = 0; data[10] = 0;
data[11] = 0; data[11] = 0;
@@ -242,7 +247,7 @@ void Roomctrl::temperature(uint8_t addr, uint8_t dst, uint8_t hc) {
data[2] = 0xFF; data[2] = 0xFF;
data[3] = 0; data[3] = 0;
data[4] = 0; data[4] = 0;
data[5] = 0x23; // count with hc? data[5] = 0x23; // fixed for all hc
data[6] = (uint8_t)(remotetemp_[hc] >> 8); data[6] = (uint8_t)(remotetemp_[hc] >> 8);
data[7] = (uint8_t)(remotetemp_[hc] & 0xFF); data[7] = (uint8_t)(remotetemp_[hc] & 0xFF);
data[8] = EMSbus::calculate_crc(data, 8); // apppend CRC data[8] = EMSbus::calculate_crc(data, 8); // apppend CRC

View File

@@ -29,6 +29,9 @@ class Roomctrl {
static void set_remotetemp(const uint8_t type, const uint8_t hc, const int16_t temp); static void set_remotetemp(const uint8_t type, const uint8_t hc, const int16_t temp);
static void set_remotehum(const uint8_t type, const uint8_t hc, const int8_t hum); static void set_remotehum(const uint8_t type, const uint8_t hc, const int8_t hum);
enum : uint8_t { RC20 = 113, FB10 = 109, RC100H = 200, SENSOR = 0x40, RC200 = 157 }; enum : uint8_t { RC20 = 113, FB10 = 109, RC100H = 200, SENSOR = 0x40, RC200 = 157 };
static bool is_remote(const uint8_t hc) {
return (hc < 4 && remotetemp_[hc] != EMS_VALUE_SHORT_NOTSET);
}
private: private:
static constexpr uint8_t ADDR = 0x18; // address for hc1 static constexpr uint8_t ADDR = 0x18; // address for hc1