Skip to content

Commit

Permalink
Publish apparent power and power factor to InfluxDB
Browse files Browse the repository at this point in the history
Fixes #45
  • Loading branch information
Jalle19 committed Feb 17, 2024
1 parent 75d539f commit 3e1bc11
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/publisher/influxdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3e1bc11

Please sign in to comment.