diff --git a/src/publisher/influxdb.ts b/src/publisher/influxdb.ts index 64d7ae2..19681b6 100644 --- a/src/publisher/influxdb.ts +++ b/src/publisher/influxdb.ts @@ -42,6 +42,15 @@ export class InfluxDBPublisherImpl implements PublisherImpl { .floatField('power', data.power) .timestamp(data.timestamp) + // Optional data + if (data.apparentPower) { + power.floatField('apparentPower', data.apparentPower) + } + + if (data.powerFactor) { + power.floatField('powerFactor', data.powerFactor) + } + // Optional tags if (data.circuit.group) { power.tag('group', data.circuit.group)