martijnvwezel / watermeter-esphome

18 stars 7 forks source link

water meter reports wrong / too low consumption values after some days of operation #48

Open thoha1970 opened 3 weeks ago

thoha1970 commented 3 weeks ago

Hi Martijn, we've already had some chats via Tindie & WhatsApp a few month ago regarding this problem.

Problem: Water meter is working well and reporting correct values of consumption after a power cycle for a few days (approx.1, 2 or 3 days) Then the problem starts: the device still record all consumptions, but with very low values (1 - 2 liters, sometimes negative values of -1, -2 liters), even if the real consumption is in a range of e.g. 4 - 50 liters). After a power cycle the water meter again starts to record the proper values until a few days later the problem starts again.

What I've done so far for trouble shooting this problem:

Wifi connection is stable and all the time in a range of -50 - -70 dB (I've created an entity for Wifi signal strenght in order to monitor that).

I've activated log level INFO and found following interesting records:

In case the problem is not existing, following min / max average is logged: [I][max_average:664]: a:142 b:426 c:108 ][I][min_average:667]: a:14 b:16 c:10

In case the problem is existing, following min / max average is logged (values no more change, all the time only "10" is logged): [I][max_average:664]: a:10 b:10 c:10 [I][min_average:667]: a:10 b:10 c:10

Any idea if this is for any help for further trouble shooting and what could be the root cause?

Side note: also quite often "[W][light_level:302]: Too dark" is shown in the log.

Any idea how we could find out the root cause for this problem?

As a workaround I've now created an automation which restart the power meter every night @ 3:00 PM. Let's wait if under this condition whether the fault still occurs or if the water meter now records over long term valid value's of consumption.

Best regards, Thomas

martijnED commented 3 weeks ago

I am already writing a version for your watermeter, amd will come back to you this weekend about it. Need some time I need to adjust for your watermeter a different version of min max function

thoha1970 commented 3 weeks ago

ok, thank you. Take the time you need, this is nothing with high priority

martijnvwezel commented 3 weeks ago

Did you tried to install an older version on your watermeter? You could try an older version that gives more debug information. Back in the days I gettered data in a new created HA, for temporary used (gives really alot of data you dont want to save). and used speedy mode to capture this data. In influx db you can then export it easily to csv file.

This file I can analyse, and finetune the values. This is quite difficult if you don't understand the compleet algorithm. So don't worry. This is also not an easy task, but I will make some time to do so.

thoha1970 commented 3 weeks ago

I've currently running already v2.0.3 Shall I go for a even oder version? v2.0.0?

martijnvwezel commented 2 days ago

Can we discuss the next steps for this issue. I am having some more time to look into this

thoha1970 commented 2 days ago

yes, let me know what you need. Currently I'm running v2.0.3 (but v2.0.3 still having the same problem over a few days). Since I reset the device via an automation every night @ 3:00 the readings are much more stable / really less mis-readings. However: from time to time I still see negative readings ( -1liter, -2 liter) and sometimes the measure do dot represent the real consumption.

martijnvwezel commented 2 days ago

I hoped you have the version installed the moment you pressed speed modus the values change quicker.

with influx db you could easily export the data to me.

martijnvwezel commented 2 days ago

As I already sugested on the email is the min max function is the cause of the weird behavior. Looking at the raw data would give me a better view on what is wrong

thoha1970 commented 1 day ago

I've installed and configured InfluxDB, but really struggle how to create a query for the data you need. Database and User is setup proper, but I'm having no clue how to setup the required query .... Could you provide me some tips / how to's?

thoha1970 commented 18 hours ago

ok, seems I'm getting the needed query setup and running in Influx DB. I'm recording following entities: sensa sensa_dark sensa_sub sensb sensb_dark sensb_sub sensc sensc_dark sensc_sub

Are these the data / entities you need for analyses?

The device is running in speed mode. I've switched off the automation which restart the device every night at 3:00.

How long I should run these recordings?

martijnED commented 15 hours ago

Do it for a day. Then i will examine the values if i need more info I will make some more debug options. If you need help with making a csv, there is somewhere abutton for that :p not sure how to exactly influx doesnt work anymore on my ha installation

thoha1970 commented 2 hours ago

find attached the InfluxDB csv file, recorded from 07.07.24 9:12 until now: 2024-07-08-12-33 Chronograf Data.csv

thoha1970 commented 2 hours ago

I've done not device reset this night at 3:00 and you can see, problem is there again since 0:00 tonight:

image

image

image