Skip to content

Commit

Permalink
Feature: Support DPL overscaling on all inverters
Browse files Browse the repository at this point in the history
this change allows to support overscaling for all inverters, as the configuration of
inputs (which one is part of a particular MPPT) is now provided from withing the
code. this information is used to implement overscaling for any of the inverters
(which are generally compatible with OpenDTU(-OnBattery)).
  • Loading branch information
vaterlangen authored and schlimmchen committed Oct 31, 2024
1 parent b6840fc commit 021a3e3
Show file tree
Hide file tree
Showing 26 changed files with 298 additions and 45 deletions.
14 changes: 14 additions & 0 deletions lib/Hoymiles/src/inverters/HERF_1CH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ static const byteAssign_t byteAssignment[] = {
{ TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 }
};

static const channelMetaData_t channelMetaData[] = {
{ CH0, MPPT_A }
};

HERF_1CH::HERF_1CH(HoymilesRadio* radio, const uint64_t serial)
: HM_Abstract(radio, serial) {};

Expand All @@ -53,3 +57,13 @@ uint8_t HERF_1CH::getByteAssignmentSize() const
{
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
}

const channelMetaData_t* HERF_1CH::getChannelMetaData() const
{
return channelMetaData;
}

uint8_t HERF_1CH::getChannelMetaDataSize() const
{
return sizeof(channelMetaData) / sizeof(channelMetaData[0]);
}
2 changes: 2 additions & 0 deletions lib/Hoymiles/src/inverters/HERF_1CH.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ class HERF_1CH : public HM_Abstract {
String typeName() const;
const byteAssign_t* getByteAssignment() const;
uint8_t getByteAssignmentSize() const;
const channelMetaData_t* getChannelMetaData() const;
uint8_t getChannelMetaDataSize() const;
};
15 changes: 15 additions & 0 deletions lib/Hoymiles/src/inverters/HERF_2CH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ static const byteAssign_t byteAssignment[] = {
{ TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 }
};

static const channelMetaData_t channelMetaData[] = {
{ CH0, MPPT_A },
{ CH1, MPPT_B }
};

HERF_2CH::HERF_2CH(HoymilesRadio* radio, const uint64_t serial)
: HM_Abstract(radio, serial) {};

Expand All @@ -60,3 +65,13 @@ uint8_t HERF_2CH::getByteAssignmentSize() const
{
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
}

const channelMetaData_t* HERF_2CH::getChannelMetaData() const
{
return channelMetaData;
}

uint8_t HERF_2CH::getChannelMetaDataSize() const
{
return sizeof(channelMetaData) / sizeof(channelMetaData[0]);
}
2 changes: 2 additions & 0 deletions lib/Hoymiles/src/inverters/HERF_2CH.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ class HERF_2CH : public HM_Abstract {
String typeName() const;
const byteAssign_t* getByteAssignment() const;
uint8_t getByteAssignmentSize() const;
const channelMetaData_t* getChannelMetaData() const;
uint8_t getChannelMetaDataSize() const;
};
14 changes: 14 additions & 0 deletions lib/Hoymiles/src/inverters/HMS_1CH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ static const byteAssign_t byteAssignment[] = {
{ TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 }
};

static const channelMetaData_t channelMetaData[] = {
{ CH0, MPPT_A }
};

HMS_1CH::HMS_1CH(HoymilesRadio* radio, const uint64_t serial)
: HMS_Abstract(radio, serial) {};

Expand All @@ -52,3 +56,13 @@ uint8_t HMS_1CH::getByteAssignmentSize() const
{
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
}

const channelMetaData_t* HMS_1CH::getChannelMetaData() const
{
return channelMetaData;
}

uint8_t HMS_1CH::getChannelMetaDataSize() const
{
return sizeof(channelMetaData) / sizeof(channelMetaData[0]);
}
4 changes: 3 additions & 1 deletion lib/Hoymiles/src/inverters/HMS_1CH.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ class HMS_1CH : public HMS_Abstract {
String typeName() const;
const byteAssign_t* getByteAssignment() const;
uint8_t getByteAssignmentSize() const;
};
const channelMetaData_t* getChannelMetaData() const;
uint8_t getChannelMetaDataSize() const;
};
14 changes: 14 additions & 0 deletions lib/Hoymiles/src/inverters/HMS_1CHv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ static const byteAssign_t byteAssignment[] = {
{ TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 }
};

static const channelMetaData_t channelMetaData[] = {
{ CH0, MPPT_A }
};

HMS_1CHv2::HMS_1CHv2(HoymilesRadio* radio, const uint64_t serial)
: HMS_Abstract(radio, serial) {};

Expand All @@ -52,3 +56,13 @@ uint8_t HMS_1CHv2::getByteAssignmentSize() const
{
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
}

const channelMetaData_t* HMS_1CHv2::getChannelMetaData() const
{
return channelMetaData;
}

