From 8a15048a8d08ecaa8b6dcca1c7fabbbe72dbdbf4 Mon Sep 17 00:00:00 2001 From: vaterlangen Date: Tue, 17 Sep 2024 00:12:37 +0200 Subject: [PATCH] first approch to implement overscaling based on MPPTs --- lib/Hoymiles/src/inverters/HERF_1CH.cpp | 42 +++---- lib/Hoymiles/src/inverters/HERF_2CH.cpp | 56 ++++----- lib/Hoymiles/src/inverters/HMS_1CH.cpp | 42 +++---- lib/Hoymiles/src/inverters/HMS_1CHv2.cpp | 42 +++---- lib/Hoymiles/src/inverters/HMS_2CH.cpp | 56 ++++----- lib/Hoymiles/src/inverters/HMS_4CH.cpp | 72 ++++++------ lib/Hoymiles/src/inverters/HMT_4CH.cpp | 90 +++++++-------- lib/Hoymiles/src/inverters/HMT_6CH.cpp | 114 +++++++++---------- lib/Hoymiles/src/inverters/HM_1CH.cpp | 36 +++--- lib/Hoymiles/src/inverters/HM_2CH.cpp | 48 ++++---- lib/Hoymiles/src/inverters/HM_4CH.cpp | 84 +++++++------- lib/Hoymiles/src/parser/StatisticsParser.cpp | 25 ++++ lib/Hoymiles/src/parser/StatisticsParser.h | 14 +++ src/PowerLimiterSolarInverter.cpp | 75 ++++++------ 14 files changed, 422 insertions(+), 374 deletions(-) diff --git a/lib/Hoymiles/src/inverters/HERF_1CH.cpp b/lib/Hoymiles/src/inverters/HERF_1CH.cpp index 49531d99c..495fc9a44 100644 --- a/lib/Hoymiles/src/inverters/HERF_1CH.cpp +++ b/lib/Hoymiles/src/inverters/HERF_1CH.cpp @@ -6,27 +6,27 @@ #include "HERF_1CH.h" static const byteAssign_t byteAssignment[] = { - { TYPE_DC, CH0, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_IDC, UNIT_A, 6, 2, 100, false, 2 }, - { TYPE_DC, CH0, FLD_PDC, UNIT_W, 10, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_YD, UNIT_WH, 22, 2, 1, false, 0 }, - { TYPE_DC, CH0, FLD_YT, UNIT_KWH, 14, 4, 1000, false, 3 }, - { TYPE_DC, CH0, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, - - { TYPE_AC, CH0, FLD_UAC, UNIT_V, 26, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_IAC, UNIT_A, 34, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PAC, UNIT_W, 30, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_Q, UNIT_VAR, 40, 2, 10, false, 1 }, // to be verified - { TYPE_AC, CH0, FLD_F, UNIT_HZ, 28, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PF, UNIT_NONE, 36, 2, 1000, false, 3 }, - - { TYPE_INV, CH0, FLD_T, UNIT_C, 38, 2, 10, true, 1 }, // to be verified - { TYPE_INV, CH0, FLD_EVT_LOG, UNIT_NONE, 40, 2, 1, false, 0 }, // to be verified - - { TYPE_INV, CH0, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, - { TYPE_INV, CH0, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, - { TYPE_INV, CH0, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, - { TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } + { TYPE_DC, CH0, MPPT_A, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_IDC, UNIT_A, 6, 2, 100, false, 2 }, + { TYPE_DC, CH0, MPPT_A, FLD_PDC, UNIT_W, 10, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_YD, UNIT_WH, 22, 2, 1, false, 0 }, + { TYPE_DC, CH0, MPPT_A, FLD_YT, UNIT_KWH, 14, 4, 1000, false, 3 }, + { TYPE_DC, CH0, MPPT_A, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, + + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC, UNIT_V, 26, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_IAC, UNIT_A, 34, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PAC, UNIT_W, 30, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_Q, UNIT_VAR, 40, 2, 10, false, 1 }, // to be verified + { TYPE_AC, CH0, MPPT_NONE, FLD_F, UNIT_HZ, 28, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PF, UNIT_NONE, 36, 2, 1000, false, 3 }, + + { TYPE_INV, CH0, MPPT_NONE, FLD_T, UNIT_C, 38, 2, 10, true, 1 }, // to be verified + { TYPE_INV, CH0, MPPT_NONE, FLD_EVT_LOG, UNIT_NONE, 40, 2, 1, false, 0 }, // to be verified + + { TYPE_INV, CH0, MPPT_NONE, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } }; HERF_1CH::HERF_1CH(HoymilesRadio* radio, const uint64_t serial) diff --git a/lib/Hoymiles/src/inverters/HERF_2CH.cpp b/lib/Hoymiles/src/inverters/HERF_2CH.cpp index f0216a643..654dab249 100644 --- a/lib/Hoymiles/src/inverters/HERF_2CH.cpp +++ b/lib/Hoymiles/src/inverters/HERF_2CH.cpp @@ -6,34 +6,34 @@ #include "HERF_2CH.h" static const byteAssign_t byteAssignment[] = { - { TYPE_DC, CH0, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_IDC, UNIT_A, 6, 2, 100, false, 2 }, - { TYPE_DC, CH0, FLD_PDC, UNIT_W, 10, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_YD, UNIT_WH, 22, 2, 1, false, 0 }, - { TYPE_DC, CH0, FLD_YT, UNIT_KWH, 14, 4, 1000, false, 3 }, - { TYPE_DC, CH0, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, - - { TYPE_DC, CH1, FLD_UDC, UNIT_V, 4, 2, 10, false, 1 }, - { TYPE_DC, CH1, FLD_IDC, UNIT_A, 8, 2, 100, false, 2 }, - { TYPE_DC, CH1, FLD_PDC, UNIT_W, 12, 2, 10, false, 1 }, - { TYPE_DC, CH1, FLD_YD, UNIT_WH, 24, 2, 1, false, 0 }, - { TYPE_DC, CH1, FLD_YT, UNIT_KWH, 18, 4, 1000, false, 3 }, - { TYPE_DC, CH1, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH1, CMD_CALC, false, 3 }, - - { TYPE_AC, CH0, FLD_UAC, UNIT_V, 26, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_IAC, UNIT_A, 34, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PAC, UNIT_W, 30, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_Q, UNIT_VAR, 32, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_F, UNIT_HZ, 28, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PF, UNIT_NONE, 36, 2, 1000, false, 3 }, - - { TYPE_INV, CH0, FLD_T, UNIT_C, 38, 2, 10, true, 1 }, - { TYPE_INV, CH0, FLD_EVT_LOG, UNIT_NONE, 40, 2, 1, false, 0 }, - - { TYPE_INV, CH0, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, - { TYPE_INV, CH0, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, - { TYPE_INV, CH0, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, - { TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } + { TYPE_DC, CH0, MPPT_A, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_IDC, UNIT_A, 6, 2, 100, false, 2 }, + { TYPE_DC, CH0, MPPT_A, FLD_PDC, UNIT_W, 10, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_YD, UNIT_WH, 22, 2, 1, false, 0 }, + { TYPE_DC, CH0, MPPT_A, FLD_YT, UNIT_KWH, 14, 4, 1000, false, 3 }, + { TYPE_DC, CH0, MPPT_A, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, + + { TYPE_DC, CH1, MPPT_B, FLD_UDC, UNIT_V, 4, 2, 10, false, 1 }, + { TYPE_DC, CH1, MPPT_B, FLD_IDC, UNIT_A, 8, 2, 100, false, 2 }, + { TYPE_DC, CH1, MPPT_B, FLD_PDC, UNIT_W, 12, 2, 10, false, 1 }, + { TYPE_DC, CH1, MPPT_B, FLD_YD, UNIT_WH, 24, 2, 1, false, 0 }, + { TYPE_DC, CH1, MPPT_B, FLD_YT, UNIT_KWH, 18, 4, 1000, false, 3 }, + { TYPE_DC, CH1, MPPT_B, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH1, CMD_CALC, false, 3 }, + + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC, UNIT_V, 26, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_IAC, UNIT_A, 34, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PAC, UNIT_W, 30, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_Q, UNIT_VAR, 32, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_F, UNIT_HZ, 28, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PF, UNIT_NONE, 36, 2, 1000, false, 3 }, + + { TYPE_INV, CH0, MPPT_NONE, FLD_T, UNIT_C, 38, 2, 10, true, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EVT_LOG, UNIT_NONE, 40, 2, 1, false, 0 }, + + { TYPE_INV, CH0, MPPT_NONE, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } }; HERF_2CH::HERF_2CH(HoymilesRadio* radio, const uint64_t serial) diff --git a/lib/Hoymiles/src/inverters/HMS_1CH.cpp b/lib/Hoymiles/src/inverters/HMS_1CH.cpp index 2c7e3857b..efa405226 100644 --- a/lib/Hoymiles/src/inverters/HMS_1CH.cpp +++ b/lib/Hoymiles/src/inverters/HMS_1CH.cpp @@ -5,27 +5,27 @@ #include "HMS_1CH.h" static const byteAssign_t byteAssignment[] = { - { TYPE_DC, CH0, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_IDC, UNIT_A, 4, 2, 100, false, 2 }, - { TYPE_DC, CH0, FLD_PDC, UNIT_W, 6, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_YD, UNIT_WH, 12, 2, 1, false, 0 }, - { TYPE_DC, CH0, FLD_YT, UNIT_KWH, 8, 4, 1000, false, 3 }, - { TYPE_DC, CH0, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, - - { TYPE_AC, CH0, FLD_UAC, UNIT_V, 14, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_IAC, UNIT_A, 22, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PAC, UNIT_W, 18, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_Q, UNIT_VAR, 20, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_F, UNIT_HZ, 16, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PF, UNIT_NONE, 24, 2, 1000, false, 3 }, - - { TYPE_INV, CH0, FLD_T, UNIT_C, 26, 2, 10, true, 1 }, - { TYPE_INV, CH0, FLD_EVT_LOG, UNIT_NONE, 28, 2, 1, false, 0 }, - - { TYPE_INV, CH0, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, - { TYPE_INV, CH0, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, - { TYPE_INV, CH0, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, - { TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } + { TYPE_DC, CH0, MPPT_A, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_IDC, UNIT_A, 4, 2, 100, false, 2 }, + { TYPE_DC, CH0, MPPT_A, FLD_PDC, UNIT_W, 6, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_YD, UNIT_WH, 12, 2, 1, false, 0 }, + { TYPE_DC, CH0, MPPT_A, FLD_YT, UNIT_KWH, 8, 4, 1000, false, 3 }, + { TYPE_DC, CH0, MPPT_A, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, + + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC, UNIT_V, 14, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_IAC, UNIT_A, 22, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PAC, UNIT_W, 18, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_Q, UNIT_VAR, 20, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_F, UNIT_HZ, 16, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PF, UNIT_NONE, 24, 2, 1000, false, 3 }, + + { TYPE_INV, CH0, MPPT_NONE, FLD_T, UNIT_C, 26, 2, 10, true, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EVT_LOG, UNIT_NONE, 28, 2, 1, false, 0 }, + + { TYPE_INV, CH0, MPPT_NONE, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } }; HMS_1CH::HMS_1CH(HoymilesRadio* radio, const uint64_t serial) diff --git a/lib/Hoymiles/src/inverters/HMS_1CHv2.cpp b/lib/Hoymiles/src/inverters/HMS_1CHv2.cpp index d79d2c1d2..d09968162 100644 --- a/lib/Hoymiles/src/inverters/HMS_1CHv2.cpp +++ b/lib/Hoymiles/src/inverters/HMS_1CHv2.cpp @@ -5,27 +5,27 @@ #include "HMS_1CHv2.h" static const byteAssign_t byteAssignment[] = { - { TYPE_DC, CH0, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_IDC, UNIT_A, 6, 2, 100, false, 2 }, - { TYPE_DC, CH0, FLD_PDC, UNIT_W, 10, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_YD, UNIT_WH, 22, 2, 1, false, 0 }, - { TYPE_DC, CH0, FLD_YT, UNIT_KWH, 14, 4, 1000, false, 3 }, - { TYPE_DC, CH0, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, - - { TYPE_AC, CH0, FLD_UAC, UNIT_V, 26, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_IAC, UNIT_A, 34, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PAC, UNIT_W, 30, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_Q, UNIT_VAR, 20, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_F, UNIT_HZ, 28, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PF, UNIT_NONE, 36, 2, 1000, false, 3 }, - - { TYPE_INV, CH0, FLD_T, UNIT_C, 38, 2, 10, true, 1 }, - { TYPE_INV, CH0, FLD_EVT_LOG, UNIT_NONE, 18, 2, 1, false, 0 }, - - { TYPE_INV, CH0, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, - { TYPE_INV, CH0, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, - { TYPE_INV, CH0, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, - { TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } + { TYPE_DC, CH0, MPPT_A, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_IDC, UNIT_A, 6, 2, 100, false, 2 }, + { TYPE_DC, CH0, MPPT_A, FLD_PDC, UNIT_W, 10, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_YD, UNIT_WH, 22, 2, 1, false, 0 }, + { TYPE_DC, CH0, MPPT_A, FLD_YT, UNIT_KWH, 14, 4, 1000, false, 3 }, + { TYPE_DC, CH0, MPPT_A, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, + + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC, UNIT_V, 26, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_IAC, UNIT_A, 34, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PAC, UNIT_W, 30, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_Q, UNIT_VAR, 20, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_F, UNIT_HZ, 28, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PF, UNIT_NONE, 36, 2, 1000, false, 3 }, + + { TYPE_INV, CH0, MPPT_NONE, FLD_T, UNIT_C, 38, 2, 10, true, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EVT_LOG, UNIT_NONE, 18, 2, 1, false, 0 }, + + { TYPE_INV, CH0, MPPT_NONE, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } }; HMS_1CHv2::HMS_1CHv2(HoymilesRadio* radio, const uint64_t serial) diff --git a/lib/Hoymiles/src/inverters/HMS_2CH.cpp b/lib/Hoymiles/src/inverters/HMS_2CH.cpp index 4cbc686cd..f5387f06f 100644 --- a/lib/Hoymiles/src/inverters/HMS_2CH.cpp +++ b/lib/Hoymiles/src/inverters/HMS_2CH.cpp @@ -5,34 +5,34 @@ #include "HMS_2CH.h" static const byteAssign_t byteAssignment[] = { - { TYPE_DC, CH0, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_IDC, UNIT_A, 6, 2, 100, false, 2 }, - { TYPE_DC, CH0, FLD_PDC, UNIT_W, 10, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_YT, UNIT_KWH, 14, 4, 1000, false, 3 }, - { TYPE_DC, CH0, FLD_YD, UNIT_WH, 22, 2, 1, false, 0 }, - { TYPE_DC, CH0, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, - - { TYPE_DC, CH1, FLD_UDC, UNIT_V, 4, 2, 10, false, 1 }, - { TYPE_DC, CH1, FLD_IDC, UNIT_A, 8, 2, 100, false, 2 }, - { TYPE_DC, CH1, FLD_PDC, UNIT_W, 12, 2, 10, false, 1 }, - { TYPE_DC, CH1, FLD_YT, UNIT_KWH, 18, 4, 1000, false, 3 }, - { TYPE_DC, CH1, FLD_YD, UNIT_WH, 24, 2, 1, false, 0 }, - { TYPE_DC, CH1, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH1, CMD_CALC, false, 3 }, - - { TYPE_AC, CH0, FLD_UAC, UNIT_V, 26, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_IAC, UNIT_A, 34, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PAC, UNIT_W, 30, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_Q, UNIT_VAR, 32, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_F, UNIT_HZ, 28, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PF, UNIT_NONE, 36, 2, 1000, false, 3 }, - - { TYPE_INV, CH0, FLD_T, UNIT_C, 38, 2, 10, true, 1 }, - { TYPE_INV, CH0, FLD_EVT_LOG, UNIT_NONE, 40, 2, 1, false, 0 }, - - { TYPE_INV, CH0, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, - { TYPE_INV, CH0, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, - { TYPE_INV, CH0, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, - { TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } + { TYPE_DC, CH0, MPPT_A, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_IDC, UNIT_A, 6, 2, 100, false, 2 }, + { TYPE_DC, CH0, MPPT_A, FLD_PDC, UNIT_W, 10, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_YT, UNIT_KWH, 14, 4, 1000, false, 3 }, + { TYPE_DC, CH0, MPPT_A, FLD_YD, UNIT_WH, 22, 2, 1, false, 0 }, + { TYPE_DC, CH0, MPPT_A, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, + + { TYPE_DC, CH1, MPPT_B, FLD_UDC, UNIT_V, 4, 2, 10, false, 1 }, + { TYPE_DC, CH1, MPPT_B, FLD_IDC, UNIT_A, 8, 2, 100, false, 2 }, + { TYPE_DC, CH1, MPPT_B, FLD_PDC, UNIT_W, 12, 2, 10, false, 1 }, + { TYPE_DC, CH1, MPPT_B, FLD_YT, UNIT_KWH, 18, 4, 1000, false, 3 }, + { TYPE_DC, CH1, MPPT_B, FLD_YD, UNIT_WH, 24, 2, 1, false, 0 }, + { TYPE_DC, CH1, MPPT_B, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH1, CMD_CALC, false, 3 }, + + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC, UNIT_V, 26, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_IAC, UNIT_A, 34, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PAC, UNIT_W, 30, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_Q, UNIT_VAR, 32, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_F, UNIT_HZ, 28, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PF, UNIT_NONE, 36, 2, 1000, false, 3 }, + + { TYPE_INV, CH0, MPPT_NONE, FLD_T, UNIT_C, 38, 2, 10, true, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EVT_LOG, UNIT_NONE, 40, 2, 1, false, 0 }, + + { TYPE_INV, CH0, MPPT_NONE, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } }; HMS_2CH::HMS_2CH(HoymilesRadio* radio, const uint64_t serial) diff --git a/lib/Hoymiles/src/inverters/HMS_4CH.cpp b/lib/Hoymiles/src/inverters/HMS_4CH.cpp index b3cf1f380..ae755bf99 100644 --- a/lib/Hoymiles/src/inverters/HMS_4CH.cpp +++ b/lib/Hoymiles/src/inverters/HMS_4CH.cpp @@ -5,48 +5,48 @@ #include "HMS_4CH.h" static const byteAssign_t byteAssignment[] = { - { TYPE_DC, CH0, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_IDC, UNIT_A, 6, 2, 100, false, 2 }, - { TYPE_DC, CH0, FLD_PDC, UNIT_W, 10, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_YD, UNIT_WH, 22, 2, 1, false, 0 }, - { TYPE_DC, CH0, FLD_YT, UNIT_KWH, 14, 4, 1000, false, 3 }, - { TYPE_DC, CH0, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, + { TYPE_DC, CH0, MPPT_A, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_IDC, UNIT_A, 6, 2, 100, false, 2 }, + { TYPE_DC, CH0, MPPT_A, FLD_PDC, UNIT_W, 10, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_YD, UNIT_WH, 22, 2, 1, false, 0 }, + { TYPE_DC, CH0, MPPT_A, FLD_YT, UNIT_KWH, 14, 4, 1000, false, 3 }, + { TYPE_DC, CH0, MPPT_A, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, - { TYPE_DC, CH1, FLD_UDC, UNIT_V, 4, 2, 10, false, 1 }, - { TYPE_DC, CH1, FLD_IDC, UNIT_A, 8, 2, 100, false, 2 }, - { TYPE_DC, CH1, FLD_PDC, UNIT_W, 12, 2, 10, false, 1 }, - { TYPE_DC, CH1, FLD_YD, UNIT_WH, 24, 2, 1, false, 0 }, - { TYPE_DC, CH1, FLD_YT, UNIT_KWH, 18, 4, 1000, false, 3 }, - { TYPE_DC, CH1, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH1, CMD_CALC, false, 3 }, + { TYPE_DC, CH1, MPPT_B, FLD_UDC, UNIT_V, 4, 2, 10, false, 1 }, + { TYPE_DC, CH1, MPPT_B, FLD_IDC, UNIT_A, 8, 2, 100, false, 2 }, + { TYPE_DC, CH1, MPPT_B, FLD_PDC, UNIT_W, 12, 2, 10, false, 1 }, + { TYPE_DC, CH1, MPPT_B, FLD_YD, UNIT_WH, 24, 2, 1, false, 0 }, + { TYPE_DC, CH1, MPPT_B, FLD_YT, UNIT_KWH, 18, 4, 1000, false, 3 }, + { TYPE_DC, CH1, MPPT_B, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH1, CMD_CALC, false, 3 }, - { TYPE_DC, CH2, FLD_UDC, UNIT_V, 26, 2, 10, false, 1 }, - { TYPE_DC, CH2, FLD_IDC, UNIT_A, 30, 2, 100, false, 2 }, - { TYPE_DC, CH2, FLD_PDC, UNIT_W, 34, 2, 10, false, 1 }, - { TYPE_DC, CH2, FLD_YD, UNIT_WH, 46, 2, 1, false, 0 }, - { TYPE_DC, CH2, FLD_YT, UNIT_KWH, 38, 4, 1000, false, 3 }, - { TYPE_DC, CH2, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH2, CMD_CALC, false, 3 }, + { TYPE_DC, CH2, MPPT_C, FLD_UDC, UNIT_V, 26, 2, 10, false, 1 }, + { TYPE_DC, CH2, MPPT_C, FLD_IDC, UNIT_A, 30, 2, 100, false, 2 }, + { TYPE_DC, CH2, MPPT_C, FLD_PDC, UNIT_W, 34, 2, 10, false, 1 }, + { TYPE_DC, CH2, MPPT_C, FLD_YD, UNIT_WH, 46, 2, 1, false, 0 }, + { TYPE_DC, CH2, MPPT_C, FLD_YT, UNIT_KWH, 38, 4, 1000, false, 3 }, + { TYPE_DC, CH2, MPPT_C, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH2, CMD_CALC, false, 3 }, - { TYPE_DC, CH3, FLD_UDC, UNIT_V, 28, 2, 10, false, 1 }, - { TYPE_DC, CH3, FLD_IDC, UNIT_A, 32, 2, 100, false, 2 }, - { TYPE_DC, CH3, FLD_PDC, UNIT_W, 36, 2, 10, false, 1 }, - { TYPE_DC, CH3, FLD_YD, UNIT_WH, 48, 2, 1, false, 0 }, - { TYPE_DC, CH3, FLD_YT, UNIT_KWH, 42, 4, 1000, false, 3 }, - { TYPE_DC, CH3, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH3, CMD_CALC, false, 3 }, + { TYPE_DC, CH3, MPPT_D, FLD_UDC, UNIT_V, 28, 2, 10, false, 1 }, + { TYPE_DC, CH3, MPPT_D, FLD_IDC, UNIT_A, 32, 2, 100, false, 2 }, + { TYPE_DC, CH3, MPPT_D, FLD_PDC, UNIT_W, 36, 2, 10, false, 1 }, + { TYPE_DC, CH3, MPPT_D, FLD_YD, UNIT_WH, 48, 2, 1, false, 0 }, + { TYPE_DC, CH3, MPPT_D, FLD_YT, UNIT_KWH, 42, 4, 1000, false, 3 }, + { TYPE_DC, CH3, MPPT_D, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH3, CMD_CALC, false, 3 }, - { TYPE_AC, CH0, FLD_UAC, UNIT_V, 50, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_IAC, UNIT_A, 58, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PAC, UNIT_W, 54, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_Q, UNIT_VAR, 56, 2, 10, true, 1 }, - { TYPE_AC, CH0, FLD_F, UNIT_HZ, 52, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PF, UNIT_NONE, 60, 2, 1000, false, 3 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC, UNIT_V, 50, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_IAC, UNIT_A, 58, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PAC, UNIT_W, 54, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_Q, UNIT_VAR, 56, 2, 10, true, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_F, UNIT_HZ, 52, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PF, UNIT_NONE, 60, 2, 1000, false, 3 }, - { TYPE_INV, CH0, FLD_T, UNIT_C, 62, 2, 10, true, 1 }, - { TYPE_INV, CH0, FLD_EVT_LOG, UNIT_NONE, 64, 2, 1, false, 0 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_T, UNIT_C, 62, 2, 10, true, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EVT_LOG, UNIT_NONE, 64, 2, 1, false, 0 }, - { TYPE_INV, CH0, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, - { TYPE_INV, CH0, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, - { TYPE_INV, CH0, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, - { TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } + { TYPE_INV, CH0, MPPT_NONE, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } }; HMS_4CH::HMS_4CH(HoymilesRadio* radio, const uint64_t serial) diff --git a/lib/Hoymiles/src/inverters/HMT_4CH.cpp b/lib/Hoymiles/src/inverters/HMT_4CH.cpp index c84eff478..ec45676f5 100644 --- a/lib/Hoymiles/src/inverters/HMT_4CH.cpp +++ b/lib/Hoymiles/src/inverters/HMT_4CH.cpp @@ -5,57 +5,57 @@ #include "HMT_4CH.h" static const byteAssign_t byteAssignment[] = { - { TYPE_DC, CH0, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_IDC, UNIT_A, 4, 2, 100, false, 2 }, - { TYPE_DC, CH0, FLD_PDC, UNIT_W, 8, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_YT, UNIT_KWH, 12, 4, 1000, false, 3 }, - { TYPE_DC, CH0, FLD_YD, UNIT_WH, 20, 2, 1, false, 0 }, - { TYPE_DC, CH0, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, + { TYPE_DC, CH0, MPPT_A, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_IDC, UNIT_A, 4, 2, 100, false, 2 }, + { TYPE_DC, CH0, MPPT_A, FLD_PDC, UNIT_W, 8, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_YT, UNIT_KWH, 12, 4, 1000, false, 3 }, + { TYPE_DC, CH0, MPPT_A, FLD_YD, UNIT_WH, 20, 2, 1, false, 0 }, + { TYPE_DC, CH0, MPPT_A, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, - { TYPE_DC, CH1, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, - { TYPE_DC, CH1, FLD_IDC, UNIT_A, 6, 2, 100, false, 2 }, - { TYPE_DC, CH1, FLD_PDC, UNIT_W, 10, 2, 10, false, 1 }, - { TYPE_DC, CH1, FLD_YT, UNIT_KWH, 16, 4, 1000, false, 3 }, - { TYPE_DC, CH1, FLD_YD, UNIT_WH, 22, 2, 1, false, 0 }, - { TYPE_DC, CH1, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH1, CMD_CALC, false, 3 }, + { TYPE_DC, CH1, MPPT_A, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, + { TYPE_DC, CH1, MPPT_A, FLD_IDC, UNIT_A, 6, 2, 100, false, 2 }, + { TYPE_DC, CH1, MPPT_A, FLD_PDC, UNIT_W, 10, 2, 10, false, 1 }, + { TYPE_DC, CH1, MPPT_A, FLD_YT, UNIT_KWH, 16, 4, 1000, false, 3 }, + { TYPE_DC, CH1, MPPT_A, FLD_YD, UNIT_WH, 22, 2, 1, false, 0 }, + { TYPE_DC, CH1, MPPT_A, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH1, CMD_CALC, false, 3 }, - { TYPE_DC, CH2, FLD_UDC, UNIT_V, 24, 2, 10, false, 1 }, - { TYPE_DC, CH2, FLD_IDC, UNIT_A, 26, 2, 100, false, 2 }, - { TYPE_DC, CH2, FLD_PDC, UNIT_W, 30, 2, 10, false, 1 }, - { TYPE_DC, CH2, FLD_YT, UNIT_KWH, 34, 4, 1000, false, 3 }, - { TYPE_DC, CH2, FLD_YD, UNIT_WH, 42, 2, 1, false, 0 }, - { TYPE_DC, CH2, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH2, CMD_CALC, false, 3 }, + { TYPE_DC, CH2, MPPT_B, FLD_UDC, UNIT_V, 24, 2, 10, false, 1 }, + { TYPE_DC, CH2, MPPT_B, FLD_IDC, UNIT_A, 26, 2, 100, false, 2 }, + { TYPE_DC, CH2, MPPT_B, FLD_PDC, UNIT_W, 30, 2, 10, false, 1 }, + { TYPE_DC, CH2, MPPT_B, FLD_YT, UNIT_KWH, 34, 4, 1000, false, 3 }, + { TYPE_DC, CH2, MPPT_B, FLD_YD, UNIT_WH, 42, 2, 1, false, 0 }, + { TYPE_DC, CH2, MPPT_B, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH2, CMD_CALC, false, 3 }, - { TYPE_DC, CH3, FLD_UDC, UNIT_V, 24, 2, 10, false, 1 }, - { TYPE_DC, CH3, FLD_IDC, UNIT_A, 28, 2, 100, false, 2 }, - { TYPE_DC, CH3, FLD_PDC, UNIT_W, 32, 2, 10, false, 1 }, - { TYPE_DC, CH3, FLD_YT, UNIT_KWH, 38, 4, 1000, false, 3 }, - { TYPE_DC, CH3, FLD_YD, UNIT_WH, 44, 2, 1, false, 0 }, - { TYPE_DC, CH3, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH3, CMD_CALC, false, 3 }, + { TYPE_DC, CH3, MPPT_B, FLD_UDC, UNIT_V, 24, 2, 10, false, 1 }, + { TYPE_DC, CH3, MPPT_B, FLD_IDC, UNIT_A, 28, 2, 100, false, 2 }, + { TYPE_DC, CH3, MPPT_B, FLD_PDC, UNIT_W, 32, 2, 10, false, 1 }, + { TYPE_DC, CH3, MPPT_B, FLD_YT, UNIT_KWH, 38, 4, 1000, false, 3 }, + { TYPE_DC, CH3, MPPT_B, FLD_YD, UNIT_WH, 44, 2, 1, false, 0 }, + { TYPE_DC, CH3, MPPT_B, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH3, CMD_CALC, false, 3 }, - { TYPE_AC, CH0, FLD_UAC, UNIT_V, 74, 2, 10, false, 1 }, // dummy - { TYPE_AC, CH0, FLD_UAC_1N, UNIT_V, 68, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_UAC_2N, UNIT_V, 70, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_UAC_3N, UNIT_V, 72, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_UAC_12, UNIT_V, 74, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_UAC_23, UNIT_V, 76, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_UAC_31, UNIT_V, 78, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_F, UNIT_HZ, 80, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PAC, UNIT_W, 82, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_Q, UNIT_VAR, 84, 2, 10, true, 1 }, - { TYPE_AC, CH0, FLD_IAC, UNIT_A, 86, 2, 100, false, 2 }, // dummy - { TYPE_AC, CH0, FLD_IAC_1, UNIT_A, 86, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_IAC_2, UNIT_A, 88, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_IAC_3, UNIT_A, 90, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PF, UNIT_NONE, 92, 2, 1000, false, 3 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC, UNIT_V, 74, 2, 10, false, 1 }, // dummy + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC_1N, UNIT_V, 68, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC_2N, UNIT_V, 70, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC_3N, UNIT_V, 72, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC_12, UNIT_V, 74, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC_23, UNIT_V, 76, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC_31, UNIT_V, 78, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_F, UNIT_HZ, 80, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PAC, UNIT_W, 82, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_Q, UNIT_VAR, 84, 2, 10, true, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_IAC, UNIT_A, 86, 2, 100, false, 2 }, // dummy + { TYPE_AC, CH0, MPPT_NONE, FLD_IAC_1, UNIT_A, 86, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_IAC_2, UNIT_A, 88, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_IAC_3, UNIT_A, 90, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PF, UNIT_NONE, 92, 2, 1000, false, 3 }, - { TYPE_INV, CH0, FLD_T, UNIT_C, 94, 2, 10, true, 1 }, - { TYPE_INV, CH0, FLD_EVT_LOG, UNIT_NONE, 96, 2, 1, false, 0 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_T, UNIT_C, 94, 2, 10, true, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EVT_LOG, UNIT_NONE, 96, 2, 1, false, 0 }, - { TYPE_INV, CH0, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, - { TYPE_INV, CH0, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, - { TYPE_INV, CH0, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, - { TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } + { TYPE_INV, CH0, MPPT_NONE, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } }; HMT_4CH::HMT_4CH(HoymilesRadio* radio, const uint64_t serial) diff --git a/lib/Hoymiles/src/inverters/HMT_6CH.cpp b/lib/Hoymiles/src/inverters/HMT_6CH.cpp index 2c3dd5f3a..eb9437681 100644 --- a/lib/Hoymiles/src/inverters/HMT_6CH.cpp +++ b/lib/Hoymiles/src/inverters/HMT_6CH.cpp @@ -5,71 +5,71 @@ #include "HMT_6CH.h" static const byteAssign_t byteAssignment[] = { - { TYPE_DC, CH0, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_IDC, UNIT_A, 4, 2, 100, false, 2 }, - { TYPE_DC, CH0, FLD_PDC, UNIT_W, 8, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_YT, UNIT_KWH, 12, 4, 1000, false, 3 }, - { TYPE_DC, CH0, FLD_YD, UNIT_WH, 20, 2, 1, false, 0 }, - { TYPE_DC, CH0, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, + { TYPE_DC, CH0, MPPT_A, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_IDC, UNIT_A, 4, 2, 100, false, 2 }, + { TYPE_DC, CH0, MPPT_A, FLD_PDC, UNIT_W, 8, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_YT, UNIT_KWH, 12, 4, 1000, false, 3 }, + { TYPE_DC, CH0, MPPT_A, FLD_YD, UNIT_WH, 20, 2, 1, false, 0 }, + { TYPE_DC, CH0, MPPT_A, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, - { TYPE_DC, CH1, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, - { TYPE_DC, CH1, FLD_IDC, UNIT_A, 6, 2, 100, false, 2 }, - { TYPE_DC, CH1, FLD_PDC, UNIT_W, 10, 2, 10, false, 1 }, - { TYPE_DC, CH1, FLD_YT, UNIT_KWH, 16, 4, 1000, false, 3 }, - { TYPE_DC, CH1, FLD_YD, UNIT_WH, 22, 2, 1, false, 0 }, - { TYPE_DC, CH1, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH1, CMD_CALC, false, 3 }, + { TYPE_DC, CH1, MPPT_A, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, + { TYPE_DC, CH1, MPPT_A, FLD_IDC, UNIT_A, 6, 2, 100, false, 2 }, + { TYPE_DC, CH1, MPPT_A, FLD_PDC, UNIT_W, 10, 2, 10, false, 1 }, + { TYPE_DC, CH1, MPPT_A, FLD_YT, UNIT_KWH, 16, 4, 1000, false, 3 }, + { TYPE_DC, CH1, MPPT_A, FLD_YD, UNIT_WH, 22, 2, 1, false, 0 }, + { TYPE_DC, CH1, MPPT_A, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH1, CMD_CALC, false, 3 }, - { TYPE_DC, CH2, FLD_UDC, UNIT_V, 24, 2, 10, false, 1 }, - { TYPE_DC, CH2, FLD_IDC, UNIT_A, 26, 2, 100, false, 2 }, - { TYPE_DC, CH2, FLD_PDC, UNIT_W, 30, 2, 10, false, 1 }, - { TYPE_DC, CH2, FLD_YT, UNIT_KWH, 34, 4, 1000, false, 3 }, - { TYPE_DC, CH2, FLD_YD, UNIT_WH, 42, 2, 1, false, 0 }, - { TYPE_DC, CH2, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH2, CMD_CALC, false, 3 }, + { TYPE_DC, CH2, MPPT_B, FLD_UDC, UNIT_V, 24, 2, 10, false, 1 }, + { TYPE_DC, CH2, MPPT_B, FLD_IDC, UNIT_A, 26, 2, 100, false, 2 }, + { TYPE_DC, CH2, MPPT_B, FLD_PDC, UNIT_W, 30, 2, 10, false, 1 }, + { TYPE_DC, CH2, MPPT_B, FLD_YT, UNIT_KWH, 34, 4, 1000, false, 3 }, + { TYPE_DC, CH2, MPPT_B, FLD_YD, UNIT_WH, 42, 2, 1, false, 0 }, + { TYPE_DC, CH2, MPPT_B, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH2, CMD_CALC, false, 3 }, - { TYPE_DC, CH3, FLD_UDC, UNIT_V, 24, 2, 10, false, 1 }, - { TYPE_DC, CH3, FLD_IDC, UNIT_A, 28, 2, 100, false, 2 }, - { TYPE_DC, CH3, FLD_PDC, UNIT_W, 32, 2, 10, false, 1 }, - { TYPE_DC, CH3, FLD_YT, UNIT_KWH, 38, 4, 1000, false, 3 }, - { TYPE_DC, CH3, FLD_YD, UNIT_WH, 44, 2, 1, false, 0 }, - { TYPE_DC, CH3, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH3, CMD_CALC, false, 3 }, + { TYPE_DC, CH3, MPPT_B, FLD_UDC, UNIT_V, 24, 2, 10, false, 1 }, + { TYPE_DC, CH3, MPPT_B, FLD_IDC, UNIT_A, 28, 2, 100, false, 2 }, + { TYPE_DC, CH3, MPPT_B, FLD_PDC, UNIT_W, 32, 2, 10, false, 1 }, + { TYPE_DC, CH3, MPPT_B, FLD_YT, UNIT_KWH, 38, 4, 1000, false, 3 }, + { TYPE_DC, CH3, MPPT_B, FLD_YD, UNIT_WH, 44, 2, 1, false, 0 }, + { TYPE_DC, CH3, MPPT_B, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH3, CMD_CALC, false, 3 }, - { TYPE_DC, CH4, FLD_UDC, UNIT_V, 46, 2, 10, false, 1 }, - { TYPE_DC, CH4, FLD_IDC, UNIT_A, 48, 2, 100, false, 2 }, - { TYPE_DC, CH4, FLD_PDC, UNIT_W, 52, 2, 10, false, 1 }, - { TYPE_DC, CH4, FLD_YT, UNIT_KWH, 56, 4, 1000, false, 3 }, - { TYPE_DC, CH4, FLD_YD, UNIT_WH, 64, 2, 1, false, 0 }, - { TYPE_DC, CH4, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH4, CMD_CALC, false, 3 }, + { TYPE_DC, CH4, MPPT_C, FLD_UDC, UNIT_V, 46, 2, 10, false, 1 }, + { TYPE_DC, CH4, MPPT_C, FLD_IDC, UNIT_A, 48, 2, 100, false, 2 }, + { TYPE_DC, CH4, MPPT_C, FLD_PDC, UNIT_W, 52, 2, 10, false, 1 }, + { TYPE_DC, CH4, MPPT_C, FLD_YT, UNIT_KWH, 56, 4, 1000, false, 3 }, + { TYPE_DC, CH4, MPPT_C, FLD_YD, UNIT_WH, 64, 2, 1, false, 0 }, + { TYPE_DC, CH4, MPPT_C, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH4, CMD_CALC, false, 3 }, - { TYPE_DC, CH5, FLD_UDC, UNIT_V, 46, 2, 10, false, 1 }, - { TYPE_DC, CH5, FLD_IDC, UNIT_A, 50, 2, 100, false, 2 }, - { TYPE_DC, CH5, FLD_PDC, UNIT_W, 54, 2, 10, false, 1 }, - { TYPE_DC, CH5, FLD_YT, UNIT_KWH, 60, 4, 1000, false, 3 }, - { TYPE_DC, CH5, FLD_YD, UNIT_WH, 66, 2, 1, false, 0 }, - { TYPE_DC, CH5, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH5, CMD_CALC, false, 3 }, + { TYPE_DC, CH5, MPPT_C, FLD_UDC, UNIT_V, 46, 2, 10, false, 1 }, + { TYPE_DC, CH5, MPPT_C, FLD_IDC, UNIT_A, 50, 2, 100, false, 2 }, + { TYPE_DC, CH5, MPPT_C, FLD_PDC, UNIT_W, 54, 2, 10, false, 1 }, + { TYPE_DC, CH5, MPPT_C, FLD_YT, UNIT_KWH, 60, 4, 1000, false, 3 }, + { TYPE_DC, CH5, MPPT_C, FLD_YD, UNIT_WH, 66, 2, 1, false, 0 }, + { TYPE_DC, CH5, MPPT_C, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH5, CMD_CALC, false, 3 }, - { TYPE_AC, CH0, FLD_UAC, UNIT_V, 74, 2, 10, false, 1 }, // dummy - { TYPE_AC, CH0, FLD_UAC_1N, UNIT_V, 68, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_UAC_2N, UNIT_V, 70, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_UAC_3N, UNIT_V, 72, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_UAC_12, UNIT_V, 74, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_UAC_23, UNIT_V, 76, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_UAC_31, UNIT_V, 78, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_F, UNIT_HZ, 80, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PAC, UNIT_W, 82, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_Q, UNIT_VAR, 84, 2, 10, true, 1 }, - { TYPE_AC, CH0, FLD_IAC, UNIT_A, CALC_TOTAL_IAC, 0, CMD_CALC, false, 2 }, - { TYPE_AC, CH0, FLD_IAC_1, UNIT_A, 86, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_IAC_2, UNIT_A, 88, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_IAC_3, UNIT_A, 90, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PF, UNIT_NONE, 92, 2, 1000, false, 3 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC, UNIT_V, 74, 2, 10, false, 1 }, // dummy + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC_1N, UNIT_V, 68, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC_2N, UNIT_V, 70, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC_3N, UNIT_V, 72, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC_12, UNIT_V, 74, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC_23, UNIT_V, 76, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC_31, UNIT_V, 78, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_F, UNIT_HZ, 80, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PAC, UNIT_W, 82, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_Q, UNIT_VAR, 84, 2, 10, true, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_IAC, UNIT_A, CALC_TOTAL_IAC, 0, CMD_CALC, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_IAC_1, UNIT_A, 86, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_IAC_2, UNIT_A, 88, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_IAC_3, UNIT_A, 90, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PF, UNIT_NONE, 92, 2, 1000, false, 3 }, - { TYPE_INV, CH0, FLD_T, UNIT_C, 94, 2, 10, true, 1 }, - { TYPE_INV, CH0, FLD_EVT_LOG, UNIT_NONE, 96, 2, 1, false, 0 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_T, UNIT_C, 94, 2, 10, true, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EVT_LOG, UNIT_NONE, 96, 2, 1, false, 0 }, - { TYPE_INV, CH0, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, - { TYPE_INV, CH0, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, - { TYPE_INV, CH0, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, - { TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } + { TYPE_INV, CH0, MPPT_NONE, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } }; HMT_6CH::HMT_6CH(HoymilesRadio* radio, const uint64_t serial) diff --git a/lib/Hoymiles/src/inverters/HM_1CH.cpp b/lib/Hoymiles/src/inverters/HM_1CH.cpp index 0f0c64c23..0cacb3cb4 100644 --- a/lib/Hoymiles/src/inverters/HM_1CH.cpp +++ b/lib/Hoymiles/src/inverters/HM_1CH.cpp @@ -5,27 +5,27 @@ #include "HM_1CH.h" static const byteAssign_t byteAssignment[] = { - { TYPE_DC, CH0, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_IDC, UNIT_A, 4, 2, 100, false, 2 }, - { TYPE_DC, CH0, FLD_PDC, UNIT_W, 6, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_YD, UNIT_WH, 12, 2, 1, false, 0 }, - { TYPE_DC, CH0, FLD_YT, UNIT_KWH, 8, 4, 1000, false, 3 }, - { TYPE_DC, CH0, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, + { TYPE_DC, CH0, MPPT_A, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_IDC, UNIT_A, 4, 2, 100, false, 2 }, + { TYPE_DC, CH0, MPPT_A, FLD_PDC, UNIT_W, 6, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_YD, UNIT_WH, 12, 2, 1, false, 0 }, + { TYPE_DC, CH0, MPPT_A, FLD_YT, UNIT_KWH, 8, 4, 1000, false, 3 }, + { TYPE_DC, CH0, MPPT_A, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, - { TYPE_AC, CH0, FLD_UAC, UNIT_V, 14, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_IAC, UNIT_A, 22, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PAC, UNIT_W, 18, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_Q, UNIT_VAR, 20, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_F, UNIT_HZ, 16, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PF, UNIT_NONE, 24, 2, 1000, false, 3 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC, UNIT_V, 14, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_IAC, UNIT_A, 22, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PAC, UNIT_W, 18, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_Q, UNIT_VAR, 20, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_F, UNIT_HZ, 16, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PF, UNIT_NONE, 24, 2, 1000, false, 3 }, - { TYPE_INV, CH0, FLD_T, UNIT_C, 26, 2, 10, true, 1 }, - { TYPE_INV, CH0, FLD_EVT_LOG, UNIT_NONE, 28, 2, 1, false, 0 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_T, UNIT_C, 26, 2, 10, true, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EVT_LOG, UNIT_NONE, 28, 2, 1, false, 0 }, - { TYPE_INV, CH0, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, - { TYPE_INV, CH0, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, - { TYPE_INV, CH0, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, - { TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } + { TYPE_INV, CH0, MPPT_NONE, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } }; HM_1CH::HM_1CH(HoymilesRadio* radio, const uint64_t serial) diff --git a/lib/Hoymiles/src/inverters/HM_2CH.cpp b/lib/Hoymiles/src/inverters/HM_2CH.cpp index 02dd8ae4f..bffd5b518 100644 --- a/lib/Hoymiles/src/inverters/HM_2CH.cpp +++ b/lib/Hoymiles/src/inverters/HM_2CH.cpp @@ -6,34 +6,34 @@ #include "HM_2CH.h" static const byteAssign_t byteAssignment[] = { - { TYPE_DC, CH0, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_IDC, UNIT_A, 4, 2, 100, false, 2 }, - { TYPE_DC, CH0, FLD_PDC, UNIT_W, 6, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_YD, UNIT_WH, 22, 2, 1, false, 0 }, - { TYPE_DC, CH0, FLD_YT, UNIT_KWH, 14, 4, 1000, false, 3 }, - { TYPE_DC, CH0, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, + { TYPE_DC, CH0, MPPT_A, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_IDC, UNIT_A, 4, 2, 100, false, 2 }, + { TYPE_DC, CH0, MPPT_A, FLD_PDC, UNIT_W, 6, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_YD, UNIT_WH, 22, 2, 1, false, 0 }, + { TYPE_DC, CH0, MPPT_A, FLD_YT, UNIT_KWH, 14, 4, 1000, false, 3 }, + { TYPE_DC, CH0, MPPT_A, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, - { TYPE_DC, CH1, FLD_UDC, UNIT_V, 8, 2, 10, false, 1 }, - { TYPE_DC, CH1, FLD_IDC, UNIT_A, 10, 2, 100, false, 2 }, - { TYPE_DC, CH1, FLD_PDC, UNIT_W, 12, 2, 10, false, 1 }, - { TYPE_DC, CH1, FLD_YD, UNIT_WH, 24, 2, 1, false, 0 }, - { TYPE_DC, CH1, FLD_YT, UNIT_KWH, 18, 4, 1000, false, 3 }, - { TYPE_DC, CH1, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH1, CMD_CALC, false, 3 }, + { TYPE_DC, CH1, MPPT_B, FLD_UDC, UNIT_V, 8, 2, 10, false, 1 }, + { TYPE_DC, CH1, MPPT_B, FLD_IDC, UNIT_A, 10, 2, 100, false, 2 }, + { TYPE_DC, CH1, MPPT_B, FLD_PDC, UNIT_W, 12, 2, 10, false, 1 }, + { TYPE_DC, CH1, MPPT_B, FLD_YD, UNIT_WH, 24, 2, 1, false, 0 }, + { TYPE_DC, CH1, MPPT_B, FLD_YT, UNIT_KWH, 18, 4, 1000, false, 3 }, + { TYPE_DC, CH1, MPPT_B, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH1, CMD_CALC, false, 3 }, - { TYPE_AC, CH0, FLD_UAC, UNIT_V, 26, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_IAC, UNIT_A, 34, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PAC, UNIT_W, 30, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_Q, UNIT_VAR, 32, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_F, UNIT_HZ, 28, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PF, UNIT_NONE, 36, 2, 1000, false, 3 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC, UNIT_V, 26, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_IAC, UNIT_A, 34, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PAC, UNIT_W, 30, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_Q, UNIT_VAR, 32, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_F, UNIT_HZ, 28, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PF, UNIT_NONE, 36, 2, 1000, false, 3 }, - { TYPE_INV, CH0, FLD_T, UNIT_C, 38, 2, 10, true, 1 }, - { TYPE_INV, CH0, FLD_EVT_LOG, UNIT_NONE, 40, 2, 1, false, 0 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_T, UNIT_C, 38, 2, 10, true, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EVT_LOG, UNIT_NONE, 40, 2, 1, false, 0 }, - { TYPE_INV, CH0, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, - { TYPE_INV, CH0, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, - { TYPE_INV, CH0, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, - { TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } + { TYPE_INV, CH0, MPPT_NONE, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } }; HM_2CH::HM_2CH(HoymilesRadio* radio, const uint64_t serial) diff --git a/lib/Hoymiles/src/inverters/HM_4CH.cpp b/lib/Hoymiles/src/inverters/HM_4CH.cpp index 586248b59..0918fc9d7 100644 --- a/lib/Hoymiles/src/inverters/HM_4CH.cpp +++ b/lib/Hoymiles/src/inverters/HM_4CH.cpp @@ -5,48 +5,48 @@ #include "HM_4CH.h" static const byteAssign_t byteAssignment[] = { - { TYPE_DC, CH0, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_IDC, UNIT_A, 4, 2, 100, false, 2 }, - { TYPE_DC, CH0, FLD_PDC, UNIT_W, 8, 2, 10, false, 1 }, - { TYPE_DC, CH0, FLD_YD, UNIT_WH, 20, 2, 1, false, 0 }, - { TYPE_DC, CH0, FLD_YT, UNIT_KWH, 12, 4, 1000, false, 3 }, - { TYPE_DC, CH0, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, - - { TYPE_DC, CH1, FLD_UDC, UNIT_V, CALC_CH_UDC, CH0, CMD_CALC, false, 1 }, - { TYPE_DC, CH1, FLD_IDC, UNIT_A, 6, 2, 100, false, 2 }, - { TYPE_DC, CH1, FLD_PDC, UNIT_W, 10, 2, 10, false, 1 }, - { TYPE_DC, CH1, FLD_YD, UNIT_WH, 22, 2, 1, false, 0 }, - { TYPE_DC, CH1, FLD_YT, UNIT_KWH, 16, 4, 1000, false, 3 }, - { TYPE_DC, CH1, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH1, CMD_CALC, false, 3 }, - - { TYPE_DC, CH2, FLD_UDC, UNIT_V, 24, 2, 10, false, 1 }, - { TYPE_DC, CH2, FLD_IDC, UNIT_A, 26, 2, 100, false, 2 }, - { TYPE_DC, CH2, FLD_PDC, UNIT_W, 30, 2, 10, false, 1 }, - { TYPE_DC, CH2, FLD_YD, UNIT_WH, 42, 2, 1, false, 0 }, - { TYPE_DC, CH2, FLD_YT, UNIT_KWH, 34, 4, 1000, false, 3 }, - { TYPE_DC, CH2, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH2, CMD_CALC, false, 3 }, - - { TYPE_DC, CH3, FLD_UDC, UNIT_V, CALC_CH_UDC, CH2, CMD_CALC, false, 1 }, - { TYPE_DC, CH3, FLD_IDC, UNIT_A, 28, 2, 100, false, 2 }, - { TYPE_DC, CH3, FLD_PDC, UNIT_W, 32, 2, 10, false, 1 }, - { TYPE_DC, CH3, FLD_YD, UNIT_WH, 44, 2, 1, false, 0 }, - { TYPE_DC, CH3, FLD_YT, UNIT_KWH, 38, 4, 1000, false, 3 }, - { TYPE_DC, CH3, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH3, CMD_CALC, false, 3 }, - - { TYPE_AC, CH0, FLD_UAC, UNIT_V, 46, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_IAC, UNIT_A, 54, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PAC, UNIT_W, 50, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_Q, UNIT_VAR, 52, 2, 10, false, 1 }, - { TYPE_AC, CH0, FLD_F, UNIT_HZ, 48, 2, 100, false, 2 }, - { TYPE_AC, CH0, FLD_PF, UNIT_NONE, 56, 2, 1000, false, 3 }, - - { TYPE_INV, CH0, FLD_T, UNIT_C, 58, 2, 10, true, 1 }, - { TYPE_INV, CH0, FLD_EVT_LOG, UNIT_NONE, 60, 2, 1, false, 0 }, - - { TYPE_INV, CH0, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, - { TYPE_INV, CH0, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, - { TYPE_INV, CH0, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, - { TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } + { TYPE_DC, CH0, MPPT_A, FLD_UDC, UNIT_V, 2, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_IDC, UNIT_A, 4, 2, 100, false, 2 }, + { TYPE_DC, CH0, MPPT_A, FLD_PDC, UNIT_W, 8, 2, 10, false, 1 }, + { TYPE_DC, CH0, MPPT_A, FLD_YD, UNIT_WH, 20, 2, 1, false, 0 }, + { TYPE_DC, CH0, MPPT_A, FLD_YT, UNIT_KWH, 12, 4, 1000, false, 3 }, + { TYPE_DC, CH0, MPPT_A, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH0, CMD_CALC, false, 3 }, + + { TYPE_DC, CH1, MPPT_A, FLD_UDC, UNIT_V, CALC_CH_UDC, CH0, CMD_CALC, false, 1 }, + { TYPE_DC, CH1, MPPT_A, FLD_IDC, UNIT_A, 6, 2, 100, false, 2 }, + { TYPE_DC, CH1, MPPT_A, FLD_PDC, UNIT_W, 10, 2, 10, false, 1 }, + { TYPE_DC, CH1, MPPT_A, FLD_YD, UNIT_WH, 22, 2, 1, false, 0 }, + { TYPE_DC, CH1, MPPT_A, FLD_YT, UNIT_KWH, 16, 4, 1000, false, 3 }, + { TYPE_DC, CH1, MPPT_A, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH1, CMD_CALC, false, 3 }, + + { TYPE_DC, CH2, MPPT_B, FLD_UDC, UNIT_V, 24, 2, 10, false, 1 }, + { TYPE_DC, CH2, MPPT_B, FLD_IDC, UNIT_A, 26, 2, 100, false, 2 }, + { TYPE_DC, CH2, MPPT_B, FLD_PDC, UNIT_W, 30, 2, 10, false, 1 }, + { TYPE_DC, CH2, MPPT_B, FLD_YD, UNIT_WH, 42, 2, 1, false, 0 }, + { TYPE_DC, CH2, MPPT_B, FLD_YT, UNIT_KWH, 34, 4, 1000, false, 3 }, + { TYPE_DC, CH2, MPPT_B, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH2, CMD_CALC, false, 3 }, + + { TYPE_DC, CH3, MPPT_B, FLD_UDC, UNIT_V, CALC_CH_UDC, CH2, CMD_CALC, false, 1 }, + { TYPE_DC, CH3, MPPT_B, FLD_IDC, UNIT_A, 28, 2, 100, false, 2 }, + { TYPE_DC, CH3, MPPT_B, FLD_PDC, UNIT_W, 32, 2, 10, false, 1 }, + { TYPE_DC, CH3, MPPT_B, FLD_YD, UNIT_WH, 44, 2, 1, false, 0 }, + { TYPE_DC, CH3, MPPT_B, FLD_YT, UNIT_KWH, 38, 4, 1000, false, 3 }, + { TYPE_DC, CH3, MPPT_B, FLD_IRR, UNIT_PCT, CALC_CH_IRR, CH3, CMD_CALC, false, 3 }, + + { TYPE_AC, CH0, MPPT_NONE, FLD_UAC, UNIT_V, 46, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_IAC, UNIT_A, 54, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PAC, UNIT_W, 50, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_Q, UNIT_VAR, 52, 2, 10, false, 1 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_F, UNIT_HZ, 48, 2, 100, false, 2 }, + { TYPE_AC, CH0, MPPT_NONE, FLD_PF, UNIT_NONE, 56, 2, 1000, false, 3 }, + + { TYPE_INV, CH0, MPPT_NONE, FLD_T, UNIT_C, 58, 2, 10, true, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EVT_LOG, UNIT_NONE, 60, 2, 1, false, 0 }, + + { TYPE_INV, CH0, MPPT_NONE, FLD_YD, UNIT_WH, CALC_TOTAL_YD, 0, CMD_CALC, false, 0 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_YT, UNIT_KWH, CALC_TOTAL_YT, 0, CMD_CALC, false, 3 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_PDC, UNIT_W, CALC_TOTAL_PDC, 0, CMD_CALC, false, 1 }, + { TYPE_INV, CH0, MPPT_NONE, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 } }; HM_4CH::HM_4CH(HoymilesRadio* radio, const uint64_t serial) diff --git a/lib/Hoymiles/src/parser/StatisticsParser.cpp b/lib/Hoymiles/src/parser/StatisticsParser.cpp index bd4056113..5b6ba9ee8 100644 --- a/lib/Hoymiles/src/parser/StatisticsParser.cpp +++ b/lib/Hoymiles/src/parser/StatisticsParser.cpp @@ -301,6 +301,31 @@ std::list StatisticsParser::getChannelsByType(const ChannelType_t return l; } +std::list StatisticsParser::getMppts() const +{ + std::list l; + for (uint8_t i = 0; i < _byteAssignmentSize; i++) { + if (_byteAssignment[i].mppt != MPPT_NONE) { + l.push_back(_byteAssignment[i].mppt); + } + } + l.unique(); + return l; +} + +std::list StatisticsParser::getChannelsByMppt(const MpptNum_t mppt) const +{ + std::list l; + for (uint8_t i = 0; i < _byteAssignmentSize; i++) { + if (_byteAssignment[i].mppt == mppt) { + l.push_back(_byteAssignment[i].ch); + } + } + l.unique(); + return l; +} + + uint16_t StatisticsParser::getStringMaxPower(const uint8_t channel) const { return _stringMaxPower[channel]; diff --git a/lib/Hoymiles/src/parser/StatisticsParser.h b/lib/Hoymiles/src/parser/StatisticsParser.h index 90b9a5a9f..3e96a01c6 100644 --- a/lib/Hoymiles/src/parser/StatisticsParser.h +++ b/lib/Hoymiles/src/parser/StatisticsParser.h @@ -76,6 +76,16 @@ enum ChannelNum_t { CH_CNT }; +// MPPT_NONE is sued for non string values +enum MpptNum_t { + MPPT_A, + MPPT_B, + MPPT_C, + MPPT_D, + MPPT_CNT, + MPPT_NONE = 0xff, +}; + enum ChannelType_t { TYPE_AC = 0, TYPE_DC, @@ -86,6 +96,7 @@ const char* const channelsTypes[] = { "AC", "DC", "INV" }; typedef struct { ChannelType_t type; ChannelNum_t ch; // channel 0 - 5 + MpptNum_t mppt; // assigned MPPT FieldId_t fieldId; // field id UnitId_t unitId; // uint id uint8_t start; // pos of first byte in buffer @@ -133,6 +144,9 @@ class StatisticsParser : public Parser { const char* getChannelTypeName(const ChannelType_t type) const; std::list getChannelsByType(const ChannelType_t type) const; + std::list getMppts() const; + std::list getChannelsByMppt(const MpptNum_t mppt) const; + uint16_t getStringMaxPower(const uint8_t channel) const; void setStringMaxPower(const uint8_t channel, const uint16_t power); diff --git a/src/PowerLimiterSolarInverter.cpp b/src/PowerLimiterSolarInverter.cpp index 2e2fc5d38..59bb7392b 100644 --- a/src/PowerLimiterSolarInverter.cpp +++ b/src/PowerLimiterSolarInverter.cpp @@ -74,15 +74,12 @@ uint16_t PowerLimiterSolarInverter::scaleLimit(uint16_t expectedOutputWatts) auto pStats = _spInverter->Statistics(); std::list dcChnls = pStats->getChannelsByType(TYPE_DC); + std::list dcMppts = pStats->getMppts(); size_t dcTotalChnls = dcChnls.size(); + size_t dcTotalMppts = dcMppts.size(); - // according to the upstream projects README (table with supported devs), - // every 2 channel inverter has 2 MPPTs. then there are the HM*S* 4 channel - // models which have 4 MPPTs. all others have a different number of MPPTs - // than inputs. those are not supported by the current scaling mechanism. - bool supported = dcTotalChnls == 2; - supported |= dcTotalChnls == 4 && HMS_4CH::isValidSerial(getSerial()); - if (!supported) { return expectedOutputWatts; } + // if there is only one MPPT available, there is nothing we can do + if (dcTotalMppts <= 1) { return expectedOutputWatts; } // test for a reasonable power limit that allows us to assume that an input // channel with little energy is actually not producing, rather than @@ -101,37 +98,42 @@ uint16_t PowerLimiterSolarInverter::scaleLimit(uint16_t expectedOutputWatts) inverterEfficiencyFactor = (inverterEfficiencyFactor > 0) ? inverterEfficiencyFactor/100 : 0.967; // 98% of the expected power is good enough - auto expectedAcPowerPerChannel = (getCurrentLimitWatts() / dcTotalChnls) * 0.98; + auto expectedAcPowerPerMppt = (getCurrentLimitWatts() / dcTotalMppts) * 0.98; if (_verboseLogging) { - MessageOutput.printf("%s expected AC power per channel %f W\r\n", - _logPrefix, expectedAcPowerPerChannel); + MessageOutput.printf("%s expected AC power per mppt %f W\r\n", + _logPrefix, expectedAcPowerPerMppt); } - size_t dcShadedChnls = 0; + size_t dcShadedMppts = 0; auto shadedChannelACPowerSum = 0.0; - for (auto& c : dcChnls) { - auto channelPowerAC = pStats->getChannelFieldValue(TYPE_DC, c, FLD_PDC) * inverterEfficiencyFactor; + for (auto& m : dcMppts) { + float mpptPowerAC = 0.0; + std::list mpptChnls = pStats->getChannelsByMppt(m); - if (channelPowerAC < expectedAcPowerPerChannel) { - dcShadedChnls++; - shadedChannelACPowerSum += channelPowerAC; + for (auto& c : mpptChnls) { + mpptPowerAC += pStats->getChannelFieldValue(TYPE_DC, c, FLD_PDC) * inverterEfficiencyFactor; + } + + if (mpptPowerAC < expectedAcPowerPerMppt) { + dcShadedMppts++; + shadedChannelACPowerSum += mpptPowerAC; } if (_verboseLogging) { - MessageOutput.printf("%s ch %d AC power %f W\r\n", - _logPrefix, c, channelPowerAC); + MessageOutput.printf("%s mppt-%c AC power %f W\r\n", + _logPrefix, m + 'a', mpptPowerAC); } } // no shading or the shaded channels provide more power than what // we currently need. - if (dcShadedChnls == 0 || shadedChannelACPowerSum >= expectedOutputWatts) { + if (dcShadedMppts == 0 || shadedChannelACPowerSum >= expectedOutputWatts) { return expectedOutputWatts; } - if (dcShadedChnls == dcTotalChnls) { + if (dcShadedMppts == dcTotalMppts) { // keep the currentLimit when: // - all channels are shaded // - currentLimit >= expectedOutputWatts @@ -139,7 +141,7 @@ uint16_t PowerLimiterSolarInverter::scaleLimit(uint16_t expectedOutputWatts) if (getCurrentLimitWatts() >= expectedOutputWatts && inverterOutputAC <= expectedOutputWatts) { if (_verboseLogging) { - MessageOutput.printf("%s all channels are shaded, " + MessageOutput.printf("%s all mppts are shaded, " "keeping the current limit of %d W\r\n", _logPrefix, getCurrentLimitWatts()); } @@ -151,31 +153,38 @@ uint16_t PowerLimiterSolarInverter::scaleLimit(uint16_t expectedOutputWatts) } } - size_t dcNonShadedChnls = dcTotalChnls - dcShadedChnls; - uint16_t overScaledLimit = (expectedOutputWatts - shadedChannelACPowerSum) / dcNonShadedChnls * dcTotalChnls; + size_t dcNonShadedMppts = dcTotalMppts - dcShadedMppts; + uint16_t overScaledLimit = (expectedOutputWatts - shadedChannelACPowerSum) / dcNonShadedMppts * dcTotalMppts; if (overScaledLimit <= expectedOutputWatts) { return expectedOutputWatts; } if (_verboseLogging) { - MessageOutput.printf("%s %d/%d channels are shaded, scaling %d W\r\n", - _logPrefix, dcShadedChnls, dcTotalChnls, overScaledLimit); + MessageOutput.printf("%s %d/%d mppts are shaded, scaling %d W\r\n", + _logPrefix, dcShadedMppts, dcTotalMppts, overScaledLimit); } return overScaledLimit; } - size_t dcProdChnls = 0; - for (auto& c : dcChnls) { - if (pStats->getChannelFieldValue(TYPE_DC, c, FLD_PDC) > 2.0) { - dcProdChnls++; + size_t dcProdMppts = 0; + for (auto& m : dcMppts) { + float dcPowerMppt = 0.0; + std::list mpptChnls = pStats->getChannelsByMppt(m); + + for (auto& c : mpptChnls) { + dcPowerMppt += pStats->getChannelFieldValue(TYPE_DC, c, FLD_PDC); + } + + if (dcPowerMppt > 2.0 * mpptChnls.size()) { + dcProdMppts++; } } - if (dcProdChnls == 0 || dcProdChnls == dcTotalChnls) { return expectedOutputWatts; } + if (dcProdMppts == 0 || dcProdMppts == dcTotalMppts) { return expectedOutputWatts; } - uint16_t scaled = expectedOutputWatts / dcProdChnls * dcTotalChnls; - MessageOutput.printf("%s %d/%d channels are producing, scaling from %d to " - "%d W\r\n", _logPrefix, dcProdChnls, dcTotalChnls, + uint16_t scaled = expectedOutputWatts / dcProdMppts * dcTotalMppts; + MessageOutput.printf("%s %d/%d mppts are producing, scaling from %d to " + "%d W\r\n", _logPrefix, dcProdMppts, dcTotalMppts, expectedOutputWatts, scaled); return scaled;