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”
)

--

--

--

Developer Advocate at InfluxData

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Why was YepCode created?

You’re Crazy … If You’re Not Using Scrum to Help Manage Remote Teams

Retrieve Vault Secrets with Kubernetes CSI

Convert Excel (97–2003) XLS to CSV in Swift

Change Data Capture with Debezium Kafka and MySQL

In my last article, I discussed about generating a dataset using the Application Programming…

Contributing my way for SunPy1.0

Service Blueprint, an ingredient to understanding Business Model

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
Anais Dotis

Anais Dotis

Developer Advocate at InfluxData

More from Medium

Lyn Health’s Data Laboratory

Humans of DataHub: Hyejin Yoon

Porting a data platform from AWS to Azure