Documentation ¶
Overview ¶
Provides functionality for reading and decoding SMA energymeter data packets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnergyMeter ¶
type EnergyMeter struct {
Conn energyMeterConnection
}
func Listen ¶
func Listen() (*EnergyMeter, error)
Listen opens a multicast socket to listen for energymeter messages.
Returns an EnergyMeter representing the opened connection.
func (*EnergyMeter) ReadTelegram ¶
func (t *EnergyMeter) ReadTelegram() (*EnergyMeterTelegram, error)
ReadTelegram reads and decodes an energymeter telegram from the connection.
The method blocks until a telegram is received.
type EnergyMeterTelegram ¶
type EnergyMeterTelegram struct { SusyID uint16 SerialNo uint32 MeasuringTime uint32 Obis map[OBISIdentifier]uint64 SoftwareVersion SoftwareVersion }
EnergyMeterTelegram represents a decoded telegram.
func DecodeTelegram ¶
func DecodeTelegram(data []byte) (*EnergyMeterTelegram, error)
DecodeTelegram decodes the given energy meter compatible telegram into an EnergyMeterTelegram.
type OBISIdentifier ¶
type OBISIdentifier struct {
Channel, MeasVal, MeasType, Tariff uint8
}
OBISIdentifier represents an identifier following the OBIS standard.
type SoftwareVersion ¶
type SoftwareVersion struct {
Major, Minor, Build, Revision uint8
}
SoftwareVersion represents a software version of an Energy Meter.
Click to show internal directories.
Click to hide internal directories.