Skip to content

Singlestat doesn't work when different timeframes are specified?? #18

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

Open
johnny2678 opened this issue Jan 11, 2019 · 1 comment
Open

Comments

@johnny2678
Copy link

First of all, love this! This totally breathed new life into my stale grafana dashboards, so thank you!

Having an issue getting singlestat to work when different time frames are specified. Use case is AC filter life. Basically, take the total # of hours the unit has run in a year ($0) (divided by 6 for 6 changes a year), subtract that from the # of hours the unit has run since the last filter change ($1) and display remaining filter life in a Singlestat

$0:"SELECT sum("jhTIS") /21600 FROM "thermostatOperatingState" WHERE ("deviceName" = 'Nest Thermostat - XXXYYY' AND "value" != 'idle') AND time >= 1515697610630ms

$1: SELECT sum("jhTIS") /3600 FROM "thermostatOperatingState" WHERE ("deviceName" = 'Nest Thermostat - XXXYYY' AND "time" > 1539523582s AND "value" != 'idle')

;MATH name="ALL" expr="$0-$1" singlestat"

Except, the single stat only shows the $0 result. Any ideas why?

@hardiksondagar
Copy link

I ran into the same issue. I was showing percentage difference between two month's total value. But it's showing only $0.

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