mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
@@ -30,15 +30,32 @@ Heatpump::Heatpump(uint8_t device_type, uint8_t device_id, uint8_t product_id, c
|
||||
|
||||
register_telegram_type(0x998, "HPSettings", true, MAKE_PF_CB(process_HPSettings));
|
||||
register_telegram_type(0x999, "HPFunctionTest", true, MAKE_PF_CB(process_HPFunctionTest));
|
||||
register_telegram_type(0x9A0, "HPTemperature", false, MAKE_PF_CB(process_HPTemperature));
|
||||
register_telegram_type(0x99B, "HPFlowTemp", false, MAKE_PF_CB(process_HPFlowTemp));
|
||||
|
||||
// device values
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &airHumidity_, DeviceValueType::UINT, FL_(airHumidity), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &dewTemperature_, DeviceValueType::UINT, FL_(dewTemperature), DeviceValueUOM::DEGREES);
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &flowTemp_, DeviceValueType::UINT, FL_(curFlowTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &retTemp_, DeviceValueType::UINT, FL_(retTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &sysRetTemp_, DeviceValueType::UINT, FL_(sysRetTemp), DeviceValueUOM::DEGREES);
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpTa4_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpTa4), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpTr1_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpTr1), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpTr3_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpTr3), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpTr3_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpTr3), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpTr4_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpTr4), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpTr5_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpTr5), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpTr6_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpTr6), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpTl2_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpTl2), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpJr0_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpPl1), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpJr1_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpPh1), DeviceValueUOM::DEGREES);
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&controlStrategy_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_hybridStrategy),
|
||||
FL_(enum_hybridStrategy1),
|
||||
FL_(hybridStrategy),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_controlStrategy));
|
||||
@@ -138,6 +155,31 @@ void Heatpump::process_HPMonitor1(std::shared_ptr<const Telegram> telegram) {
|
||||
// still to implement
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
// 0x09A0
|
||||
// Heatpump(0x53) -> All(0x00), ?(0x09A0), data: 02 23 01 3E 01 39 00 5D 01 DE 01 38 00 40 00 5E 00 58 00 3F 01 34 00 02
|
||||
void Heatpump::process_HPTemperature(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, hpTc3_, 2); // condenser temp.
|
||||
has_update(telegram, hpTr1_, 8); // compressor temp.
|
||||
has_update(telegram, hpTr3_, 10); // cond. temp. heating
|
||||
has_update(telegram, hpTr4_, 12); // cond. temp. clg
|
||||
has_update(telegram, hpTr5_, 14); // suction line temp.
|
||||
has_update(telegram, hpTr6_, 0); // hot gas temp.
|
||||
has_update(telegram, hpTl2_, 6); // inlet air temperature
|
||||
has_update(telegram, hpTa4_, 16); // drain pan temp.
|
||||
has_update(telegram, hpJr0_, 18); // low pressure sensor
|
||||
has_update(telegram, hpJr1_, 20); // high pressure sensor
|
||||
}
|
||||
|
||||
// 0x099B
|
||||
// Heatpump(0x53) -> All(0x00), ?(0x099B), data: 80 00 80 00 01 3C 01 38 80 00 80 00 80 00 01 37 00 00 00 00 64
|
||||
void Heatpump::process_HPFlowTemp(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, flowTemp_, 4);
|
||||
has_update(telegram, retTemp_, 6);
|
||||
has_update(telegram, sysRetTemp_, 14);
|
||||
}
|
||||
|
||||
// 0x0998 HPSettings
|
||||
// [emsesp] Heatpump(0x53) -> Me(0x0B), ?(0x0998), data: 00 00 0B 00 00 1F 01 00 01 01 16 06 00 04 02 FF 00 01 7C 01
|
||||
void Heatpump::process_HPSettings(std::shared_ptr<const Telegram> telegram) {
|
||||
@@ -185,7 +227,6 @@ void Heatpump::process_HPFunctionTest(std::shared_ptr<const Telegram> telegram)
|
||||
* Broadcast (0x04AA), data: 00 00
|
||||
|
||||
*/
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
bool Heatpump::set_controlStrategy(const char * value, const int8_t id) {
|
||||
uint8_t v;
|
||||
|
||||
@@ -50,11 +50,27 @@ class Heatpump : public EMSdevice {
|
||||
uint8_t heatDrainPan_;
|
||||
uint8_t heatCable_;
|
||||
|
||||
// HM200 temperature
|
||||
int16_t flowTemp_;
|
||||
int16_t retTemp_;
|
||||
int16_t sysRetTemp_;
|
||||
int16_t hpTc3_; // condenser temp.
|
||||
int16_t hpTr1_; // compressor temp.
|
||||
int16_t hpTr3_; // cond. temp. heating
|
||||
int16_t hpTr4_; // cond. temp. clg
|
||||
int16_t hpTr5_; // suction line temp.
|
||||
int16_t hpTr6_; // hot gas temp.
|
||||
int16_t hpTl2_; // inlet air temperature
|
||||
int16_t hpTa4_; // drain pan temp.
|
||||
int16_t hpJr0_; // low pressure sensor
|
||||
int16_t hpJr1_; // high pressure sensor
|
||||
|
||||
void process_HPMonitor1(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HPMonitor2(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HPSettings(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HPFunctionTest(std::shared_ptr<const Telegram> telegram);
|
||||
|
||||
void process_HPTemperature(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HPFlowTemp(std::shared_ptr<const Telegram> telegram);
|
||||
bool set_controlStrategy(const char * value, const int8_t id);
|
||||
bool set_lowNoiseMode(const char * value, const int8_t id);
|
||||
bool set_lowNoiseStart(const char * value, const int8_t id);
|
||||
|
||||
@@ -43,8 +43,8 @@ bool EMSdevice::has_entities() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string EMSdevice::tag_to_string(uint8_t tag) {
|
||||
return (Helpers::translated_word(DeviceValue::DeviceValueTAG_s[tag]));
|
||||
std::string EMSdevice::tag_to_string(uint8_t tag, const bool translate) {
|
||||
return (translate ? Helpers::translated_word(DeviceValue::DeviceValueTAG_s[tag]) : DeviceValue::DeviceValueTAG_s[tag][0]);
|
||||
}
|
||||
|
||||
std::string EMSdevice::tag_to_mqtt(uint8_t tag) {
|
||||
|
||||
@@ -49,7 +49,7 @@ class EMSdevice {
|
||||
static const char * device_type_2_device_name(const uint8_t device_type);
|
||||
static uint8_t device_name_2_device_type(const char * topic);
|
||||
static std::string uom_to_string(uint8_t uom);
|
||||
static std::string tag_to_string(uint8_t tag);
|
||||
static std::string tag_to_string(uint8_t tag, const bool translate = true);
|
||||
static std::string tag_to_mqtt(uint8_t tag);
|
||||
|
||||
bool has_tag(const uint8_t tag) const;
|
||||
|
||||
@@ -343,8 +343,8 @@ MAKE_PSTR_LIST(hpPower, "hppower", "compressor power output", "Kompressorleistun
|
||||
MAKE_PSTR_LIST(hpTc0, "hptc0", "heat carrier return (TC0)", "Kältemittel Rücklauf (TC0)", "Koudemiddel retour (TC0)", "Värmebärare Retur (TC0)", "temperatura nośnika ciepła na powrocie (TC0)", "kjølemiddel retur (TC0)")
|
||||
MAKE_PSTR_LIST(hpTc1, "hptc1", "heat carrier forward (TC1)", "Kältemittel Vorlauf (TC1)", "Koudemiddel aanvoer (TC1)", "Värmebärare Framledning (TC1)", "temperatura nośnika ciepła pierwotna (TC1)", "kjølemiddel tur (TC1)")
|
||||
MAKE_PSTR_LIST(hpTc3, "hptc3", "condenser temperature (TC3)", "Verflüssigertemperatur (TC3)", "Condensortemperatuur (TC3)", "Kondensortemperatur (TC3)", "temperatura skraplacza/na wyjściu sprężarki (TC3)", "kondensortemperatur (TC3)")
|
||||
MAKE_PSTR_LIST(hpTr1, "hptr1", "compressor temperature (TR1)", "Kompessortemperatur (TR1)", "Compressor temperatuur (TR1)", "Kompressor temp (TR1)", "kompressor temp (TR1)")
|
||||
MAKE_PSTR_LIST(hpTr3, "hptr3", "refrigerant temperature liquid side (condenser output) (TR3)", "Kältemittel (flüssig) (TR3)", "Temperatuur koudemiddel vloeibare zijde (TR3)", "Köldmedium temperatur (kondensorutlopp) (TR3)", "temperatura skraplacza ogrzew. (TR3)", "kjølemiddeltemperatur på væskesiden (TR3)")
|
||||
|
||||
MAKE_PSTR_LIST(hpTr4, "hptr4", "evaporator inlet temperature (TR4)", "Verdampfer Eingang (TR4)", "Verdamper ingangstemperatuur (TR4)", "Förångare inloppstemp (TR4)", "innløpstemperatur for fordamperen (TR4)")
|
||||
MAKE_PSTR_LIST(hpTr5, "hptr5", "compressor inlet temperature (TR5)", "Kompessoreingang (TR5)", "Compressor ingangstemperatuur (TR5)", "Kompressor inloppstemp (TR5)", "kompressor innløpstemp (TR5)")
|
||||
MAKE_PSTR_LIST(hpTr6, "hptr6", "compressor outlet temperature (TR6)", "Kompressorausgang (TR6)", "Compressor uitgangstemperatuur (TR6)", "Kompressor utloppstemp (TR6)", "kompressor utløpstemp (TR6)")
|
||||
@@ -352,6 +352,7 @@ MAKE_PSTR_LIST(hpTr7, "hptr7", "refrigerant temperature gas side (condenser inpu
|
||||
MAKE_PSTR_LIST(hpTl2, "hptl2", "air inlet temperature (TL2)", "Außenluft-Einlasstemperatur (TL2)", "Temperatuur luchtinlaat (TL2)", "Luftintagstemperatur (TL2)", "temperatura wlotu powietrza (TL2)", "luftinntakstemperatur (TL2)")
|
||||
MAKE_PSTR_LIST(hpPl1, "hppl1", "low pressure side temperature (PL1)", "Niederdruckfühler (PL1)", "Temperatuur lage drukzijde (PL1)", "Temperatur Lågtryckssidan (PL1)", "temperatura po stronie niskiego ciśnienia (PL1)", "temperatur lavtrykksiden (PL1)")
|
||||
MAKE_PSTR_LIST(hpPh1, "hpph1", "high pressure side temperature (PH1)", "Hochdruckfühler (PH1)", "Temperatuur hoge drukzijde (PH1)", "Temperatur Högtryckssidan (PH1)", "temperatura po stronie wysokiego ciśnienia (PH1)", "Temperatur Høytrykksiden (PH1)")
|
||||
MAKE_PSTR_LIST(hpTa4, "hpta4", "drain pan temp (TA4)", "Kondensatorwanne (TA4)")
|
||||
|
||||
MAKE_PSTR_LIST(hpInput1, "hpin1", "input 1 state", "Eingang 1 Status", "Status input 1", "Status Ingång 1", "stan wejścia 1", "status Inggng 1")
|
||||
MAKE_PSTR_LIST(hpInput2, "hpin2", "input 2 state", "Eingang 2 Status", "Status input 2", "Status Ingång 2", "stan wejścia 2", "status Inggng 2")
|
||||
|
||||
@@ -1091,7 +1091,7 @@ void Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdevice
|
||||
// keep it compatible to v3.4, use english fullname, no prefix (basename prefix commented out)
|
||||
char object_id[130];
|
||||
if (have_tag) {
|
||||
snprintf(object_id, sizeof(object_id), "%s_%s_%s", device_name, EMSdevice::tag_to_mqtt(tag).c_str(), en_name);
|
||||
snprintf(object_id, sizeof(object_id), "%s_%s_%s", device_name, EMSdevice::tag_to_string(tag, false).c_str(), en_name);
|
||||
} else {
|
||||
snprintf(object_id, sizeof(object_id), "%s_%s", device_name, en_name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user