uint8_t HMS_1CHv2::getChannelMetaDataSize() const
{
return sizeof(channelMetaData) / sizeof(channelMetaData[0]);
}
4 changes: 3 additions & 1 deletion lib/Hoymiles/src/inverters/HMS_1CHv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ class HMS_1CHv2 : public HMS_Abstract {
String typeName() const;
const byteAssign_t* getByteAssignment() const;
uint8_t getByteAssignmentSize() const;
};
const channelMetaData_t* getChannelMetaData() const;
uint8_t getChannelMetaDataSize() const;
};
15 changes: 15 additions & 0 deletions lib/Hoymiles/src/inverters/HMS_2CH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ static const byteAssign_t byteAssignment[] = {
{ TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 }
};

static const channelMetaData_t channelMetaData[] = {
{ CH0, MPPT_A },
{ CH1, MPPT_B }
};

HMS_2CH::HMS_2CH(HoymilesRadio* radio, const uint64_t serial)
: HMS_Abstract(radio, serial) {};

Expand All @@ -59,3 +64,13 @@ uint8_t HMS_2CH::getByteAssignmentSize() const
{
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
}

const channelMetaData_t* HMS_2CH::getChannelMetaData() const
{
return channelMetaData;
}

uint8_t HMS_2CH::getChannelMetaDataSize() const
{
return sizeof(channelMetaData) / sizeof(channelMetaData[0]);
}
4 changes: 3 additions & 1 deletion lib/Hoymiles/src/inverters/HMS_2CH.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ class HMS_2CH : public HMS_Abstract {
String typeName() const;
const byteAssign_t* getByteAssignment() const;
uint8_t getByteAssignmentSize() const;
};
const channelMetaData_t* getChannelMetaData() const;
uint8_t getChannelMetaDataSize() const;
};
17 changes: 17 additions & 0 deletions lib/Hoymiles/src/inverters/HMS_4CH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ static const byteAssign_t byteAssignment[] = {
{ TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 }
};

static const channelMetaData_t channelMetaData[] = {
{ CH0, MPPT_A },
{ CH1, MPPT_B },
{ CH2, MPPT_C },
{ CH3, MPPT_D }
};

HMS_4CH::HMS_4CH(HoymilesRadio* radio, const uint64_t serial)
: HMS_Abstract(radio, serial) {};

Expand All @@ -73,3 +80,13 @@ uint8_t HMS_4CH::getByteAssignmentSize() const
{
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
}

const channelMetaData_t* HMS_4CH::getChannelMetaData() const
{
return channelMetaData;
}

uint8_t HMS_4CH::getChannelMetaDataSize() const
{
return sizeof(channelMetaData) / sizeof(channelMetaData[0]);
}
4 changes: 3 additions & 1 deletion lib/Hoymiles/src/inverters/HMS_4CH.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ class HMS_4CH : public HMS_Abstract {
String typeName() const;
const byteAssign_t* getByteAssignment() const;
uint8_t getByteAssignmentSize() const;
};
const channelMetaData_t* getChannelMetaData() const;
uint8_t getChannelMetaDataSize() const;
};
17 changes: 17 additions & 0 deletions lib/Hoymiles/src/inverters/HMT_4CH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ static const byteAssign_t byteAssignment[] = {
{ TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 }
};

static const channelMetaData_t channelMetaData[] = {
{ CH0, MPPT_A },
{ CH1, MPPT_A },
{ CH2, MPPT_B },
{ CH3, MPPT_B }
};

HMT_4CH::HMT_4CH(HoymilesRadio* radio, const uint64_t serial)
: HMT_Abstract(radio, serial) {};

Expand All @@ -82,3 +89,13 @@ uint8_t HMT_4CH::getByteAssignmentSize() const
{
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
}

const channelMetaData_t* HMT_4CH::getChannelMetaData() const
{
return channelMetaData;
}

uint8_t HMT_4CH::getChannelMetaDataSize() const
{
return sizeof(channelMetaData) / sizeof(channelMetaData[0]);
}
4 changes: 3 additions & 1 deletion lib/Hoymiles/src/inverters/HMT_4CH.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ class HMT_4CH : public HMT_Abstract {
String typeName() const;
const byteAssign_t* getByteAssignment() const;
uint8_t getByteAssignmentSize() const;
};
const channelMetaData_t* getChannelMetaData() const;
uint8_t getChannelMetaDataSize() const;
};
19 changes: 19 additions & 0 deletions lib/Hoymiles/src/inverters/HMT_6CH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ static const byteAssign_t byteAssignment[] = {
{ TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 }
};

static const channelMetaData_t channelMetaData[] = {
{ CH0, MPPT_A },
{ CH1, MPPT_A },
{ CH2, MPPT_B },
{ CH3, MPPT_B },
{ CH4, MPPT_C },
{ CH5, MPPT_C }
};

