Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dynamic exporters for smartpireadout
#11
The definition of a struct and returning a map of it goes inline with my idea.
Nevertheless, I would define it more generic.
Let's assume ade7878 is just one of a bunch of inputs,
or we have some readings with different measurement intervals.
For example accumulated watt hours do not need to be recorded every 5 secs.

My proposal is to define a totally generic "measurand".
First shot:
type Measurand struct {
   value float64
   unit string // or are there real units somewhere in go?
   timestamp Time
   name String // used to identify the value and meaning
   properties Type to be defined (maybe it is useful to provide information about time series or accumulated data, don't know)
   sensorID String or int // to identify the sensor (e.g. phase number, or temperature sensor living room, etc.)
}

ade7878.go might return a slice of measureands to handle a dynamic number.
readout.go could handle multiple inputs (such as ade7878) via this generic interface.
readout.go interates through the received slices and identifies the read values via their name and sensorID.

My Raspberry Pi does not only host the SmartPi unit. It is also connected to an Arduino.
The Arduino counts S0 pulses from a watt meter, see
https://github.com/Trickx/ArduinoPulseCounting
(In need to update the readme.)

I think my setup is typical for other customers.
Therefore, why not handle multiple sensors via this go project?
I'm not sure whether enerserve is open for additional sensor data,
but I will compare my energy consumption measured via pulse counting with data from ade7878.
Reply


Messages In This Thread
RE: Dynamic exporters for smartpireadout - by TriCX - 13.05.2017, 20:29

Forum Jump:


Users browsing this thread: 2 Guest(s)