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

InfluxDB: Total AC channel #5

Open
broth-itk opened this issue Aug 21, 2023 · 2 comments
Open

InfluxDB: Total AC channel #5

broth-itk opened this issue Aug 21, 2023 · 2 comments

Comments

@broth-itk
Copy link

Thanks for your great dashboard!
I really enjoy using it :)

I missed to see the total AC power in the diagram "Leistungsverlauf".

This is my proposal:

Calculated:

from(bucket: "${bucket_opendtu}")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "output")
  |> filter(fn: (r) => r["_field"] == "power")
  |> aggregateWindow(every: 30s, fn: max, createEmpty: false)
  |> group(columns: ["_time"], mode: "by")
  |> sum(column: "_value")  
  |> group()
  |> yield(name: "total")

Using "output_per_dtu" measurement (better performance)

from(bucket: "${bucket_opendtu}")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "output_per_dtu")
  |> filter(fn: (r) => r["_field"] == "power")
  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
  |> yield(name: "total")

@smainz
Copy link
Owner

smainz commented Aug 21, 2023

Thanks for yout input,did never miss it.

As one can have multiple DTUs, I would use a combination of both of the queries:

from(bucket: "${bucket_opendtu}")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "output_per_dtu")
  |> filter(fn: (r) => r["_field"] == "power")
  |> aggregateWindow(every: 10s, fn: max, createEmpty: false)
  |> group(columns: ["_time"], mode: "by")
  |> sum(column: "_value")  
  |> group()
  |> yield(name: "total")

I will release a new version after hollidays including this and a long term chart.

@broth-itk
Copy link
Author

Thanks for your update! I added the combination and it works just fine.

Attached a screenshot for yesterdays results. I wouldn't miss it if I had only a few panels which point to the same direction.
But in my case they point to different cardinal directions to compensate shading. The total value starts to make sense.

Screenshot at 2023-08-22 06-19-54

Enjoy your holidays!

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