corrected MQTT comm_disabled #529

fix Prometheus and JSON endpoints (`config_override.h`) #561
publish MQTT with fixed interval even if inverter is not available #542
added JSON settings upload. NOTE: settings JSON download changed, so only settings should be uploaded starting from version `0.5.70` #551
MQTT topic and inverter name have more allowed characters: `[A-Za-z0-9./#$%&=+_-]+`, thx: @Mo Demman
improved potential issue with `checkTicker`, thx @cbscpe
MQTT option for reset values on midnight / not avail / communication stop #539
small fix in `tickIVCommunication` #534
add `YieldTotal` correction, eg. to have the option to zero at year start #512
This commit is contained in:
lumapu 2023-01-08 22:16:14 +01:00
parent 4265856814
commit d8e255ddc2
16 changed files with 346 additions and 218 deletions

View file

@ -233,11 +233,13 @@ class Inverter {
val <<= 8;
val |= buf[ptr];
} while(++ptr != end);
if(FLD_T == rec->assign[pos].fieldId) {
if (FLD_T == rec->assign[pos].fieldId) {
// temperature is a signed value!
rec->record[pos] = (REC_TYP)((int16_t)val) / (REC_TYP)(div);
}
else {
} else if ((FLD_YT == rec->assign[pos].fieldId)
&& (config->yieldCor != 0)) {
rec->record[pos] = (REC_TYP)(val) / (REC_TYP)(div) - (REC_TYP)config->yieldCor;
} else {
if ((REC_TYP)(div) > 1)
rec->record[pos] = (REC_TYP)(val) / (REC_TYP)(div);
else
@ -286,6 +288,16 @@ class Inverter {
DPRINTLN(DBG_ERROR, F("addValue: assignment not found with cmd 0x"));
}
bool setValue(uint8_t pos, record_t<> *rec, REC_TYP val) {
DPRINTLN(DBG_VERBOSE, F("hmInverter.h:setValue"));
if(NULL == rec)
return false;
if(pos > rec->length)
return false;
rec->record[pos] = val;
return true;
}
REC_TYP getValue(uint8_t pos, record_t<> *rec) {
DPRINTLN(DBG_VERBOSE, F("hmInverter.h:getValue"));
if(NULL == rec)