Page 1 of 1

How can I reset a counter?

Posted: Wednesday 08 July 2020 21:29
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?

Re: How can I reset a counter?

Posted: Wednesday 08 July 2020 21:52
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.

Re: How can I reset a counter?

Posted: Thursday 09 July 2020 21:24
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.