Documentation ¶
Index ¶
- Variables
- func F_2_C(v float64) float64
- func IN_2_MM(v float64) float64
- func InitFlags_rtl433()
- func InitFlags_zytemp()
- func KM_H_2_M_S(v float64) float64
- func KPA_2_HPA(v float64) float64
- func MI_H_2_M_S(v float64) float64
- func NO_CONV(v float64) float64
- func PSI_2_HPA(v float64) float64
- type DeviceConfig
- type Measurement
- type MeasurementType
- type MeasurementTypeDetails
- type SensorDevice
- type SupportedDevice
- type UnitConverter
- type UnitConverterFunc
- type ValueType
Constants ¶
This section is empty.
Variables ¶
View Source
var FlagRtl433Path string
View Source
var SupportedSensorDevices = map[string]*SupportedDevice{ "usb_zytemp": {"USB CO2 sensor: Holtek Semiconductor, Inc. USB-zyTemp", InitFlags_zytemp, InitSensor_zytemp}, "rtl_433": {"Generic wrapper using rtl_433 to collect measurements", InitFlags_rtl433, InitSensor_rtl433}, }
Functions ¶
func InitFlags_rtl433 ¶
func InitFlags_rtl433()
func InitFlags_zytemp ¶
func InitFlags_zytemp()
func KM_H_2_M_S ¶
func MI_H_2_M_S ¶
Types ¶
type DeviceConfig ¶
type Measurement ¶
type Measurement struct { Type MeasurementType Value float64 SensorModel string // model of sensor to use as label - in case multiple sensors report the same measurement SensorId string // id of sensor to use as label - in case multiple sensors report the same measurement }
type MeasurementType ¶
type MeasurementType int
define supported measurement types
const ( // measurements from zyTemp TEMPERATURE_C MeasurementType = iota HUMIDITY_PERCENT CO2_PPM // additional measurements from rtl 433 - is there a complete list BATTERY BATTERY_OK POWER_W PREASURE_HPA RAIN_RATE_MM_H RAIN_MM UV_INDEX WIND_AVG_M_S WIND_MAX_M_S WIND_DIR_DEG // couter types VALUES_COUNTER IGNORED_COUNTER // types for error counters ERRORS_CONNECT ERRORS_IO ERRORS_PARSE )
func GetAllMeasurementTypes ¶
func GetAllMeasurementTypes() []MeasurementType
type MeasurementTypeDetails ¶
type MeasurementTypeDetails struct { MetricName string // will be used as last part prometheus metric FQName MetricHelp string // metric help MetricValue ValueType }
func GetMeasurementTypeDetails ¶
func GetMeasurementTypeDetails(m_type MeasurementType) MeasurementTypeDetails
type SensorDevice ¶
type SensorDevice interface { DeviceType() string DeviceId() string DeviceVendor() string DeviceName() string GetMeasurements() []Measurement }
define generic interface to be implemented by each sensor device
func InitSensor_rtl433 ¶
func InitSensor_rtl433(cfg *DeviceConfig) (SensorDevice, error)
func InitSensor_zytemp ¶
func InitSensor_zytemp(cfg *DeviceConfig) (SensorDevice, error)
type SupportedDevice ¶
type SupportedDevice struct { Description string InitFlagsFunction func() InitFunction func(*DeviceConfig) (SensorDevice, error) }
type UnitConverter ¶
type UnitConverter struct { SrcType string DstType string Convert UnitConverterFunc }
func GetMeasurementConverter ¶
func GetMeasurementConverter(typedUnit string) (string, *UnitConverter)
type UnitConverterFunc ¶
define unit conversion routines
Click to show internal directories.
Click to hide internal directories.