jomjol / AI-on-the-edge-device

Easy to use device for connecting "old" measuring units (water, power, gas, ...) to the digital world
https://jomjol.github.io/AI-on-the-edge-device-docs/
5.67k stars 612 forks source link

Wrong Raw Value? #2857

Open Kornelius777 opened 7 months ago

Kornelius777 commented 7 months ago

The Problem

Raw Value is 1 m³ too small. Despite the Recognized Values are correct, the Raw Value is calculated "one less" (see attached picture)

Version

v15.5.0

Logfile

[0d00h00m00s] 2024-02-03T10:13:22 <INF> [MAIN] =================================================
[0d00h00m00s] 2024-02-03T10:13:22 <INF> [MAIN] ==================== Start ======================
[0d00h00m00s] 2024-02-03T10:13:22 <INF> [MAIN] =================================================
[0d00h00m00s] 2024-02-03T10:13:22 <INF> [MAIN] PSRAM size: 8388608 byte (8MB / 64MBit)
[0d00h00m00s] 2024-02-03T10:13:22 <INF> [MAIN] Total heap: 4380111 byte
[0d00h00m04s] 2024-02-03T10:13:26 <INF> [MAIN] Camera info: PID: 0x26, VER: 0x42, MIDL: 0x7f, MIDH: 0xa2
[0d00h00m04s] 2024-02-03T10:13:26 <INF> [SDCARD] Basic R/W check started...
[0d00h00m04s] 2024-02-03T10:13:26 <INF> [SDCARD] Basic R/W check successful
[0d00h00m04s] 2024-02-03T10:13:26 <INF> [SNTP] TimeServer: pool.ntp.org
[0d00h00m04s] 2024-02-03T10:13:26 <INF> [SNTP] Configuring NTP Client...
[0d00h00m04s] 2024-02-03T11:13:26 <INF> [SNTP] Time zone set to CET-1CEST,M3.5.0,M10.5.0/3
[0d00h00m04s] 2024-02-03T11:13:27 <INF> [SNTP] time zone: +0100 Delta to UTC: 3600 seconds
[0d00h00m04s] 2024-02-03T11:13:27 <INF> [SNTP] Time is already set: 2024-02-03 11:13:27
[0d00h00m04s] 2024-02-03T11:13:27 <INF> [MAIN] CPU frequency: 160 MHz
[0d00h00m04s] 2024-02-03T11:13:27 <INF> [SDCARD] Folder/file presence check started...
[0d00h00m05s] 2024-02-03T11:13:27 <INF> [SDCARD] Folder/file presence check successful
[0d00h00m05s] 2024-02-03T11:13:27 <INF> [MAIN] Tag: 'v15.5.0', Release: v15.5.0 (Commit: 019069c+), Date/Time: 2024-02-02 12:57, Web UI: Release: v15.5.0 (Commit: 019069c+)
[0d00h00m05s] 2024-02-03T11:13:27 <INF> [MAIN] Reset reason: Via esp_restart
[0d00h00m05s] 2024-02-03T11:13:27 <INF> [WLANINI] SSID: XXXXXXXX
[0d00h00m05s] 2024-02-03T11:13:27 <INF> [WLANINI] Password: XXXXXXXX
[0d00h00m05s] 2024-02-03T11:13:27 <INF> [WLANINI] Hostname: watermeter
[0d00h00m05s] 2024-02-03T11:13:27 <INF> [WLANINI] DNS: 192.168.150.199
[0d00h00m05s] 2024-02-03T11:13:27 <INF> [MAIN] WLAN config loaded, init WIFI...
[0d00h00m05s] 2024-02-03T11:13:27 <INF> [WIFI] Automatic interface config --> Use DHCP service
[0d00h00m05s] 2024-02-03T11:13:27 <INF> [WIFI] Set hostname to: watermeter
[0d00h00m05s] 2024-02-03T11:13:27 <INF> [WIFI] Init successful
[0d00h00m08s] 2024-02-03T11:13:30 <INF> [WIFI] Connected to: XXXXXXXX, RSSI: -52
[0d00h00m09s] 2024-02-03T11:13:32 <INF> [WIFI] Assigned IP: 10.10.4.230
[0d00h00m09s] 2024-02-03T08:15:03 <INF> [SNTP] Time is synced with NTP Server pool.ntp.org: 2024-02-03 08:15:03
[0d00h00m11s] 2024-02-03T08:15:04 <INF> [MAIN] Device info: CPU cores: 2, Chip revision: 100
[0d00h00m11s] 2024-02-03T08:15:04 <INF> [MAIN] SD card info: Name: USD00, Capacity: 60350MB, Free: 998MB
[0d00h00m13s] 2024-02-03T08:15:06 <INF> [MAIN] Initialization completed successfully
[0d00h00m16s] 2024-02-03T08:15:09 <INF> [LOGFILE] Set log level to INFO
[0d00h00m16s] 2024-02-03T08:15:09 <INF> [MQTT IF] Init
[0d00h00m16s] 2024-02-03T08:15:09 <INF> [MQTT IF] Client started, waiting for established connection...
[0d00h00m16s] 2024-02-03T08:15:09 <INF> [MAINCTRL] Starting Flow...
[0d00h00m16s] 2024-02-03T08:15:09 <INF> [MAINCTRL] Round #1 started
[0d00h01m02s] 2024-02-03T08:15:55 <ERR> [POSTPROC] main: Raw: 01016.5170, Value: , Status: Neg. Rate - Read: - Raw: 01016.5170 - Pre: 1017.5660
[0d00h01m02s] 2024-02-03T08:15:55 <INF> [MAINCTRL] Round #1 completed (46 seconds)
[0d00h02m45s] 2024-02-03T08:17:38 <INF> [POSTPROC] SetPreValue: PreValue for main set to 1017.510000
[0d00h03m20s] 2024-02-03T08:18:13 <INF> [MAINCTRL] Round #2 started
[0d00h04m05s] 2024-02-03T08:18:58 <ERR> [POSTPROC] main: Raw: 01016.5170, Value: , Status: Neg. Rate - Read: - Raw: 01016.5170 - Pre: 1017.5100
[0d00h04m05s] 2024-02-03T08:18:59 <INF> [MAINCTRL] Round #2 completed (45 seconds)
[0d00h05m52s] 2024-02-03T08:20:46 <INF> [POSTPROC] SetPreValue: PreValue for main set to 1016.517000
[0d00h06m09s] 2024-02-03T08:21:02 <INF> [MAINCTRL] Round #3 started
[0d00h06m54s] 2024-02-03T08:21:47 <INF> [POSTPROC] main: Raw: 01016.5170, Value: 1016.5170, Status: no error
[0d00h06m54s] 2024-02-03T08:21:47 <INF> [MAINCTRL] Round #3 completed (45 seconds)

