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

API query not accruing correctly when using min/max #303

Closed
PhilRW opened this issue Aug 6, 2021 · 2 comments
Closed

API query not accruing correctly when using min/max #303

PhilRW opened this issue Aug 6, 2021 · 2 comments

Comments

@PhilRW
Copy link

PhilRW commented Aug 6, 2021

I have two outputs which I use to convert net metering into two separate values: grid energy consumed and energy returned to grid. Here's an example:

net: subpanel_1 + subpanel_2 + pv
grid_consumption: (( subpanel_1 + subpanel_2 + pv) max 0) abs
grid_return: (( subpanel1+ subpanel_2 + pv) min 0) abs

This query http://iotawatt/query?select=[net.wh,grid_consumption.wh,grid_return.wh]&begin=d&end=s&group=all
returns [[18600,18600,0]] even though the internal graph+ utility charts it properly. I would expect it to return something more along the lines of [[18600,24600,6000]]

graph+ shows it properly:

image

@Glazzanz
Copy link

@PhilRW agree with you, I am also having this issue.

@boblemaire
Copy link
Owner

As explained in this forum post https://community.iotawatt.com/t/solar-import-export/3175, the query above uses group=all, which returns the net value over the period. (Some folks who have true net metering want to know that) When graphing that function with Graph+, you are implicitly querying the net for two-minute periods.

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

3 participants