-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Throwing this here for myself:
In current implementation of Venus Influx Loader we mirror Venus DBus paths / MQTT Topics 1:1 when storing into InfluxDB, which means that for example AC consumption is stored in InfluxDB as the following list of separate measurements:
system/Ac/Consumption/L1/Power
system/Ac/Consumption/L2/Power
system/Ac/Consumption/L3/Power
system/Ac/Consumption/L1/Current
system/Ac/Consumption/L2/Current
system/Ac/Consumption/L3/Current
Each of these measurements has associated tag for portalId
and name
identifying the installation.
Each of these measurements has only one value
field obtained directly from MQTT.
In order to perform various calculations directly in Influx DB, as opposed to performing them in Grafana, it may be useful to think about reorganising these into two measurements:
system/Ac/Consumption/Current
system/Ac/Consumption/Power
And both of these having associated tags
and multiple fields
named L1
, L2
, and L3
.
Total power consumption can then be computed via simple Influx select like this:
SELECT L1 + L2 + L3 FROM system/Ac/Consumption/Power ...
https://docs.influxdata.com/influxdb/v1/query_language/math_operators/