Expected Behavior

No response

Screenshots

Bildschirmfoto vom 2024-02-03 08-23-37

Additional Context

No response

JWRu commented 7 months ago

I have the same problem after updating to Release 15.6.0. However, the raw value is only false (least significant digit of the digital section) when the analog recognition is used. My other devices (electricity meter, gas meter) show a correct raw value.

Please test and provide feedback for this updated development version, which uses post-processing logic from 15.4 again. Firmware for testing can be downloaded here: https://github.com/jomjol/AI-on-the-edge-device/actions/runs/7878286347

There are alignment problems with this version:

Bildschirmfoto 2024-02-13 um 19 51 55

This is 15.6.0:

Bildschirmfoto 2024-02-13 um 19 55 16
caco3 commented 7 months ago

There was an issue in v15.5, maybe it is related to your issue, please update to rolling where we reverted this regression (https://github.com/jomjol/AI-on-the-edge-device/pull/2778). See https://github.com/jomjol/AI-on-the-edge-device/pull/2899

There are alignment problems with this version

This is most likely a different issue, please make sure the Reference marks are as far apart as possible and have good contrast.

JWRu commented 7 months ago

There was an issue in v15.5, maybe it is related to your issue, please update to rolling where we reverted this regression (#2778). See #2899

There are alignment problems with this version

This is most likely a different issue, please make sure the Reference marks are as far apart as possible and have good contrast.

I downgraded to 15.3.0 - everything is running flawlessly now.

caco3 commented 7 months ago

We just released v15.7.0 which hopefully fixes this issue.

gabimal commented 2 months ago

Hi guys, I do have those readings and I do not undestand them:

sb1 sb2

Every time that the fractions digit goes from 9 to 0, the readings are without the leading 0. Is this the correct behaviour? Could the missing 0 affect the values seen in Home Assistant like this? There is a helper that transforms cubic meters to liters and shows the values in HA but they are negative.

sb3

Also the main value should be 301 instead of 300. Maybe my meter is not so good and the digits are not changing full but the recognition should "see" 301 in this case.

Release: v15.7.0 (Commit: 0d0b018+)

Any help is much apprecitated, thank you in advance!

SybexX commented 2 months ago

@gabimal Is there a reason why you don't let all digits evaluate as one complete number? So you probably won't get rid of your problem. Let all digits be processed as one number and simply use Decimal Shift to add the comma. https://jomjol.github.io/AI-on-the-edge-device-docs/Correction%20Algorithm/#decimalshift

gabimal commented 2 months ago

@SybexX thank you for your quick answer! At one point I was thinking to use all digits as one number as you mentioned but I was unsure how it will behave. In this case the decimal shift will be -3?

LE: I have added another 3 digits and got 6 in total:

dig

SybexX commented 2 months ago

@gabimal yes, exactly -3 is correct. Since your counter apparently also counts down, you also have to activate "Allow Negative Rate". https://jomjol.github.io/AI-on-the-edge-device-docs/Correction%20Algorithm/#allownegativerates

gabimal commented 2 months ago

@SybexX Thank you for confirming the decimal shift value! I'm not sure I understand what you are saying by meter counting down. It's a water meter that counts only up.

SybexX commented 2 months ago

@gabimal Your counter once had 301,051 and in your last picture it has 299,667, from this I conclude that he also counts back

gabimal commented 2 months ago

@SybexX Sorry about that. The first picture is the present meter reading and the second image (with all new 6 digits) is the reference image took a while ago. Thank you very much for your help and patience!

Hausi91 commented 1 day ago

Hi! I'm also not sure how these raw values are calculated, as the recognition values look good to me. However, the raw value's decimals show something completely different than i expect, and I have no idea why. The "Decimal-Shift" was set to 0, and unchecking the box had no effect.

Could someone help, or is this the bug? Thanks!

Raw values: (the Pre Value in this log was manually set by me)

[POSTPROC] main: Raw: 059.0761, Value: , Status: Neg. Rate - Read:  - Raw: 059.0761 - Pre: 59.1507
[POSTPROC] main: Raw: 059.0761, Value: , Status: Neg. Rate - Read:  - Raw: 059.0761 - Pre: 59.1507 
[POSTPROC] main: Raw: 059.0771, Value: , Status: Neg. Rate - Read:  - Raw: 059.0771 - Pre: 59.1507 
[POSTPROC] main: Raw: 059.0761, Value: , Status: Neg. Rate - Read:  - Raw: 059.0761 - Pre: 59.1507 
[POSTPROC] main: Raw: 059.0771, Value: , Status: Neg. Rate - Read:  - Raw: 059.0771 - Pre: 59.1507 
[POSTPROC] main: Raw: 059.0771, Value: , Status: Neg. Rate - Read:  - Raw: 059.0771 - Pre: 59.1507

watermeter

SybexX commented 1 day ago

@Hausi91 https://jomjol.github.io/AI-on-the-edge-device-docs/Watermeter-specific-analog---digital-transition/

Hausi91 commented 1 day ago

@SybexX Thanks for the quick response! I read the article before, and my Analog/Digital Transition Start is still set to 9.2 (default). However, I'm still unsure what kind of transitions this water meter makes since I've only monitored it for a few hours so far. I'll propably try a Transition setting between 6 and 8 in the morning. Based on the image, does it look like an early transition to you, or is that something we can even see on the watercount i have? I'm not really familiar with reading water meters, to be honest. I thought it was a normal transition, but there also hasn't been so much water flow since I set it up.

SybexX commented 1 day ago

@Hausi91 Always reduce the value gradually, e.g. 9.2 > 9.0 > 8.8 > 8.6......... My water meter behaves similarly and a value of 9.0 works very well for me.

Hausi91 commented 1 day ago

@SybexX Thanks! As soon as I reduced the "Analog/Digital Transition Start" to 9, I'm much closer to the values I expect. Thank you very much. You're the man!