TL;DR Tech Tips — How to Monitor States with InfluxDB

from(bucket: “solar”)
|> range(start: -task.every)
|> filter(fn: ® => r["_measurement"] == “battery”)
|> filter(fn: ® => r["_field"] == “kWh”)
|> derivative(unit: 3s, nonNegative: false, columns: ["_value"], timeColumn: “_time”)
|> map(fn: ® => ({
r with
_level:
if r._value > 0.0 then “CH”
else “DH”
}))
|> monitor.stateChanges(
fromLevel: “CH”,
toLevel: “DH”
)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store