flower is a service that implements the InfluxDB / Flux API, and executes it as SignalFlow instead of Flux.
It talks to an InfluxDB backend. This could eventually be pluggable.
The service is configured with the following environment variables:
| Variable | Usage |
|---|---|
FLOWER_LISTEN_ADDRESS |
The address to listen on, eg :8123 |
FLOWER_INFLUX_HOST |
The InfluxDB host to talk to, eg https://influxdb.local/ |
FLOWER_INFLUX_TOKEN |
The InfluxDB token to authenticate with, eg foo== |
FLOWER_INFLUX_ORG |
The InfluxDB org to authenticate to, eg local |
I like SignalFlow.
This implements data() and a handful of stream methods. The SignalFlow parser/evaluator is mostly accurate, lacking
imports and .map().
partition_filter()is not implemented.regex_filter()is an additional filter function.
This is being tested against Grafana. Because the InfluxDB plugin in Grafana does not pass a time range, it is
necessary to explicitly pass it in the query. This is done with the special window() function:
window("v.timeRangeStart", "v.timeRangeStop")Grafana will inject the suitable time values in to the program. If this is not provided, the query will run from -1h to the current time.
Queries something from Home Assistant exporting to InfluxDB.
window('v.timeRangeStart', 'v.timeRangeStop')
A = (
data(
'W',
filter=filter('entity_id', 'power_plug_*1234*'),
rollup='max',
)
.publish('W')
)
B = (
A
.mean(over='5m')
.publish('W smoothed')
)