diff --git a/src/hm/hmInverter.h b/src/hm/hmInverter.h index bbe859de..3575e94a 100644 --- a/src/hm/hmInverter.h +++ b/src/hm/hmInverter.h @@ -264,9 +264,9 @@ class Inverter { val <<= 8; val |= buf[ptr]; } while(++ptr != end); - if (FLD_T == rec->assign[pos].fieldId) { - // temperature is a signed value! - rec->record[pos] = (REC_TYP)((int16_t)val) / (REC_TYP)(div); + if ((FLD_T == rec->assign[pos].fieldId) || (FLD_Q == rec->assign[pos].fieldId) || (FLD_PF == rec->assign[pos].fieldId)) { + // temperature, Qvar, and power factor are a signed values + rec->record[pos] = ((REC_TYP)((int16_t)val)) / (REC_TYP)(div); } else if (FLD_YT == rec->assign[pos].fieldId) { rec->record[pos] = ((REC_TYP)(val) / (REC_TYP)(div)) + ((REC_TYP)config->yieldCor[rec->assign[pos].ch-1]); } else { diff --git a/src/hms/hmsDefines.h b/src/hms/hmsDefines.h index 2083783a..7246dd5b 100644 --- a/src/hms/hmsDefines.h +++ b/src/hms/hmsDefines.h @@ -43,7 +43,7 @@ const byteAssign_t hms4chAssignment[] = { { FLD_PAC, UNIT_W, CH0, 54, 2, 10 }, { FLD_Q, UNIT_VAR, CH0, 56, 2, 10 }, // signed! { FLD_IAC, UNIT_A, CH0, 58, 2, 100 }, - { FLD_PF, UNIT_NONE, CH0, 60, 2, 1000 }, + { FLD_PF, UNIT_NONE, CH0, 60, 2, 1000 }, // signed! { FLD_T, UNIT_C, CH0, 62, 2, 10 }, // signed! { FLD_EVT, UNIT_NONE, CH0, 64, 2, 1 }, { FLD_YD, UNIT_WH, CH0, CALC_YD_CH0, 0, CMD_CALC },