Infludb Flux Count Query

I want to count number of device_mac which are between 2C to 8C between 12am to 6am

My Query is

from(bucket: “general”)
|> range(start: -24h, stop: -1s)
|> filter(fn: (r) => r[“_measurement”] == “mem”)
|> filter(fn: (r) => r[“_field”] == “device_temperature”)
|> filter(fn: (r) => r[“_value”] >= 2 and r[“_value”] <= 8)
|> group(columns: [“device_mac”])
|> aggregateWindow(every: 15m, fn: mean, createEmpty: false)

If i wish to search for a list of device_mac address all at once is there any option or query which can return instant result !!

[“BC5729035296”,“BC572903525C”,“BC572902866A”,“BC572902A649”,“BC572902A646”,“BC5729035294”,“BC572902865F”,“BC572902A63A”,“BC572903529A”,“BC572902865D”,“BC5729035282”,“BC572902A64E”,“BC572903529F”,“BC572903524D”,“BC5729035280”,“BC5729028664”,“BC572902865C”,“BC5729035255”,“BC572902A632”,“BC572903524A”,“BC572903F23E”,“BC572902A645”,“BC5729028658”,“BC572902A64C”,“BC572903529E”,“BC572902865E”,“BC572903F2F5”,“BC572902A620”,“BC572903F218” ]

Hi. If you just want to count the devices, then I think this should work:

from(bucket: "general")
|> range(start: -24h, stop: -1s)
|> filter(fn: (r) => r["_measurement"] == "mem")
|> filter(fn: (r) => r["_field"] == "device_temperature")
|> filter(fn: (r) => r["_value"] >= 2 and r["_value"] <= 8)
|> hourSelection(start: 0, stop: 6)
|> group(columns: ["device_mac"])
|> aggregateWindow(every: 15m, fn: mean, createEmpty: false)
|> count()

How to handle UTC and GMT time in our query .

I think this may help.