Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depeding on grafana zoom level, water meter gallons used is different #37

Closed
cypherstream opened this issue May 2, 2022 · 2 comments
Closed

Comments

@cypherstream
Copy link

cypherstream commented May 2, 2022

First of all, awesome program! I already have a grafana setup and InfluxDB instance monitoring my home networking. I've been eyeing up a flume 2 water meter add on but it's over $200. For just the SDR I can accomplish the same thing.

The one thing I'm not so sure about is the scaling in grafana. If I'm zoomed in at 20:50 I see a spike of 150 gallons used. If I'm zoomed out to 3 hour window it looks like 450 gallons used.

image

image

It's set to difference. Should I be setting it to something else?

image

As far as the units... I'm not sure they are right or if I need to divide by 10 for example. At some point I'll fill up a 5 gallon bucket and see if it actually registers as 5.

@bemasher
Copy link
Owner

I no longer have a version prior to Influxdb2 to test with, so this will only be a guess. The way you're aggregating your consumption is going to differ with time intervals. Here is an example of a better way to do it, though it uses flux, so will require some grokking on your part.

from(bucket: "7d")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "utilities")
  |> filter(fn: (r) => r["msg_type"] == "differential")
  |> filter(fn: (r) => r["_field"] == "consumption")
  |> aggregateWindow(every: 15m, fn: sum, createEmpty: true)
  |> map(fn: (r) => ({r with _field: "Power"}))
  |> drop(columns: ["endpoint_id", "endpoint_type", "msg_type", "protocol"])

@bemasher
Copy link
Owner

Closing due to age.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants