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?
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?