martijnvwezel / watermeter-esphome

22 stars 10 forks source link

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

Open thoha1970 opened 5 months ago

thoha1970 commented 5 months 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 5 months 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 5 months ago

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

martijnvwezel commented 5 months 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 5 months ago

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

martijnvwezel commented 4 months ago

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

thoha1970 commented 4 months 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 4 months 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 4 months 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 4 months 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 4 months 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 4 months 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 4 months 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 4 months 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

martijnvwezel commented 4 months ago

The data provided is not helping me, can you see variables sen_a ... sen_C?

thoha1970 commented 4 months ago

sorry for the late reply, I've not been notified about your comment 2 weeks ago.

I do not have variables / entitities named sen_a - sen_c . I only have sensa - sensc, and these are already included in the csv file.

Any idea what I have to do?

martijnED commented 3 months ago

Could you have a talk with me on discord?

thoha1970 commented 3 months ago

I'm currently in vacation in Croatia. Will be back in 2 weeks, Greetings, Thomas

col-panic commented 1 week ago

My sensor does not seem to work correctly at all. The values are far too low, and i don't understand them:

e.g. its being constantly on 12 but not recording and consumption for the energy dashboard

grafik

Is there anywhere a troubleshoot, or what should i do?

martijnED commented 1 week ago

Try to restart the Muino meter each day, should be something quite simple for that. I assume the calibration settings seem to explode in your setup. I am researching a new option for calibration but is quite complex problem. And I am trying some different methods to improve. The hardest part of the Muino water-meter is the limitation of memory CPU time.

I checked your meter someone in the past with similar meter had same issue as you, but solved it just by restarting each day to solve exploding value.

martijnED commented 1 week ago

This weekend I finally have time to work on the algorithm again. I am creating a way for people to make it more simple to export live data so I can analyse it.

col-panic commented 1 week ago

@martijnED can the meter be restarted programmatically? I mean I wouldn't wanna go down and un/plug all the time ...

martijnED commented 1 week ago

Yes is possible because it uses esphome you can do that with an automation

martijnvwezel commented 6 days ago

I didnt work on it this weekend, I am sick so trying next weekend.