How to clear all datapoints?

Hi guys...

i have asked this a lot and there it seems that nobody knows....

 

but are thare not a command i can fire so that the datapoints are cleared but everything else i keept intact...

 

i want to do this when the pi finds its final install place... for now its on a shelf near the router and not in the utility closet where i want...

 

so the data its logging now is just kind of test data... but i have build dashboards etc just to my liking... dont want to do that all over again

Paul Reed's picture

Re: How to clear all datapoints?

Bo, can you edit your post and give it a proper title please, relative to the issue that you are raising. 
Calling it '@Glyn or Trystan' is not helpful when members review or search posts, and directing your question to named persons goes against forum etiquette.
If you wish to restrict your question to T&G, then perhaps you should PM them instead of posting in a members forum.

Thanks

Paul - forum moderator

Edit 2/10 --> Post Title changed by me....

boelle's picture

Re: How to clear all datapoints?

well... i have asked and no other user knew... i could PM them but then the other users would not benefit from the answer.... 

 

the @ was just to attract attention...

 

EDIT: have put back the @ part but also keept the better topic... 

EnergyRnR's picture

Re: How to clear all datapoints?

I would use phpmyadmin and delete the data you don't need ( i.e. between certain dates) in sql. 

Another option, if you have too much data, would be to just save the source for the dashboard (i.e. back them up) and then d a clean install of everything from the beginning. Then manually put the dashboard source code into sql, and do some minor edits in emoncms to set up the appropriate feeds. 

Eamonn

Bill Thomson's picture

Re: How to clear all datapoints?

If you delete, then recreate your feeds, that will do what you want. After recreating your feeds, you'll have to go into the dashboard editor and reassign the feeds to your widgets and visualizations, but you shouldn't have to rebuild them. I've done this several times with no problems.

 

TrystanLea's picture

Re: How to clear all datapoints?

@boelle, Seconding Bill Thomson, deleting and recreating the feeds is currently the way to do this. A clear feed function would be a nice feature to add.

boelle's picture

Re: How to clear all datapoints?

I think i will opt for the phpmyadmin way.... 

 

deleting all feeds and recreate them means that they are not in sync so to speak.... my feeds for district hot water has to start at the same time so i can compare them...

 

but yes a clear all data botton would be damm nice :-D

boelle's picture

Re: How to clear all datapoints?

how would you do it via phpadmin? i can see the feeds table but not the data...

boelle's picture

Re: How to clear all datapoints?

could it be that its now timeseries and not sql? so i have to edit a text file instead and clear it that way?

boelle's picture

Re: How to clear all datapoints?

figuered one way to do it

 

log in as pi

 

go to /data/phptimeseries... simply delete the feed file you want to clear...

 

wait a bit and the file is recreated

 

can an expert confirm its a valid way to do it?

boelle's picture

Re: How to clear all datapoints?

did almost work... it keeps the last data... prob because the logging is running in background

pb66's picture

Re: How to clear all datapoints?

I assume you are using the latest SD card image. you could try stopping emonHub before deleting the feed data

    sudo service emonhub stop

and then after you've finished

    sudo service emonhub start

But if you still have "old" data showing up after that, you may need to try again but this time also flush any data from redis

    sudo redis-cli FLUSHALL

will flush all redis data from all feeds.

The "safe" way is to delete the feed as previously suggested but in theory yes there should be a way of deleting just the feed data. You can see what happens when you delete a feed the correct way in emoncms by looking at this code.

https://github.com/emoncms/emoncms/blob/bufferedwrite/Modules/feed/feed_model.php#L436

It seems 3 things are done:

  1. Delete the feed, which you are doing
  2. Delete the SQL data - which you don't want to do so that it's retained
  3. Delete redis data.

Then if the data feed is recreated ok it would appear this method works. There is also a feed value retained in the SQL table but I do not know if that will effect the new data or not so you may also need to delete that value also but its unlikely.

Interested to hear how you get on.

Paul

EDIT - in fact you will probally also need to stop apache, depending on the data feed type, as even with no new data coming in to emonCMS the data engine may continue to create data points at regular intervals.

boelle's picture

Re: How to clear all datapoints?

having gotten my kwh data poisened by the 1970 issue i would wish emoncms came with a tool to edit datapoints rather than clearing data

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.