How can I reset a counter?

Moderator: leecollings

Post Reply
ubee
Posts: 66
Joined: Tuesday 10 February 2015 20:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Sweden
Contact:

How can I reset a counter?

Post by ubee »

I've started to play around with a water meter connected to S0 meter USB interface. I did not fully get how to use the Counter divider to begin with, and by that got a few days of bad data. I would like to clear all data but I can't figure out how to do this.I found a post with a hint you should be able to do this on the log page and click on the bar you would like to delete while you you press shiift at the same time. This brings up a dialog asking me to confirm I would like to delete this piece of data. I do so, but nothing happens. Data is still there.

So how can I get rid of old data? There must be a way to do this. Or do I have to remove the device and create a new one?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: How can I reset a counter?

Post by waaren »

ubee wrote: Wednesday 08 July 2020 21:29 got a few days of bad data. I would like to clear all data
The GUI method you describe should work for a single datapoint. I just tested it in recent Beta and latest stable. Do you see anything in the log when you try to delete a datapoint?
Other way is to remove the data directly from the database:

Code: Select all

cd <domoticz dir>
sudo cp domoticz.db domoticz.safe # just for safety
sudo sqlite3 domoticz.db
delete from meter where devicerowid is <idx> ; select changes() ; -- replace <idx> with actual device idx 
delete from meter_calendar where devicerowid is <idx> ; select changes() ;
.quit 
Or as you suggested remove device and create new one.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
ubee
Posts: 66
Joined: Tuesday 10 February 2015 20:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Sweden
Contact:

Re: How can I reset a counter?

Post by ubee »

No, I can't see anything in the log when I try to erase a single datapoint. I have a few other Rasps in my house in my "production>" system. On those systems I can delete single datapoints in a temperature graph. I don't have any utility devices on those, so I can't verify if this works for anything else than temperature devices. I´m running 4.10717 on those. In my test setup where I noticed the problem, I run version 2020.2.

Edit: I added an internal temperature sensor on the Rasp motherboard. I had no problem to erase a single temp data point in the log. So it looks like my problem is isolated to the utility meter.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests