I can’t convert true/false values to 1/0. My request looks like this:
from(bucket: "iobroker/global")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_field"] == "value")
|> filter(fn: (r) => r["_measurement"] == "esphome.0.84F3EBAF8F7F.info._online")
|> toInt()
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: "mean")
but as a result, I get values from 0 to 1 (0.5 0.416 0.667). How do I make it return strictly 1 or 0 ?