mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
Merge pull request #2246 from MichaelDvP/dev
fix modbus #2245 and reorder #2220
This commit is contained in:
@@ -137,7 +137,7 @@
|
||||
// Mixer Modules - 0x20-0x27 for HC, 0x28-0x29 for WWC and 0x11 for the MP100
|
||||
{ 69, DeviceType::MIXER, "MM10", DeviceFlags::EMS_DEVICE_FLAG_MM10},
|
||||
{100, DeviceType::MIXER, "IPM", DeviceFlags::EMS_DEVICE_FLAG_IPM},
|
||||
{102, DeviceType::MIXER, "IPM", DeviceFlags::EMS_DEVICE_FLAG_IPM},
|
||||
{102, DeviceType::MIXER, "IPM2", DeviceFlags::EMS_DEVICE_FLAG_IPM},
|
||||
{159, DeviceType::MIXER, "MM50", DeviceFlags::EMS_DEVICE_FLAG_MMPLUS},
|
||||
{160, DeviceType::MIXER, "MM100", DeviceFlags::EMS_DEVICE_FLAG_MMPLUS},
|
||||
{161, DeviceType::MIXER, "MM200", DeviceFlags::EMS_DEVICE_FLAG_MMPLUS},
|
||||
@@ -190,7 +190,7 @@
|
||||
#if defined(EMSESP_STANDALONE)
|
||||
,
|
||||
{100, DeviceType::WATER, "IPM", DeviceFlags::EMS_DEVICE_FLAG_IPM},
|
||||
{102, DeviceType::WATER, "IPM", DeviceFlags::EMS_DEVICE_FLAG_IPM},
|
||||
{102, DeviceType::WATER, "IPM2", DeviceFlags::EMS_DEVICE_FLAG_IPM},
|
||||
{160, DeviceType::WATER, "MM100", DeviceFlags::EMS_DEVICE_FLAG_MMPLUS},
|
||||
{161, DeviceType::WATER, "MM200", DeviceFlags::EMS_DEVICE_FLAG_MMPLUS},
|
||||
{163, DeviceType::WATER, "SM100, MS100", DeviceFlags::EMS_DEVICE_FLAG_SM100},
|
||||
|
||||
@@ -276,8 +276,8 @@ void Heatpump::process_HpMeters(std::shared_ptr<const Telegram> telegram) {
|
||||
|
||||
// Broadcast (0x099A), data: 05 00 00 00 00 00 00 37 00 00 1D 00 00 52 00 00 13 01 00 01 7C
|
||||
void Heatpump::process_HpStarts(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, heatStartsHp_, 14, 3);
|
||||
has_update(telegram, wwStartsHp_, 11, 3);
|
||||
has_update(telegram, heatStartsHp_, 11, 3);
|
||||
has_update(telegram, wwStartsHp_, 14, 3);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -28,7 +28,7 @@ Water::Water(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
|
||||
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
|
||||
dhw_ = device_id - EMSdevice::EMS_DEVICE_ID_DHW1;
|
||||
int8_t tag = DeviceValueTAG::TAG_DHW1 + dhw_;
|
||||
if (device_id == 0x2A) { // SM100, DHW3
|
||||
if (flags == EMSdevice::EMS_DEVICE_FLAG_SM100) { // device_id 0x2A, DHW3
|
||||
// telegram handlers
|
||||
register_telegram_type(0x07D6, "SM100wwTemperature", false, MAKE_PF_CB(process_SM100wwTemperature));
|
||||
register_telegram_type(0x07AA, "SM100wwStatus", false, MAKE_PF_CB(process_SM100wwStatus));
|
||||
@@ -63,7 +63,7 @@ Water::Water(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
|
||||
register_device_value(tag, &wwDeltaTRet_, DeviceValueType::UINT8, FL_(deltaTRet), DeviceValueUOM::K, MAKE_CF_CB(set_wwDeltaTRet));
|
||||
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) {
|
||||
} else if (flags == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) { // dhw1 and dhw 2
|
||||
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));
|
||||
@@ -78,7 +78,7 @@ Water::Water(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
|
||||
register_device_value(tag, &wwRequiredTemp_, DeviceValueType::UINT8, FL_(wwRequiredTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwRequiredTemp));
|
||||
register_device_value(tag, &wwCirc_, DeviceValueType::BOOL, FL_(wwCirc), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwCirc));
|
||||
register_device_value(tag, &wwCircMode_, DeviceValueType::ENUM, FL_(enum_wwCircMode), FL_(wwCircMode), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwCircMode));
|
||||
} else if (device_id == 0x40) { // flags == EMSdevice::EMS_DEVICE_FLAG_IPM, special DHW pos 10
|
||||
} else if (flags == EMSdevice::EMS_DEVICE_FLAG_IPM) {
|
||||
dhw_ = 0;
|
||||
tag = DeviceValueTAG::TAG_DHW1;
|
||||
register_telegram_type(0x34, "UBAMonitorWW", false, MAKE_PF_CB(process_IPMMonitorWW));
|
||||
|
||||
@@ -348,9 +348,9 @@ void EMSESP::dump_all_entities(uuid::console::Shell & shell) {
|
||||
if (device.flags == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) {
|
||||
device_id = 0x28; // dhw 1/2
|
||||
} else if (device.flags == EMSdevice::EMS_DEVICE_FLAG_SM100) {
|
||||
device_id = 0x2A; // dhw 3
|
||||
device_id = 0x28; // fix to dhw1, normally SM100 can only use dhw 3
|
||||
} else if (device.flags == EMSdevice::EMS_DEVICE_FLAG_IPM) {
|
||||
device_id = 0x40; // dhw 1
|
||||
device_id = 0x40; // dhw 1, not needed
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,9 +392,9 @@ void EMSESP::dump_all_telegrams(uuid::console::Shell & shell) {
|
||||
if (device.flags == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) {
|
||||
device_id = 0x28; // dhw 1/2
|
||||
} else if (device.flags == EMSdevice::EMS_DEVICE_FLAG_SM100) {
|
||||
device_id = 0x2A; // dhw 3
|
||||
device_id = 0x2A; // dhw 3 needed to calculate right telegram numbers
|
||||
} else if (device.flags == EMSdevice::EMS_DEVICE_FLAG_IPM) {
|
||||
device_id = 0x40; // dhw 1
|
||||
device_id = 0x40; // dhw 1, not needed
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1474,13 +1474,9 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) {
|
||||
txservice_.reset_retry_count();
|
||||
tx_successful = true; // no retries
|
||||
} else {
|
||||
txservice_.send_poll(); // close the bus
|
||||
LOG_ERROR("Last Tx write host reply: 0x%02X", first_value);
|
||||
}
|
||||
} else if (tx_state == Telegram::Operation::TX_READ && length == 1) {
|
||||
EMSbus::tx_state(Telegram::Operation::TX_READ); // reset Tx wait state
|
||||
return;
|
||||
} else if (tx_state == Telegram::Operation::TX_READ) {
|
||||
} else if (tx_state == Telegram::Operation::TX_READ && length > 1) {
|
||||
// got a telegram with data in it. See if the src/dest matches that from the last one we sent and continue to process it
|
||||
uint8_t src = data[0];
|
||||
uint8_t dest = data[1];
|
||||
|
||||
@@ -545,28 +545,6 @@ const std::initializer_list<Modbus::EntityModbusInfo> Modbus::modbus_register_ma
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwDiffTemp), 13, 1), // difftemp
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwRedTemp), 14, 1), // redtemp
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwRequiredTemp), 15, 1), // requiredtemp
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwTemp), 0, 1), // temp
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwStorageTemp1), 1, 1), // storagetemp1
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwColdTemp), 2, 1), // coldtemp
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwTemp5), 3, 1), // temp5
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(retTemp), 4, 1), // rettemp
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwPump), 5, 1), // pump
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwMaxTemp), 6, 1), // maxtemp
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(selRoomTemp), 7, 1), // seltemp
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwRedTemp), 8, 1), // redtemp
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwHotTemp), 9, 1), // hottemp
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwDailyTemp), 10, 1), // dailytemp
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwDisinfectionTemp), 11, 1), // disinfectiontemp
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwCirc), 12, 1), // circ
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwCircMode), 13, 1), // circmode
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwCircTc), 14, 1), // circtc
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwKeepWarm), 15, 1), // keepwarm
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwStatus2), 16, 1), // status2
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwPumpMod), 17, 1), // pumpmod
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwFlow), 18, 1), // flow
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(valveReturn), 19, 1), // valvereturn
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(deltaTRet), 20, 1), // deltatret
|
||||
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(errorDisp), 21, 1), // errordisp
|
||||
};
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
Reference in New Issue
Block a user