amsreader-firmware icon indicating copy to clipboard operation
amsreader-firmware copied to clipboard

Daily power array zeroing not correct Kamstrup meter

Open Iridabike2 opened this issue 1 year ago • 3 comments

Daily power has an hourly spike as the array needs to be zeroed for hour +1

Code mod needed:

AmsDataStorage.cpp

utc.Hour needs to be +1:

else { if(debugger->isActive(RemoteDebug::DEBUG)) { debugger->printf("(AmsDataStorage) Last day update: %lld\n", (int64_t) day.lastMeterReadTime); } tmElements_t last; breakTime(day.lastMeterReadTime, last); for(int i = last.Hour; i < (utc.Hour + 1) ; i++) { if(debugger->isActive(RemoteDebug::VERBOSE)) { debugger->printf("(AmsDataStorage) Clearing hour: %d\n", i); } setHourImport(i, 0); setHourExport(i, 0); } } Screenshot 2022-08-04 at 17 00 48

Iridabike2 avatar Aug 04 '22 15:08 Iridabike2

Did you actually fix it by doing that? I am assuming you are using realtime/import/day from mqtt?

gskjold avatar Aug 04 '22 18:08 gskjold

Did you actually fix it by doing that? I am assuming you are using realtime/import/day from mqtt?

Yes it fixed it. I have modded the hass mqtt to give me the day and month stats.

Iridabike2 avatar Aug 04 '22 19:08 Iridabike2

I am unable to reproduce your problem with my meter. Your proposed fix also removes a bar from the day graph. I have a different approach I expect to work for you. Firmware attached. esp32.zip esp32s2.zip esp8266.zip

gskjold avatar Aug 10 '22 15:08 gskjold

Fix included in v2.1.6

gskjold avatar Aug 16 '22 10:08 gskjold