boblemaire / IoTaWatt

IoTaWatt Open WiFi Electric Energy Monitor
https://iotawatt.com
GNU General Public License v3.0
639 stars 177 forks source link

feature: per-measurement tags for influx #322

Closed ccutrer closed 2 years ago

ccutrer commented 2 years ago

I'd like to be able to add a "type=total" or "type=device" etc. tag to individual measurements sent to Influx, so that in flux I can build a query that automatically excludes one or the other (total consumption vs. individual circuit). this would be especially useful since I'm going to have 4 iotawatts, and to get the complete consumption for the house, influx will need to sum the "total" measurement for all devices.

boblemaire commented 2 years ago

Adding the ability to specify tags at the individual measurement level is a slippery slope. How many should be allowed?

This is also very complicated from the perspective of adding the spec to the config.txt file. Currently, measurements are handled as "ScriptSets" which are also used for: outputs, integrators, emoncms and PVoutput Scripts.

I'd suggest that you can accomplish this by encoding a "total" indicator in the measurement name and using regular expressions in your queries to recognize it or its absence.

Jalle19 commented 1 year ago

@ccutrer did you come up with a solution for this? I'm faced with the same dilemma.

boblemaire commented 1 year ago

@Jalle19, This is an old issue but looking at it again, I have the same reservations about measurement level tags. But it occurs to me that you could adopt a measurement naming convention that could accomplish the same thing using regular expressions.

ccutrer commented 1 year ago

No. I stopped using InfluxDB when 3.0 came out this spring, and there's not an OSS version. Couple that with my constant issues with high CPU usage for hours and it's seeming inability to reclaim disk space, and I was done with it. I now use TimescaleDB. I plan to write a separate script that will run on my TimescaleDB server to pull the data from IoTaWatt via API.