meter

package
v0.0.0-...-e7f52fa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2025 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	MeterID ID             `json:"meter_id"`
	Values  map[Type]Value `json:"values"`
}

type ID

type ID []byte

func (ID) MarshalJSON

func (id ID) MarshalJSON() ([]byte, error)

func (ID) String

func (id ID) String() string

type Type

type Type string
var (
	TypeEnergyInTotal   Type = "energy_in_total"
	TypeEnergyInTariff1 Type = "energy_in_tariff1"
	TypeEnergyInTariff2 Type = "energy_in_tariff2"
	TypeEnergyInTariff3 Type = "energy_in_tariff3"
	TypeEnergyInTariff4 Type = "energy_in_tariff4"

	TypeEnergyOutTotal   Type = "energy_out_total"
	TypeEnergyOutTariff1 Type = "energy_out_tariff1"
	TypeEnergyOutTariff2 Type = "energy_out_tariff2"
	TypeEnergyOutTariff3 Type = "energy_out_tariff3"
	TypeEnergyOutTariff4 Type = "energy_out_tariff4"

	TypePowerAbsolute Type = "power_absolute"

	TypePowerTotal  Type = "power_total"
	TypePowerPhase1 Type = "power_phase1"
	TypePowerPhase2 Type = "power_phase2"
	TypePowerPhase3 Type = "power_phase3"

	TypePowerInTotal  Type = "power_in_total"
	TypePowerInPhase1 Type = "power_in_phase1"
	TypePowerInPhase2 Type = "power_in_phase2"
	TypePowerInPhase3 Type = "power_in_phase3"

	TypePowerOutTotal  Type = "power_out_total"
	TypePowerOutPhase1 Type = "power_out_phase1"
	TypePowerOutPhase2 Type = "power_out_phase2"
	TypePowerOutPhase3 Type = "power_out_phase3"

	TypeCurrentPhase1 Type = "current_phase1"
	TypeCurrentPhase2 Type = "current_phase2"
	TypeCurrentPhase3 Type = "current_phase3"

	TypeVoltagePhase1 Type = "voltage_phase1"
	TypeVoltagePhase2 Type = "voltage_phase2"
	TypeVoltagePhase3 Type = "voltage_phase3"

	TypePhaseAngleUL1ToUL2 Type = "phase_angle_U-L1_to_U-L2"
	TypePhaseAngleUL1ToUL3 Type = "phase_angle_U-L1_to_U-L3"
	TypePhaseAngleUL2ToUL1 Type = "phase_angle_U-L2_to_U-L1"
	TypePhaseAngleUL2ToUL3 Type = "phase_angle_U-L2_to_U-L3"
	TypePhaseAngleUL3ToUL1 Type = "phase_angle_U-L3_to_U-L1"
	TypePhaseAngleUL3ToUL2 Type = "phase_angle_U-L3_to_U-L2"

	TypePhaseAngleUL1ToIL1 Type = "phase_angle_U-L1_to_I-L1"
	TypePhaseAngleUL2ToIL2 Type = "phase_angle_U-L2_to_I-L2"
	TypePhaseAngleUL3ToIL3 Type = "phase_angle_U-L3_to_I-L3"

	TypeFrequency Type = "frequency"
)

type Unit

type Unit string
var (
	UnitDegrees       Unit = "°"
	UnitWatts         Unit = "W"
	UnitKiloWattHours Unit = "kWh"
	UnitAmperes       Unit = "A"
	UnitVolts         Unit = "V"
	UnitHertz         Unit = "Hz"
)

type Value

type Value struct {
	Val     int64
	Scaler  int8
	Unit    Unit
	Derived bool
}

func (Value) MarshalJSON

func (v Value) MarshalJSON() ([]byte, error)

func (Value) String

func (v Value) String() string

func (Value) ValFloat64

func (v Value) ValFloat64() (out float64)

func (Value) ValString

func (v Value) ValString() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL