add uom K, heatpump difftemp #803

This commit is contained in:
MichaelDvP
2022-12-19 09:14:24 +01:00
parent ce0ee49ebf
commit 502613b433
10 changed files with 327 additions and 251 deletions

View File

@@ -184,6 +184,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
register_telegram_type(0x488, "HPValve", true, MAKE_PF_CB(process_HpValve));
register_telegram_type(0x484, "HPSilentMode", true, MAKE_PF_CB(process_HpSilentMode));
register_telegram_type(0x48B, "HPPumps", true, MAKE_PF_CB(process_HpPumps));
register_telegram_type(0x491, "HPAdditionalHeater", true, MAKE_PF_CB(process_HpAdditionalHeater));
}
@@ -624,6 +625,24 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
DeviceValueUOM::DEGREES,
MAKE_CF_CB(set_tempParMode));
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &auxHeatMixValve_, DeviceValueType::INT, FL_(auxHeatMixValve), DeviceValueUOM::PERCENT);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&tempDiffHeat_,
DeviceValueType::UINT,
DeviceValueNumOp::DV_NUMOP_DIV10,
FL_(tempDiffHeat),
DeviceValueUOM::K,
MAKE_CF_CB(set_tempDiffHeat),
3,
10);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&tempDiffCool_,
DeviceValueType::UINT,
DeviceValueNumOp::DV_NUMOP_DIV10,
FL_(tempDiffCool),
DeviceValueUOM::K,
MAKE_CF_CB(set_tempDiffCool),
3,
10);
}
// dhw - DEVICE_DATA_ww topic
@@ -1535,6 +1554,12 @@ void Boiler::process_HpValve(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, auxHeatMixValve_, 7);
}
// Boiler(0x08) -B-> All(0x00), ?(0x048B), data: 00 00 0A 1E 4E 00 1E 01 2C 00 01 64 55 05 12 50 50 50 00 00 1E 01 2C 00
// Boiler(0x08) -B-> All(0x00), ?(0x048B), data: 00 1E 00 96 00 1E (offset 24)
void Boiler::process_HpPumps(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, tempDiffHeat_, 4); // is * 10
// has_update(telegram, tempDiffCool_, 3); // is * 10
}
// Boiler(0x08) -> All(0x00), ?(0x0491), data: 03 01 00 00 00 02 64 00 00 14 01 2C 00 0A 00 1E 00 1E 00 00 1E 0A 1E 05 05
void Boiler::process_HpAdditionalHeater(std::shared_ptr<const Telegram> telegram) {
@@ -2524,7 +2549,7 @@ bool Boiler::set_tempParMode(const char * value, const int8_t id) {
bool Boiler::set_additionalHeaterDelay(const char * value, const int8_t id) {
int v;
if (Helpers::value2number(value, v)) {
v /= 5;
v /= 10;
uint8_t data[2] = {(uint8_t)(v >> 8), (uint8_t)v};
write_command(0x491, 16, data, 2, 0x491);
return true;
@@ -2535,11 +2560,21 @@ bool Boiler::set_additionalHeaterDelay(const char * value, const int8_t id) {
bool Boiler::set_hpHyst(const char * value, const int8_t id) {
int v;
if (Helpers::value2number(value, v)) {
v /= 10;
v /= 5;
uint8_t data[2] = {(uint8_t)(v >> 8), (uint8_t)v};
write_command(0x484, id, data, 2, 0x484);
return true;
}
return false;
}
bool Boiler::set_tempDiff(const char * value, const int8_t id) {
float v;
if (Helpers::value2float(value, v)) {
write_command(0x48B, id, (uint8_t)(v * 10), 0x48B);
return true;
}
return false;
}
} // namespace emsesp

View File

@@ -252,6 +252,8 @@ class Boiler : public EMSdevice {
uint16_t hpHystHeat_;
uint16_t hpHystCool_;
uint16_t hpHystPool_;
uint8_t tempDiffHeat_;
uint8_t tempDiffCool_;
/*
// Hybrid heatpump with telegram 0xBB is readable and writeable in boiler and thermostat
@@ -307,6 +309,7 @@ class Boiler : public EMSdevice {
void process_HpSilentMode(std::shared_ptr<const Telegram> telegram);
void process_HpAdditionalHeater(std::shared_ptr<const Telegram> telegram);
void process_HpValve(std::shared_ptr<const Telegram> telegram);
void process_HpPumps(std::shared_ptr<const Telegram> telegram);
// commands - none of these use the additional id parameter
bool set_ww_mode(const char * value, const int8_t id);
@@ -408,6 +411,13 @@ class Boiler : public EMSdevice {
inline bool set_hpHystPool(const char * value, const int8_t id) {
return set_hpHyst(value, 33);
}
bool set_tempDiff(const char * value, const int8_t id);
inline bool set_tempDiffHeat(const char * value, const int8_t id) {
return set_tempDiff(value, 4);
}
inline bool set_tempDiffCool(const char * value, const int8_t id) {
return set_tempDiff(value, 3);
}
/*
bool set_hybridStrategy(const char * value, const int8_t id);

View File

@@ -105,9 +105,9 @@ DeviceValue::DeviceValue(uint8_t device_type,
// must be an int of 4 bytes, 32bit aligned
const char * DeviceValue::DeviceValueUOM_s[] = {
F_(uom_blank), F_(uom_degrees), F_(uom_degrees), F_(uom_percent), F_(uom_lmin), F_(uom_kwh), F_(uom_wh), FL_(hours)[0],
FL_(minutes)[0], F_(uom_ua), F_(uom_bar), F_(uom_kw), F_(uom_w), F_(uom_kb), FL_(seconds)[0], F_(uom_dbm),
F_(uom_fahrenheit), F_(uom_mv), F_(uom_sqm), F_(uom_m3), F_(uom_l), F_(uom_kmin), F_(uom_blank) // connectivity
F_(uom_blank), F_(uom_degrees), F_(uom_degrees), F_(uom_percent), F_(uom_lmin), F_(uom_kwh), F_(uom_wh), FL_(hours)[0], FL_(minutes)[0],
F_(uom_ua), F_(uom_bar), F_(uom_kw), F_(uom_w), F_(uom_kb), FL_(seconds)[0], F_(uom_dbm), F_(uom_fahrenheit), F_(uom_mv),
F_(uom_sqm), F_(uom_m3), F_(uom_l), F_(uom_kmin), F_(uom_k), F_(uom_blank)
};

View File

@@ -49,27 +49,28 @@ class DeviceValue {
enum DeviceValueUOM : uint8_t {
NONE = 0, // 0
DEGREES, // 1
DEGREES_R, // 2
DEGREES_R, // 2 - relative temperature
PERCENT, // 3
LMIN, // 4
KWH, // 5
WH, // 6
LMIN, // 4 - l/min
KWH, // 5 - kWh
WH, // 6 - Wh
HOURS, // 7
MINUTES, // 8
UA, // 9
UA, // 9 - µA
BAR, // 10
KW, // 11
KW, // 11 - kW
W, // 12
KB, // 13
SECONDS, // 14
DBM, // 15
DBM, // 15 - dBm
FAHRENHEIT, // 16
MV, // 17
SQM, // 18 square meter
M3, // 19 cubic meter
L, // 20
MV, // 17 - mV
SQM, // 18 - square meter
M3, // 19 - cubic meter
L, // 20 - liter
KMIN, // 21 - Kelvin * minutes
CONNECTIVITY // 22 - used in HA
K, // 22 - Kelvin
CONNECTIVITY // 23 - used in HA
};
// TAG mapping - maps to DeviceValueTAG_s in emsdevice.cpp

View File

@@ -216,6 +216,7 @@ MAKE_PSTR(uom_sqm, "m²")
MAKE_PSTR(uom_m3, "")
MAKE_PSTR(uom_l, "l")
MAKE_PSTR(uom_kmin, "K*min")
MAKE_PSTR(uom_k, "K")
// MQTT topics and prefixes
MAKE_PSTR(heating_active, "heating_active")

View File

@@ -376,9 +376,11 @@ MAKE_PSTR_LIST(auxHeaterDelay, "auxheaterdelay", "auxilliary heater on delay", "
MAKE_PSTR_LIST(minTempSilent, "mintempsilent", "min. outside temp. for silent mode", "Minimale Aussentemperatur Silentmodus", " Stiller gebruik min. buitentemp", "", "", "", "Fct silencieux: Temp. extérieure min.")
MAKE_PSTR_LIST(tempParMode, "tempparmode", "outside temp. parallel mode", "Aussentemperatur Parallelmodus", "Buitentemp. parallelbedr", "", "", "", "Temp. ext. fct parallèle")
MAKE_PSTR_LIST(auxHeatMixValve, "auxheatmix", "aux. heater mixing valve", "Mischer Zusatzheizer", "Bijverwarming menger", "", "", "", "Chauffage auxiliaire mélangeur")
MAKE_PSTR_LIST(hpHystHeat, "hphystheat", "HP on/off hyst heat", "Schalthysterese Heizen", "Aan/uit-hysteresis in verw. bedrijf", "På/av-hystereses Husv.", "Histerez wł/wył Ogrzew.", "På/av-hysterese Oppvar.", "Hystérésis Marche en mode chauffage")
MAKE_PSTR_LIST(hpHystHeat, "hphystheat", "on/off hyst heat", "Schalthysterese Heizen", "Aan/uit-hysteresis in verw. bedrijf", "På/av-hystereses Husv.", "Histerez wł/wył Ogrzew.", "På/av-hysterese Oppvar.", "Hystérésis Marche en mode chauffage")
MAKE_PSTR_LIST(hpHystCool, "hphystcool", "on/off hyst cool", "Schalthysterese Kühlen", "Aan/uit-hysteresis in koelbedrijf ", "", "", "", "Hystérésis Marche en mode refroidissement")
MAKE_PSTR_LIST(hpHystPool, "hphystpool", "on/off hyst pool", "Schalthysterese Pool", "an/uit-hysteresis in zwembadbedri", "", "", "", "Hystérésis Marche en mode piscine")
MAKE_PSTR_LIST(tempDiffHeat, "tempdiffheat", "temp. diff. TC3/TC0 heat", "Temp.diff. TC3/TC0 Heizen", "Temp.vers. TC3/TC0 verw", "", "", "", "Delta T TC3/TC0 Chauff")
MAKE_PSTR_LIST(tempDiffCool, "tempdiffcool", "temp. diff. TC3/TC0 cool", "Temp.diff. TC3/TC0 Kühlen", "Temp.vers. TC3/TC0 koel.", "", "", "", "Delta T TC3/TC0 Refroid.")
// hybrid heatpump
MAKE_PSTR_LIST(hybridStrategy, "hybridstrategy", "hybrid control strategy", "Hybrid Strategie", "Hybride strategie", "Hybrid kontrollstrategi", "strategia sterowania hybrydowego", "hybrid kontrollstrategi", "stratégie contrôle hybride")