meter

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2021 License: MIT Imports: 5 Imported by: 1

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) Close

func (t *EnergyMeter) Close() error

Close closes 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.

Jump to

Keyboard shortcuts

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