Skip to content

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

@johnny2678

Description

@johnny2678

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions