InfluxDB (v2) "resetting" and metrics uploaded

I’ve been playing with InfluxDB v2 and after a bit of experimentation, I think I finally have what I want. (Or do I? More below.)

At this point, I want to “reset” the Influx bucket. Suggestions on best way to do that? I was thinking I’d stop the IoTaWatt uploader, rename the bucket to “*-old”, create a new bucket with the same original name, and then restart the uploader. The one thing I’m not sure of is…will the IoTaWatt resync all the past history again (I have the start date as the day before I brought my IoTaWatt online)? I’m suspecting it keeps track of its uploads and will re-start at the time I stopped it.

If my suppositions are true, then I’m guessing I will have to delete the uploader and configure it as new?

Do I have what I want? Please pipe up if you’ve found some other metrics useful:

  • watts for all CTs (11 branch circuits and 2 mains)
  • voltage for voltage reference
  • power factor for 2 mains
  • frequency

I figure I’ll do the math in Influx or Grafana for things like Total Watts (addition of two mains) and “everything else” (two mains minus 11 branch circuits), which I currently have onboard the IoTaWatt for the Graph+ graphs.

I may have found the “reset” answer here:

“You could have simply stopped the uploaded, set the upload date to the day of the interruption, and restarted the upload.”

That thread is in reference to Emoncms, but maybe Influx is different though… (I’ll wait a little longer for a more authoritative answer.)

The IoTaWatt doesn’t keep track of the last upload. When it starts or restarts, it does a query of influxDB to find the time stamp of the latest entries as defined by the current tags and outputs. It will then start uploading at the latest time stamp found.

So if you change the bucket or database the query will find nothing.

Worked like a charm. Thanks, Bob!

(I edited the original post to add a missing step: “create a new bucket with the same original name.”)

1 Like