boiler HP-inputConfig, HeaterConfig, thermostat roomsensor

This commit is contained in:
MichaelDvP
2022-09-28 16:07:38 +02:00
parent d50606ce13
commit 732aaffbb6
6 changed files with 221 additions and 3 deletions

View File

@@ -178,6 +178,9 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
register_telegram_type(0x48D, F("HpPower"), true, MAKE_PF_CB(process_HpPower));
register_telegram_type(0x48F, F("HpOutdoor"), false, MAKE_PF_CB(process_HpOutdoor));
register_telegram_type(0x48A, F("HpPool"), true, MAKE_PF_CB(process_HpPool));
register_telegram_type(0x4A2, F("HpInput"), false, MAKE_PF_CB(process_HpInput));
register_telegram_type(0x486, F("HpInConfig"), false, MAKE_PF_CB(process_HpInConfig));
register_telegram_type(0x492, F("HpHeaterConfig"), false, MAKE_PF_CB(process_HpHeaterConfig));
}
/*
@@ -497,6 +500,59 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
FL_(poolSetTemp),
DeviceValueUOM::DEGREES,
MAKE_CF_CB(set_pool_temp));
// register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[0].state, DeviceValueType::BOOL, FL_(hpInput1), DeviceValueUOM::NONE);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&hpInput[0].option,
DeviceValueType::STRING,
FL_(tpl_input),
FL_(hpIn1Opt),
DeviceValueUOM::NONE,
MAKE_CF_CB(set_HpIn1Logic));
// register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[1].state, DeviceValueType::BOOL, FL_(hpInput2), DeviceValueUOM::NONE);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&hpInput[1].option,
DeviceValueType::STRING,
FL_(tpl_input),
FL_(hpIn2Opt),
DeviceValueUOM::NONE,
MAKE_CF_CB(set_HpIn2Logic));
// register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[2].state, DeviceValueType::BOOL, FL_(hpInput3), DeviceValueUOM::NONE);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&hpInput[2].option,
DeviceValueType::STRING,
FL_(tpl_input),
FL_(hpIn3Opt),
DeviceValueUOM::NONE,
MAKE_CF_CB(set_HpIn3Logic));
// register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[3].state, DeviceValueType::BOOL, FL_(hpInput4), DeviceValueUOM::NONE);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&hpInput[3].option,
DeviceValueType::STRING,
FL_(tpl_input4),
FL_(hpIn4Opt),
DeviceValueUOM::NONE,
MAKE_CF_CB(set_HpIn4Logic));
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&maxHeatComp_,
DeviceValueType::ENUM,
FL_(enum_maxHeat),
FL_(maxHeatComp),
DeviceValueUOM::NONE,
MAKE_CF_CB(set_maxHeatComp));
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&maxHeatHeat_,
DeviceValueType::ENUM,
FL_(enum_maxHeat),
FL_(maxHeatHeat),
DeviceValueUOM::NONE,
MAKE_CF_CB(set_maxHeatHeat));
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&maxHeatDhw_,
DeviceValueType::ENUM,
FL_(enum_maxHeat),
FL_(maxHeatDhw),
DeviceValueUOM::NONE,
MAKE_CF_CB(set_maxHeatDhw));
}
// dhw - DEVICE_DATA_ww topic
@@ -1093,6 +1149,44 @@ void Boiler::process_HpPool(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, poolSetTemp_, 1);
}
// Heatpump inputs - type 0x4A2
// Boiler(0x08) -> All(0x00), ?(0x04A2), data: 02 01 01 00 01 00
void Boiler::process_HpInput(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, hpInput[0].state, 2);
has_update(telegram, hpInput[1].state, 3);
has_update(telegram, hpInput[2].state, 4);
has_update(telegram, hpInput[3].state, 5);
}
// Heatpump inputs settings- type 0x486
// Boiler(0x08) -> All(0x00), ?(0x0486), data: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
// Boiler(0x08) -> All(0x00), ?(0x0486), data: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 01 00 00 00 00 00 (offset 25)
// Boiler(0x08) -> All(0x00), ?(0x0486), data: 00 00 (offset 51)
void Boiler::process_HpInConfig(std::shared_ptr<const Telegram> telegram) {
char option[12];
for (uint8_t i = 0; i < 2; i++) {
for (uint8_t j = 0; j < 11; j++) {
option[j] = hpInput[i].option[j] - '0';
telegram->read_value(option[j], j * 4 + i);
option[j] = option[j] ? '1' : '0';
}
option[11] = '\0'; // terminate string
has_update(hpInput[i].option, option, 12);
}
for (uint8_t j = 0; j < 9; j++) {
option[j] = hpInput[3].option[j] - '0';
telegram->read_value(option[j], 42 + j);
option[j] = option[j] ? '1' : '0';
}
option[9] = '\0'; // terminate string
has_update(hpInput[3].option, option, 12);
}
void Boiler::process_HpHeaterConfig(std::shared_ptr<const Telegram> telegram) {
has_update(maxHeatComp_, 2);
has_update(maxHeatHeat_, 3);
has_update(maxHeatDhw_, 4);
}
// 0x2A - MC110Status
// e.g. 88 00 2A 00 00 00 00 00 00 00 00 00 D2 00 00 80 00 00 01 08 80 00 02 47 00
@@ -1335,6 +1429,9 @@ void Boiler::process_amCommandMessage(std::shared_ptr<const Telegram> telegram)
// pos 6: boiler blocking 0-off, 1-on
}
// 0x0550 AM200 broadcasted message, all 27 bytes unkown
// Rx: 60 00 FF 00 04 50 00 FF 00 FF FF 00 0D 00 01 00 00 00 00 01 03 01 00 03 00 2D 19 C8 02 94 00 4A
// Rx: 60 00 FF 19 04 50 00 FF FF 39
void Boiler::process_amExtraMessage(std::shared_ptr<const Telegram> telegram) {
}
@@ -2241,4 +2338,48 @@ bool Boiler::set_emergency_ops(const char * value, const int8_t id) {
return true;
}
bool Boiler::set_HpInLogic(const char * value, const int8_t id) {
if (id == 0 || id > 4) {
return false;
}
bool v;
if (Helpers::value2bool(value, v)) {
write_command(0x486, id == 4 ? 42 : id, v ? 1 : 0, 0x486);
return true;
}
if (strlen(value) == 11 && id != 4) {
uint8_t v[11];
for (uint8_t i = 0; i < 11; i++) {
v[i] = value[i] - '0';
if (v[i] > 1) {
return false;
}
write_command(0x486, i * 3 + id - 1, v[i]);
}
return true;
}
// input 4
if (strlen(value) == 8 && id == 4) {
uint8_t v[11];
for (uint8_t i = 0; i < 8; i++) {
v[i] = value[i] - '0';
if (v[i] > 1) {
return false;
}
write_command(0x486, 42 + i, v[i]);
}
return true;
}
return false;
}
bool Boiler::set_maxHeat(const char * value, const int8_t id) {
uint8_t v;
if (!Helpers::value2enum(value, v, FL_(enum_maxHeat))) {
return false;
}
write_command(0x492, id, v, 0x492);
return true;
}
} // namespace emsesp