Best practices for influxdb?

Yes, functioning as designed. IoTaWatt queries all of the measurements and restarts uploads of all after the date of the most recent.

Thanks for your always stellar guidance and insight Bob. Up and running, pumping the data over like a champ. For the amount I watched, it seems to be able to transfer about 2 minutes of 5-second intervals over in about 5 seconds, if it ever has to play catchup

When integrating energy data in Influx (2.x), is it best to create a pivot table with all outputs on a single row, or keep the raw format of a single measurement per row?

I would like to be able to do math operations between measurements for a specific window, and I am struggling with how to best pull that off with the Influx documentation.

I think its fair to say that many users are struggling with the flux query language. These types of questions might better be raised in the influx forum where the participants may be more immersed in it and have a better understanding.

What are you trying to do, what math?
I started using Flux several months ago to enable doing math across measurements (in InfluxDB) because I have two IotaWatts and wanted to aggregate the data.

I also use Grafana. Grafana offers some math too, that can work across measurements.

I have my data going to InfluxDB in one measurement. The data is tagged with the device and channel. This was based on the earlier recommendations.

Using Flux to aggregate data is hard (syntax is confusing and not easy to remember, would likely be be better with more examples, there were very few when I did this). Flux seems like it might be slower integrating W data into WH. It is okay for short periods, but quite slow for long periods. It is also really slow for finding a maximum over a long period. (Think finding the maximum amps used over the last 6 months. It can do it, but it hits the one virtual CPU core I give it very hard for as much as min. I am running it on something much more powerful than an RPI 4).

So, what insights are you hoping to get from the data. That will help determine what math you need and then how to set it up. If you don’t know yet, just follow the standard way I listed. It works well with both InfluxDB and Grafana.

@frogmore I am struggling with a few of the basic concepts for now. I export volts and watts from IoTaWatt to Influx in a bucket called iotabucket from my three meters. (I have a main panel that sub-feeds two other panes, as well as the PV disconnect and three mini-split air conditioners.) The main meter also exports PF for the utility feed. In addition to the CT loads directly, I also export calculated “import”, “export”, and split-phase loads— watts only.

I want to integrate the individual loads into hourly energy values, presumably in a second bucket. Part of me contemplates also calculating min/max Watts for each hour. Some preliminary testing makes it look like the integration does not always generate valid results, especially for my import/export calculated values.

For Grafana, I would like to be able to do some kind of histogram or series of pie charts that help understand where energy consumption is going, and also some graphs that help me understand real-time how I am doing with self-consumption of PV, and the status of my net-metering on a day/week/month perspective. Separately, I want to track my EV charging and mileage, and how much of my EV charging is self-consumption. I don’t have a great sense of how I will display the information yet, but the key point is that I will need data from all three units for some graphing operations. My basic understanding is that to do that I need to pivot data so that I have a single time row, and value columns for each meter. I am unsure if this is a persistent table, or dynamically created for the graph.

I’ll keep trying to do more digging to better understand Influx and Grafana, but I want to make sure my data is structured in a way that it works well for the future.

1 Like

Now that IoTaWatt has the integrators capability, if I want to upload Wh used over time, is the recommendation to use it to integrate Wh on iotawatt, and then upload it to influxDB?

In general, IoTaWAtt tracks Wh fine without using integrators. The exception is where the data is not monotonically increasing, and you want to isolate the negative and positive signals that are contributing to that. Case in point is grid import/export with local energy production such as PV.

Even where PV is present, many of the tariffs are based on true net-metering, which does not require knowing the discrete import and export energy, only the net which is what IoTaWatt naturally records.