Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class app : public IApp, public ah::Scheduler {

void initInverter(uint8_t id) override {
mSys.addInverter(id, [this](Inverter<> *iv) {
if((IV_MI == iv->ivGen) || (IV_HM == iv->ivGen))
if((IV_MI == iv->ivGen) || (IV_HM == iv->ivGen) || (IV_HERF == iv->ivGen))
iv->radio = &mNrfRadio;
#if defined(ESP32)
else if((IV_HMS == iv->ivGen) || (IV_HMT == iv->ivGen))
Expand Down
72 changes: 70 additions & 2 deletions src/hm/hmDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ typedef enum {
} DevControlCmdType;

// inverter generations
enum {IV_MI = 0, IV_HM, IV_HMS, IV_HMT, IV_UNKNOWN};
const char* const generationNames[] = {"MI", "HM", "HMS", "HMT", "UNKNOWN"};
enum {IV_MI = 0, IV_HM, IV_HMS, IV_HMT, IV_HERF, IV_UNKNOWN};
const char* const generationNames[] = {"MI", "HM", "HMS", "HMT", "HERF", "UNKNOWN"};

// units
enum {UNIT_V = 0, UNIT_A, UNIT_W, UNIT_WH, UNIT_KWH, UNIT_HZ, UNIT_C, UNIT_PCT, UNIT_VAR, UNIT_NONE};
Expand Down Expand Up @@ -309,6 +309,74 @@ const byteAssign_t hm4chAssignment[] = {
#define HM4CH_LIST_LEN (sizeof(hm4chAssignment) / sizeof(byteAssign_t))
#define HM4CH_PAYLOAD_LEN 62

//-------------------------------------
// HERF300, HERF400, HERF500
//-------------------------------------
const byteAssign_t herf1chAssignment[] = {
{ FLD_UDC, UNIT_V, CH1, 2, 2, 10 },
{ FLD_IDC, UNIT_A, CH1, 6, 2, 100 },
{ FLD_PDC, UNIT_W, CH1, 10, 2, 10 },
{ FLD_YD, UNIT_WH, CH1, 22, 2, 1 },
{ FLD_YT, UNIT_KWH, CH1, 14, 4, 1000 },
{ FLD_IRR, UNIT_PCT, CH1, CALC_IRR_CH, CH1, CMD_CALC },
{ FLD_MP, UNIT_W, CH1, CALC_MPDC_CH, CH1, CMD_CALC },

{ FLD_UAC, UNIT_V, CH0, 26, 2, 10 },
{ FLD_IAC, UNIT_A, CH0, 34, 2, 100 },
{ FLD_PAC, UNIT_W, CH0, 30, 2, 10 },
{ FLD_Q, UNIT_VAR, CH0, 40, 2, 10 },
{ FLD_F, UNIT_HZ, CH0, 28, 2, 100 },
{ FLD_PF, UNIT_NONE, CH0, 36, 2, 1000 },
{ FLD_T, UNIT_C, CH0, 38, 2, 10 },
{ FLD_EVT, UNIT_NONE, CH0, 40, 2, 1 },
{ FLD_YD, UNIT_WH, CH0, CALC_YD_CH0, 0, CMD_CALC },
{ FLD_YT, UNIT_KWH, CH0, CALC_YT_CH0, 0, CMD_CALC },
{ FLD_PDC, UNIT_W, CH0, CALC_PDC_CH0, 0, CMD_CALC },
{ FLD_EFF, UNIT_PCT, CH0, CALC_EFF_CH0, 0, CMD_CALC },
{ FLD_MP, UNIT_W, CH0, CALC_MPAC_CH0, 0, CMD_CALC },
{ FLD_MT, UNIT_C, CH0, CALC_MT_CH0, 0, CMD_CALC }
};
#define HERF1CH_LIST_LEN (sizeof(herf1chAssignment) / sizeof(byteAssign_t))
#define HERF1CH_PAYLOAD_LEN 30

//-------------------------------------
// HERF600, HERF800
//-------------------------------------
const byteAssign_t herf2chAssignment[] = {
{ FLD_UDC, UNIT_V, CH1, 2, 2, 10 },
{ FLD_IDC, UNIT_A, CH1, 6, 2, 100 },
{ FLD_PDC, UNIT_W, CH1, 10, 2, 10 },
{ FLD_YD, UNIT_WH, CH1, 22, 2, 1 },
{ FLD_YT, UNIT_KWH, CH1, 14, 4, 1000 },
{ FLD_IRR, UNIT_PCT, CH1, CALC_IRR_CH, CH1, CMD_CALC },
{ FLD_MP, UNIT_W, CH1, CALC_MPDC_CH, CH1, CMD_CALC },

{ FLD_UDC, UNIT_V, CH2, 4, 2, 10 },
{ FLD_IDC, UNIT_A, CH2, 8, 2, 100 },
{ FLD_PDC, UNIT_W, CH2, 12, 2, 10 },
{ FLD_YD, UNIT_WH, CH2, 24, 2, 1 },
{ FLD_YT, UNIT_KWH, CH2, 18, 4, 1000 },
{ FLD_IRR, UNIT_PCT, CH2, CALC_IRR_CH, CH2, CMD_CALC },
{ FLD_MP, UNIT_W, CH2, CALC_MPDC_CH, CH2, CMD_CALC },

{ FLD_UAC, UNIT_V, CH0, 26, 2, 10 },
{ FLD_IAC, UNIT_A, CH0, 34, 2, 100 },
{ FLD_PAC, UNIT_W, CH0, 30, 2, 10 },
{ FLD_Q, UNIT_VAR, CH0, 32, 2, 10 },
{ FLD_F, UNIT_HZ, CH0, 28, 2, 100 },
{ FLD_PF, UNIT_NONE, CH0, 36, 2, 1000 },
{ FLD_T, UNIT_C, CH0, 38, 2, 10 },
{ FLD_EVT, UNIT_NONE, CH0, 40, 2, 1 },
{ FLD_YD, UNIT_WH, CH0, CALC_YD_CH0, 0, CMD_CALC },
{ FLD_YT, UNIT_KWH, CH0, CALC_YT_CH0, 0, CMD_CALC },
{ FLD_PDC, UNIT_W, CH0, CALC_PDC_CH0, 0, CMD_CALC },
{ FLD_EFF, UNIT_PCT, CH0, CALC_EFF_CH0, 0, CMD_CALC },
{ FLD_MP, UNIT_W, CH0, CALC_MPAC_CH0, 0, CMD_CALC },
{ FLD_MT, UNIT_C, CH0, CALC_MT_CH0, 0, CMD_CALC }

};
#define HERF2CH_LIST_LEN (sizeof(herf2chAssignment) / sizeof(byteAssign_t))
#define HERF2CH_PAYLOAD_LEN 42

typedef struct {
uint32_t hwPart;
Expand Down
11 changes: 10 additions & 1 deletion src/hm/hmInverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,10 @@ class Inverter {
rec->length = (uint8_t)(HMS1CH_LIST_LEN);
rec->assign = reinterpret_cast<byteAssign_t*>(const_cast<byteAssign_t*>(hms1chAssignment));
rec->pyldLen = HMS1CH_PAYLOAD_LEN;
} else if(IV_HERF == ivGen) {
rec->length = (uint8_t)(HERF1CH_LIST_LEN);
rec->assign = reinterpret_cast<byteAssign_t*>(const_cast<byteAssign_t*>(herf1chAssignment));
rec->pyldLen = HERF1CH_PAYLOAD_LEN;
}
channels = 1;
}
Expand All @@ -533,11 +537,16 @@ class Inverter {
rec->length = (uint8_t)(HMS2CH_LIST_LEN);
rec->assign = reinterpret_cast<byteAssign_t*>(const_cast<byteAssign_t*>(hms2chAssignment));
rec->pyldLen = HMS2CH_PAYLOAD_LEN;
} else if(IV_HERF == ivGen) {
rec->length = (uint8_t)(HERF2CH_LIST_LEN);
rec->assign = reinterpret_cast<byteAssign_t*>(const_cast<byteAssign_t*>(herf2chAssignment));
rec->pyldLen = HERF2CH_PAYLOAD_LEN;
}

channels = 2;
}
else if (INV_TYPE_4CH == type) {
if((IV_HM == ivGen) || (IV_MI == ivGen)) {
if((IV_HM == ivGen) || (IV_MI == ivGen) || (IV_HERF == ivGen)) {
rec->length = (uint8_t)(HM4CH_LIST_LEN);
rec->assign = reinterpret_cast<byteAssign_t*>(const_cast<byteAssign_t*>(hm4chAssignment));
rec->pyldLen = HM4CH_PAYLOAD_LEN;
Expand Down
14 changes: 14 additions & 0 deletions src/hm/hmSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@ class HmSystem {
iv->type = INV_TYPE_6CH;

iv->ivRadioType = INV_RADIO_TYPE_CMT;
} else if(iv->config->serial.b[5] == 0x28) {
iv->ivGen = IV_HERF;
switch(iv->config->serial.b[4]) {
case 0x41: iv->type = INV_TYPE_1CH;
break;
case 0x21: iv->type = INV_TYPE_2CH;
break;
case 0x01: iv->type = INV_TYPE_4CH;
break;
default:
DPRINTLN(DBG_ERROR, F("unknown inverter type"));
break;
}
iv->ivRadioType = INV_RADIO_TYPE_NRF;
} else if(iv->config->serial.u64 != 0ULL) {
DPRINTLN(DBG_ERROR, F("inverter type can't be detected!"));
iv->config->enabled = false;
Expand Down
11 changes: 0 additions & 11 deletions src/web/html/setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -923,17 +923,6 @@
sn_int |= BigInt(pos) << BigInt(shift)
}

let first4Hex = (sn_int >> 32n) & 0xFFFFn

if (first4Hex === 0x2841n)
first4Hex = 0x1121n
else if (first4Hex === 0x2821n)
first4Hex = 0x1141n
else if (first4Hex === 0x2801n)
first4Hex = 0x1161n

sn_int = (sn_int & ~(0xFFFFn << 32n)) | (first4Hex << 32n);

return sn_int.toString(16)
}

Expand Down