From 6b17a4fd0051ca4582d499c9281645e4e959d805 Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 6 Jun 2023 21:36:42 +0200 Subject: [PATCH] Push import/export values Fix the data entry for import/export to use the actual value. --- cmd/smartbridge/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/smartbridge/main.go b/cmd/smartbridge/main.go index a2f6886..40df2d8 100644 --- a/cmd/smartbridge/main.go +++ b/cmd/smartbridge/main.go @@ -88,7 +88,7 @@ func main() { } // Import and Export values tags = map[string]string{"unit": "Wh"} - fields = map[string]interface{}{"import": reading.Electricity.Import.Current, "export": reading.Electricity.Export.Current} + fields = map[string]interface{}{"import": reading.Electricity.Import.Current.Value, "export": reading.Electricity.Export.Current.Value} if err := influx.Write(cf.Influx.Organization, cf.Influx.Bucket, cf.Influx.Measurement, tags, fields); err != nil { fmt.Fprintf(os.Stderr, "influxdb error: %s\n", err) }