HMT_6CH::HMT_6CH(HoymilesRadio* radio, const uint64_t serial)
: HMT_Abstract(radio, serial) {};

Expand All @@ -96,3 +105,13 @@ uint8_t HMT_6CH::getByteAssignmentSize() const
{
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
}

const channelMetaData_t* HMT_6CH::getChannelMetaData() const
{
return channelMetaData;
}

uint8_t HMT_6CH::getChannelMetaDataSize() const
{
return sizeof(channelMetaData) / sizeof(channelMetaData[0]);
}
4 changes: 3 additions & 1 deletion lib/Hoymiles/src/inverters/HMT_6CH.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ class HMT_6CH : public HMT_Abstract {
String typeName() const;
const byteAssign_t* getByteAssignment() const;
uint8_t getByteAssignmentSize() const;
};
const channelMetaData_t* getChannelMetaData() const;
uint8_t getChannelMetaDataSize() const;
};
14 changes: 14 additions & 0 deletions lib/Hoymiles/src/inverters/HM_1CH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ static const byteAssign_t byteAssignment[] = {
{ TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 }
};

static const channelMetaData_t channelMetaData[] = {
{ CH0, MPPT_A }
};

HM_1CH::HM_1CH(HoymilesRadio* radio, const uint64_t serial)
: HM_Abstract(radio, serial) {};

Expand Down Expand Up @@ -65,3 +69,13 @@ uint8_t HM_1CH::getByteAssignmentSize() const
{
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
}

const channelMetaData_t* HM_1CH::getChannelMetaData() const
{
return channelMetaData;
}

uint8_t HM_1CH::getChannelMetaDataSize() const
{
return sizeof(channelMetaData) / sizeof(channelMetaData[0]);
}
4 changes: 3 additions & 1 deletion lib/Hoymiles/src/inverters/HM_1CH.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ class HM_1CH : public HM_Abstract {
String typeName() const;
const byteAssign_t* getByteAssignment() const;
uint8_t getByteAssignmentSize() const;
};
const channelMetaData_t* getChannelMetaData() const;
uint8_t getChannelMetaDataSize() const;
};
15 changes: 15 additions & 0 deletions lib/Hoymiles/src/inverters/HM_2CH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ static const byteAssign_t byteAssignment[] = {
{ TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 }
};

static const channelMetaData_t channelMetaData[] = {
{ CH0, MPPT_A },
{ CH1, MPPT_B }
};

HM_2CH::HM_2CH(HoymilesRadio* radio, const uint64_t serial)
: HM_Abstract(radio, serial) {};

Expand Down Expand Up @@ -73,3 +78,13 @@ uint8_t HM_2CH::getByteAssignmentSize() const
{
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
}

const channelMetaData_t* HM_2CH::getChannelMetaData() const
{
return channelMetaData;
}

uint8_t HM_2CH::getChannelMetaDataSize() const
{
return sizeof(channelMetaData) / sizeof(channelMetaData[0]);
}
4 changes: 3 additions & 1 deletion lib/Hoymiles/src/inverters/HM_2CH.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ class HM_2CH : public HM_Abstract {
String typeName() const;
const byteAssign_t* getByteAssignment() const;
uint8_t getByteAssignmentSize() const;
};
const channelMetaData_t* getChannelMetaData() const;
uint8_t getChannelMetaDataSize() const;
};
17 changes: 17 additions & 0 deletions lib/Hoymiles/src/inverters/HM_4CH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ static const byteAssign_t byteAssignment[] = {
{ TYPE_INV, CH0, FLD_EFF, UNIT_PCT, CALC_TOTAL_EFF, 0, CMD_CALC, false, 3 }
};

static const channelMetaData_t channelMetaData[] = {
{ CH0, MPPT_A },
{ CH1, MPPT_A },
{ CH2, MPPT_B },
{ CH3, MPPT_B }
};

HM_4CH::HM_4CH(HoymilesRadio* radio, const uint64_t serial)
: HM_Abstract(radio, serial) {};

Expand Down Expand Up @@ -86,3 +93,13 @@ uint8_t HM_4CH::getByteAssignmentSize() const
{
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
}

const channelMetaData_t* HM_4CH::getChannelMetaData() const
{
return channelMetaData;
}

uint8_t HM_4CH::getChannelMetaDataSize() const
{
return sizeof(channelMetaData) / sizeof(channelMetaData[0]);
}
4 changes: 3 additions & 1 deletion lib/Hoymiles/src/inverters/HM_4CH.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ class HM_4CH : public HM_Abstract {
String typeName() const;
const byteAssign_t* getByteAssignment() const;
uint8_t getByteAssignmentSize() const;
};
const channelMetaData_t* getChannelMetaData() const;
uint8_t getChannelMetaDataSize() const;
};
Loading

0 comments on commit 021a3e3

Please sign in to comment.